def get_histogram(self, database, table, column, nested=None):
    results = []

    hql = self.get_histogram_query(database, table, column, nested)
    query = hql_query(hql)
    handle = self.execute_and_wait(query, timeout_sec=5.0)

    if handle:
      result = self.fetch(handle)
      try:
        histogram = list(result.rows())[0][0]  # actual histogram results is in first-and-only result row
        unique_values = set(histogram.split(', '))
        results = list(unique_values)
      except IndexError, e:
        LOG.warn('Failed to get histogram results, result set has unexpected format: %s' % smart_str(e))
      finally:
        self.close(handle)

    return results
Returns the results of an Impala SELECT histogram() FROM query for a given column or nested type.
dataset/ETHPy150Open cloudera/hue/apps/impala/src/impala/dbms.py/ImpalaDbms.get_histogram