Return results of SHOW COLUMN STATS for indicated table. See also
        ImpalaTable.column_stats
166070
def column_stats(self, name, database=None):
        
        stmt = self._table_command(
            'SHOW COLUMN STATS', name, database=database
        )
        return self._exec_statement(stmt)
1302775
def output(data, **kwargs):
    '''
    
    '''

    rows = _find_durations(data)

    kwargs['opts'] = __opts__
    kwargs['rows_key'] = 'rows'
    kwargs['labels_key'] = 'labels'

    to_show = {'labels': ['name', 'mod.fun', 'duration (ms)'],
               'rows':   rows}

    return table_out.output(to_show, **kwargs)
1320416
def fetch_column_names(self, table: str) -> List[str]:
        """"""
        return self.flavour.fetch_column_names(self, table)
264539
def table_output(data):
    ''''''
    if type(data) == DictType:
        data = data.items()
    headings = [ item[0] for item in data ]
    rows = [ item[1] for item in data ]
    columns = zip(*rows)
    if len(columns):
        widths = [ max([ len(str(y)) for y in row ]) for row in rows ]
    else:
        widths = [ 0 for c in headings ]
    for c, heading in enumerate(headings):
        widths[c] = max(widths[c], len(heading))
    column_count = range(len(rows))
    table = [ ' '.join([ headings[c].ljust(widths[c]) for c in column_count ]) ]
    table.append(' '.join([ '=' * widths[c] for c in column_count ]))
    for column in columns:
        table.append(' '.join([ str(column[c]).ljust(widths[c]) for c in column_count ]))
    return '\n'.join(table)
1367911
def _table_info(self, buf=None):
    
    metrics = [self.count().name('nrows')]
    for col in self.columns:
        metrics.append(self[col].count().name(col))

    metrics = self.aggregate(metrics).execute().loc[0]

    names = ['Column', '------'] + self.columns
    types = ['Type', '----'] + [repr(x) for x in self.schema().types]
    counts = ['Non-null #', '----------'] + [str(x) for x in metrics[1:]]
    col_metrics = util.adjoin(2, names, types, counts)
    result = 'Table rows: {}\n\n{}'.format(metrics[0], col_metrics)

    print(result, file=buf)
248393
def get_column_listing(self, table):
        
        sql = self._grammar.compile_column_exists()
        database = self._connection.get_database_name()
        table = self._connection.get_table_prefix() + table

        results = self._connection.select(sql, [database, table])

        return self._connection.get_post_processor().process_column_listing(results)
942348
def tcounts(self):
        
        df = pd.DataFrame([[t.name(), t.size()] for t in self.tables()], columns=["name", "size"])
        df.index = df.name
        return df
114468
def column_count(self, ):
        
        if self.child_count():
            return self.childItems[0]._data.column_count()
        else:
            return self._data.column_count() if self._data else 0
555474
def get_column_listing(self, table):
        
        table = self._connection.get_table_prefix() + table

        results = self._connection.select(self._grammar.compile_column_exists(table))

        return self._connection.get_post_processor().process_column_listing(results)
210574
def get_stats_of_rows(rows):
    """"""
    count_true = count_false = max_score = 0
    for row in rows:
        if not row.properties:
            logging.info('Missing property for %s.', row.filename)
            continue
        if len(row.properties) > 1:
            # multiple properties not yet supported
            count_true = count_false = max_score = 0
            break
        expected_result = row.expected_results.get(row.properties[0].name)
        if not expected_result:
            continue
        if expected_result.result is True:
            count_true += 1
        elif expected_result.result is False:
            count_false += 1
        for prop in row.properties:
            max_score += prop.max_score(expected_result)

    return max_score, count_true, count_false
1227267
def get_user_columns_list(self):
        
        ret_lst = list()
        for col_name in self.get_columns_list():
            if (not self.is_pk(col_name)) and (not self.is_fk(col_name)):
                ret_lst.append(col_name)
        return ret_lst
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)
117419
def print_db_stats():
    
    dbroot = get_db_root()
    n_ids = len(list(dbroot.glob("[N,W]*")))
    print("Number of WACs and NACs in database: {}".format(n_ids))
    print("These kind of data are in the database: (returning pd.DataFrame)")
    d = {}
    for key, val in PathManager.extensions.items():
        d[key] = [len(list(dbroot.glob("**/*" + val)))]
    return pd.DataFrame(d)
468959
def add_stats_table(self):
        """"""

        totals = {sample: sum(counts.values())
                  for sample, counts in self.data.items()}

        percentages = {sample: {k: (v / totals[sample]) * 100
                                for k, v in counts.items()}
                       for sample, counts in self.data.items()}

        headers = {
            'species_a': {
                'title': '% Species a',
                'description': 'Percentage of reads mapping to species a',
                'max': 100,
                'min': 0,
                'suffix': '%',
                'scale': 'YlGn'
            }
        }

        self.general_stats_addcols(percentages, headers)
1000707
def columns(self):
        
        schema = self.schema()
        return [schema.column(col) for col in self.__columns]
960100
def table(self):
        
        if self._table is None:
            column_names = []
            for fileid in self.header.file_ids:
                for column_name in self.header.column_names:
                    column_names.append("{}_{}".format(column_name, fileid))
                column_names.append("ZP_{}".format(fileid))
            if len(column_names) > 0:
                self._table = Table(names=column_names)
            else:
                self._table = Table()
        return self._table
915730
@Deprecated
	public Optional<TableStats> getTableStats() {
		DescriptorProperties normalizedProps = new DescriptorProperties();
		normalizedProps.putProperties(normalizedProps);
		Optional<Long> rowCount = normalizedProps.getOptionalLong(STATISTICS_ROW_COUNT);
		if (rowCount.isPresent()) {
			Map<String, ColumnStats> columnStats = readColumnStats(normalizedProps, STATISTICS_COLUMNS);
			return Optional.of(new TableStats(rowCount.get(), columnStats));
		} else {
			return Optional.empty();
		}
	}