fe/src/main/java/com/cloudera/impala/analysis/SelectListItem.java
/**
   * Returns a column label for this select list item.
   * If an alias was given, then the column label is the lower case alias.
   * If expr is a SlotRef then directly use its lower case column name.
   * Otherwise, the label is the lower case toSql() of expr or a Hive auto-generated
   * column name (depending on useHiveColLabels).
   * Hive's auto-generated column labels have a "_c" prefix and a select-list pos suffix,
   * e.g., "_c0", "_c1", "_c2", etc.
   *
   * Using auto-generated columns that are consistent with Hive is important
   * for view compatibility between Impala and Hive.
   */
Returns a column label for this select list item.
If an alias was given, then the column label is the lower case alias.
If expr is a SlotRef then directly use its lower case column name.
Otherwise, the label is the lower case toSql() of expr or a Hive auto-generated
column name (depending on useHiveColLabels).

Using auto-generated columns that are consistent with Hive is important
for view compatibility between Impala and Hive.
Returns a column label for this select list item . If an alias was given then the column label is the lower case alias . If expr is a SlotRef then directly use its lower case column name . Otherwise the label is the lower case toSql () of expr or a Hive auto - generated column name ( depending on useHiveColLabels ) . Using auto - generated columns that are consistent with Hive is important for view compatibility between Impala and Hive .
public String toColumnLabel(int selectListPos, boolean useHiveColLabels) {
    if (alias_ != null) return alias_.toLowerCase();
    if (expr_ instanceof SlotRef) {
      SlotRef slotRef = (SlotRef) expr_;
      return slotRef.getColumnName().toLowerCase();
    }
    if (useHiveColLabels) return "_c" + selectListPos;
    return expr_.toSql().toLowerCase();
  }
public String toColumnLabel ( int selectListPos , boolean useHiveColLabels ) { if ( alias_ != null ) return alias_ . toLowerCase ( ) ; if ( expr_ instanceof SlotRef ) { SlotRef slotRef = ( SlotRef ) expr_ ; return slotRef . getColumnName ( ) . toLowerCase ( ) ; } if ( useHiveColLabels ) return "_c" + selectListPos ; return expr_ . toSql ( ) . toLowerCase ( ) ; }
Returns a column label for this select list item.
Returns a column label for this select list item .
// Optionally return auto-generated column label.