Summary

        Args:
            grouping_column_name (TYPE): Description

        Returns:
            TYPE: Description
191243
def filter(self, predicates):
        
        tys = []
        for col_name, raw_column in self.raw_columns.items():
            dtype = str(raw_column.dtype)
            if dtype == 'object' or dtype == '|S64':
                weld_type = WeldVec(WeldChar())
            else:
                weld_type = grizzly_impl.numpy_to_weld_type_mapping[dtype]
            tys.append(weld_type)

        if len(tys) == 1:
            weld_type = tys[0]
        else:
            weld_type = WeldStruct(tys)

        if isinstance(predicates, SeriesWeld):
            predicates = predicates.expr

        return DataFrameWeldExpr(
            grizzly_impl.filter(
                grizzly_impl.zip_columns(
                    self.raw_columns.values(),
                ),
                predicates
            ),
            self.raw_columns.keys(),
            weld_type
        )
1340263
def add_column(self, name, type_name, options=None):
        
        column = Column(name, type_name, options)

        self._add_column(column)

        return column
538119
def stats(self, columns):
        
        def reduce_func(sc1, sc2):
            return sc1.merge_pstats(sc2)

        return self._rdd.mapPartitions(lambda partition: [
            PStatCounter(dataframes=partition, columns=columns)])\
            .reduce(reduce_func)
277843
public void addGroupedColumn(int columnIndex) {
        int[][] newColGroups = getColumnGroups();
        // Create a group if none exists.
        if (newColGroups.length == 0) {
            newColGroups = new int[][]{{columnIndex}};
        } else {
            int lastGroupIndex = newColGroups.length - 1;
            int[] lastGroup = newColGroups[lastGroupIndex];
            int groupSize = lastGroup.length;
            int[] newLastGroup = new int[groupSize + 1];
            System.arraycopy(lastGroup, 0, newLastGroup, 0, groupSize);
            newLastGroup[groupSize] = columnIndex;
            newColGroups[lastGroupIndex] = newLastGroup;
        }
        setColumnGroups(newColGroups);
    }
824444
def _get_node_column(cls, node, column_name):
        
        if not hasattr(node, 'columns'):
            node.set('columns', {})

        if column_name in node.columns:
            column = node.columns[column_name]
        else:
            column = {'name': column_name, 'description': ''}
            node.columns[column_name] = column

        return column
678921
function _groupsOrders(type) {
    var items = this.grouped[type];
    if (!items) {
      return '';
    }
    var formatter = this.formatter;
    var sql = items.map(function (item) {
      return (item.value instanceof Raw ? formatter.unwrapRaw(item.value) : formatter.columnize(item.value)) + (type === 'order' && item.type !== 'orderByRaw' ? ' ' + formatter.direction(item.direction) : '');
    });
    return sql.length ? type + ' by ' + sql.join(', ') : '';
  }
1006643
def _columns_for_table(table_name):
    
    return {cname: col
            for (tname, cname), col in _COLUMNS.items()
            if tname == table_name}
962632
def columns(self):
        
        if self.df.empty:
            return None

        columns = []
        sample_size = min(INFER_COL_TYPES_SAMPLE_SIZE, len(self.df.index))
        sample = self.df
        if sample_size:
            sample = self.df.sample(sample_size)
        for col in self.df.dtypes.keys():
            db_type_str = (
                self._type_dict.get(col) or
                self.db_type(self.df.dtypes[col])
            )
            column = {
                'name': col,
                'agg': self.agg_func(self.df.dtypes[col], col),
                'type': db_type_str,
                'is_date': self.is_date(self.df.dtypes[col], db_type_str),
                'is_dim': self.is_dimension(self.df.dtypes[col], col),
            }

            if not db_type_str or db_type_str.upper() == 'OBJECT':
                v = sample[col].iloc[0] if not sample[col].empty else None
                if isinstance(v, str):
                    column['type'] = 'STRING'
                elif isinstance(v, int):
                    column['type'] = 'INT'
                elif isinstance(v, float):
                    column['type'] = 'FLOAT'
                elif isinstance(v, (datetime, date)):
                    column['type'] = 'DATETIME'
                    column['is_date'] = True
                    column['is_dim'] = False
                # check if encoded datetime
                if (
                        column['type'] == 'STRING' and
                        self.datetime_conversion_rate(sample[col]) >
                        INFER_COL_TYPES_THRESHOLD):
                    column.update({
                        'is_date': True,
                        'is_dim': False,
                        'agg': None,
                    })
            # 'agg' is optional attribute
            if not column['agg']:
                column.pop('agg', None)
            columns.append(column)
        return columns
112422
def _get_gtf_column(column_name, gtf_path, df):
    
    if column_name in df.columns:
        return list(df[column_name])

    else:
        raise ValueError(
            "Missing '%s' in columns of %s, available: %s" % (
                column_name,
                gtf_path,
                list(df.columns)))
758181
def _get_stats_column_names(cls):
        
        columns = []
        stats = ('num_bytes', 'num_rows', 'location', 'partitioning_type',
                 'clustering_fields')
        stat_components = ('label', 'value', 'description', 'include')
        for stat_id in stats:
            for stat_component in stat_components:
                columns.append('stats:{}:{}'.format(stat_id, stat_component))
        return tuple(columns)
443140
def cols_(df,col_list,func,*args,**kwargs):
    
    return _pd.DataFrame({col_name:func(df,col_name,*args,**kwargs) for col_name in col_list})
773784
public static String aggregateColumnName(String columnName, String functionName) {
        return String.format("%s [%s]", functionName, columnName);
    }
886487
def build_groups(self):
        
        # check if there are any groupings
        if len(self.groups):
            groups = []

            # get the group sql for each grouping
            for group in self.groups:
                groups.append(group.get_name())
            return 'GROUP BY {0} '.format(', '.join(groups))
        return ''
1013107
def gsum_(self, col: str, index_col: bool=True) -> "Ds":
        
        try:
            df = self.df.copy()
            df = df.groupby([col]).sum()
            if index_col is True:
                df[col] = df.index.values
            return self._duplicate_(df)
        except Exception as e:
            self.err(e, self.gsum_, "Can not groupsum column")
1000707
def columns(self):
        
        schema = self.schema()
        return [schema.column(col) for col in self.__columns]
456611
def groupby_field(records, field_name, skip_none=True):
    
    return apply_groupby(
        records,
        lambda obj: getattr(obj, field_name),
        skip_none=skip_none)
437849
def grouping_val(self):
        
        grouping = self.grouping
        if grouping is None:
            return ST_Grouping.STANDARD
        val = grouping.val
        if val is None:
            return ST_Grouping.STANDARD
        return val