calciteOp = new SqlMonotonicBinaryOperator("-", SqlKind.MINUS, 40, true, uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.MINUS_OPERATOR); break; case "+": calciteOp = new SqlMonotonicBinaryOperator("+", SqlKind.PLUS, 40, true, uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.PLUS_OPERATOR); break;
public FrameworkConfig buildFrameWorkConfig() { if (hasUdf) { List<SqlOperatorTable> sqlOperatorTables = new ArrayList<>(); sqlOperatorTables.add(SqlStdOperatorTable.instance()); sqlOperatorTables.add(new CalciteCatalogReader(CalciteSchema.from(schema), Collections.emptyList(), typeFactory, new CalciteConnectionConfigImpl(new Properties()))); return Frameworks.newConfigBuilder().defaultSchema(schema) .operatorTable(new ChainedSqlOperatorTable(sqlOperatorTables)).build(); } else { return Frameworks.newConfigBuilder().defaultSchema(schema).build(); } }
/** Parses a PERIOD constructor */ final public SqlNode PeriodConstructor() throws ParseException { final SqlNode e0, e1; final Span s; jj_consume_token(PERIOD); s = span(); jj_consume_token(LPAREN); e0 = Expression(ExprContext.ACCEPT_SUB_QUERY); jj_consume_token(COMMA); e1 = Expression(ExprContext.ACCEPT_SUB_QUERY); jj_consume_token(RPAREN); {if (true) return SqlStdOperatorTable.ROW.createCall(s.end(this), e0, e1);} throw new Error("Missing return statement in function"); }
RESOURCE.illegalRowExpression());} {if (true) return SqlStdOperatorTable.ROW.createCall(list);} } else if (jj_2_282(2)) { if (jj_2_277(2)) { if (rowSpan != null) { {if (true) return SqlStdOperatorTable.ROW.createCall(rowSpan.end(list1), list1.toArray());} list3.add(call.operand(1)); list3.add(e); {if (true) return SqlStdOperatorTable.MINUS_DATE.createCall( Span.of(list1).end(this), list3);} } else { {if (true) return SqlStdOperatorTable.ROW.createCall(span().end(list1), list1.toArray());}
{if (true) return SqlStdOperatorTable.MAP_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.MAP_VALUE_CONSTRUCTOR.createCall( s.end(this), args.getList());} } else {
{if (true) return SqlStdOperatorTable.ARRAY_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.ARRAY_VALUE_CONSTRUCTOR.createCall( s.end(this), args.getList());} } else {
{if (true) return SqlStdOperatorTable.MULTISET_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.MULTISET_VALUE.createCall( s.end(this), args);} } else {
/** * Parses a CURSOR(query) expression. The parser allows these * anywhere, but the validator restricts them to appear only as * arguments to table functions. */ final public SqlNode CursorExpression(ExprContext exprContext) throws ParseException { final SqlNode e; final Span s; jj_consume_token(CURSOR); s = span(); if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR) { {if (true) throw SqlUtil.newContextException(s.end(this), RESOURCE.illegalCursorExpression());} } e = Expression(ExprContext.ACCEPT_QUERY); {if (true) return SqlStdOperatorTable.CURSOR.createCall(s.end(e), e);} throw new Error("Missing return statement in function"); }
{if (true) return SqlCase.createSwitched(s.end(this), caseIdentifier, new SqlNodeList(whenList, whenSpan.addAll(whenList).pos()), new SqlNodeList(thenList, thenSpan.addAll(thenList).pos()),
RESOURCE.illegalRowExpression());} {if (true) return SqlStdOperatorTable.ROW.createCall(list);} } else if (jj_2_282(2)) { if (jj_2_277(2)) { if (rowSpan != null) { {if (true) return SqlStdOperatorTable.ROW.createCall(rowSpan.end(list1), list1.toArray());} list3.add(call.operand(1)); list3.add(e); {if (true) return SqlStdOperatorTable.MINUS_DATE.createCall( Span.of(list1).end(this), list3);} } else { {if (true) return SqlStdOperatorTable.ROW.createCall(span().end(list1), list1.toArray());}
{if (true) return SqlStdOperatorTable.MAP_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.MAP_VALUE_CONSTRUCTOR.createCall( s.end(this), args.getList());} } else {
{if (true) return SqlStdOperatorTable.ARRAY_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.ARRAY_VALUE_CONSTRUCTOR.createCall( s.end(this), args.getList());} } else {
{if (true) return SqlStdOperatorTable.MULTISET_QUERY.createCall( s.end(this), e);} break; {if (true) return SqlStdOperatorTable.MULTISET_VALUE.createCall( s.end(this), args);} } else {
/** Parses a PERIOD constructor */ final public SqlNode PeriodConstructor() throws ParseException { final SqlNode e0, e1; final Span s; jj_consume_token(PERIOD); s = span(); jj_consume_token(LPAREN); e0 = Expression(ExprContext.ACCEPT_SUB_QUERY); jj_consume_token(COMMA); e1 = Expression(ExprContext.ACCEPT_SUB_QUERY); jj_consume_token(RPAREN); {if (true) return SqlStdOperatorTable.ROW.createCall(s.end(this), e0, e1);} throw new Error("Missing return statement in function"); }
public QueryPlanner(SchemaPlus schema) { final List<RelTraitDef> traitDefs = new ArrayList<RelTraitDef>(); traitDefs.add(ConventionTraitDef.INSTANCE); traitDefs.add(RelCollationTraitDef.INSTANCE); List<SqlOperatorTable> sqlOperatorTables = new ArrayList<>(); sqlOperatorTables.add(SqlStdOperatorTable.instance()); sqlOperatorTables.add(new CalciteCatalogReader(CalciteSchema.from(schema), Collections.emptyList(), typeFactory, new CalciteConnectionConfigImpl(new Properties()))); FrameworkConfig config = Frameworks.newConfigBuilder() .defaultSchema(schema) .operatorTable(new ChainedSqlOperatorTable(sqlOperatorTables)) .traitDefs(traitDefs) .context(Contexts.EMPTY_CONTEXT) .ruleSets(StreamsStormRuleSets.getRuleSets()) .costFactory(null) .typeSystem(StormRelDataTypeSystem.STORM_REL_DATATYPE_SYSTEM) .build(); this.planner = Frameworks.getPlanner(config); }
/** * Parses a CURSOR(query) expression. The parser allows these * anywhere, but the validator restricts them to appear only as * arguments to table functions. */ final public SqlNode CursorExpression(ExprContext exprContext) throws ParseException { final SqlNode e; final Span s; jj_consume_token(CURSOR); s = span(); if (exprContext != ExprContext.ACCEPT_ALL && exprContext != ExprContext.ACCEPT_CURSOR) { {if (true) throw SqlUtil.newContextException(s.end(this), RESOURCE.illegalCursorExpression());} } e = Expression(ExprContext.ACCEPT_QUERY); {if (true) return SqlStdOperatorTable.CURSOR.createCall(s.end(e), e);} throw new Error("Missing return statement in function"); }
{if (true) return SqlCase.createSwitched(s.end(this), caseIdentifier, new SqlNodeList(whenList, whenSpan.addAll(whenList).pos()), new SqlNodeList(thenList, thenSpan.addAll(thenList).pos()),
calciteOp = new SqlMonotonicBinaryOperator("-", SqlKind.MINUS, 40, true, uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.MINUS_OPERATOR); break; case "+": calciteOp = new SqlMonotonicBinaryOperator("+", SqlKind.PLUS, 40, true, uInf.returnTypeInference, uInf.operandTypeInference, OperandTypes.PLUS_OPERATOR); break;
{if (true) return SqlStdOperatorTable.ROW.createCall(s.end(valueList), valueList.toArray());} throw new Error("Missing return statement in function");
{if (true) return SqlStdOperatorTable.ROW.createCall(s.end(valueList), valueList.toArray());} throw new Error("Missing return statement in function");