Skip to content

Commit

Permalink
[OPTIQ-322] Add support for SqlExplain, SqlOrderBy and SqlWith to sup…
Browse files Browse the repository at this point in the history
…port SqlShuttle use.
  • Loading branch information
jacques-n committed Jul 3, 2014
1 parent f82c9f5 commit 1df2761
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
10 changes: 9 additions & 1 deletion core/src/main/java/org/eigenbase/sql/SqlExplain.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
*/
public class SqlExplain extends SqlCall {
public static final SqlSpecialOperator OPERATOR =
new SqlSpecialOperator("EXPLAIN", SqlKind.EXPLAIN);
new SqlSpecialOperator("EXPLAIN", SqlKind.EXPLAIN) {
@Override
public SqlCall createCall(SqlLiteral functionQualifier,
SqlParserPos pos, SqlNode... operands) {
//explicandum, detailLevel, depth, asXml
return new SqlExplain(pos, operands[0], (SqlLiteral) operands[1],
(SqlLiteral) operands[2], (SqlLiteral) operands[3], 0);
}
};
//~ Enums ------------------------------------------------------------------

/**
Expand Down
9 changes: 8 additions & 1 deletion core/src/main/java/org/eigenbase/sql/SqlOrderBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
* and replaced with the ORDER_OPERAND of SqlSelect.</p>
*/
public class SqlOrderBy extends SqlCall {
public static final SqlSpecialOperator OPERATOR = new Operator();
public static final SqlSpecialOperator OPERATOR = new Operator() {
@Override
public SqlCall createCall(SqlLiteral functionQualifier,
SqlParserPos pos, SqlNode... operands) {
return new SqlOrderBy(pos, operands[0], (SqlNodeList) operands[1],
operands[2], operands[3]);
}
};

public final SqlNode query;
public final SqlNodeList orderList;
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/org/eigenbase/sql/SqlWith.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ public void unparse(
writer.endList(frame);
}


@Override
public SqlCall createCall(SqlLiteral functionQualifier, SqlParserPos pos,
SqlNode... operands) {
return new SqlWith(pos, (SqlNodeList) operands[0], operands[1]);
}

@Override public void validateCall(SqlCall call,
SqlValidator validator,
SqlValidatorScope scope,
Expand Down

0 comments on commit 1df2761

Please sign in to comment.