15 package com.cloudera.impala.analysis;
17 import java.util.ArrayList;
18 import java.util.List;
20 import com.google.common.base.Preconditions;
21 import com.google.common.collect.Lists;
33 ArrayList<OrderByElement> orderByElements,
LimitElement limitElement) {
34 super(operands, orderByElements, limitElement);
39 StringBuilder strBuilder =
new StringBuilder();
40 strBuilder.append(
"(");
42 strBuilder.append(
")");
43 return strBuilder.toString();
48 StringBuilder strBuilder =
new StringBuilder();
51 strBuilder.append(withClause_.toSql());
52 strBuilder.append(
" ");
55 Preconditions.checkState(operands_.size() > 0);
56 strBuilder.append(
"VALUES(");
57 for (
int i = 0; i < operands_.size(); ++i) {
58 if (
operands_.size() != 1) strBuilder.append(
"(");
60 if (
operands_.size() != 1) strBuilder.append(
")");
61 strBuilder.append((i+1 != operands_.size()) ?
", " :
"");
63 strBuilder.append(
")");
64 return strBuilder.toString();
68 SelectList selectList = select.getSelectList();
69 for (
int j = 0; j < selectList.getItems().size(); ++j) {
70 strBuilder.append(selectList.getItems().
get(j).toSql());
71 strBuilder.append((j+1 != selectList.getItems().size()) ?
", " :
"");
77 List<UnionOperand> operandClones = Lists.newArrayList();
79 operandClones.add(operand.clone());
ValuesStmt(List< UnionOperand > operands, ArrayList< OrderByElement > orderByElements, LimitElement limitElement)
ArrayList< OrderByElement > cloneOrderByElements()
void appendSelectList(SelectStmt select, StringBuilder strBuilder)
LimitElement limitElement_
final List< UnionOperand > operands_
String queryStmtToSql(QueryStmt queryStmt)
WithClause cloneWithClause()