15 package com.cloudera.impala.analysis;
17 import java.util.List;
19 import com.google.common.base.Joiner;
20 import com.google.common.base.Preconditions;
32 Preconditions.checkNotNull(expr);
60 Preconditions.checkNotNull(
expr_);
61 return expr_.toSql() + ((
alias_ != null) ?
" " +
alias_ :
"");
63 Preconditions.checkState(
isStar_);
64 return Joiner.on(
".").join(
rawPath_) +
".*";
72 Preconditions.checkNotNull(
expr_);
75 String aliasSql = null;
76 if (
alias_ != null) aliasSql = ToSqlUtils.getIdentSql(
alias_);
77 return expr_.toSql() + ((aliasSql != null) ?
" " + aliasSql :
"");
79 Preconditions.checkState(
isStar_);
80 StringBuilder result =
new StringBuilder();
82 if (result.length() > 0) result.append(
".");
83 result.append(ToSqlUtils.getIdentSql(p.toLowerCase()));
86 return result.toString();
105 if (
alias_ != null)
return alias_.toLowerCase();
107 SlotRef slotRef = (SlotRef)
expr_;
111 if (useHiveColLabels)
return "_c" + selectListPos;
114 AnalyticExpr expr = (AnalyticExpr)
expr_;
115 return expr.getFnCall().
toSql() +
" OVER(...)";
117 return expr_.toSql().toLowerCase();
string path("/usr/lib/sasl2:/usr/lib64/sasl2:/usr/local/lib/sasl2:/usr/lib/x86_64-linux-gnu/sasl2")
final List< String > rawPath_
SelectListItem(List< String > path)
static SelectListItem createStarItem(List< String > rawPath)
List< String > getRawPath()
String toColumnLabel(int selectListPos, boolean useHiveColLabels)
void setAlias(String alias)
SelectListItem(Expr expr, String alias)