public SamzaSqlUdfOperatorTable(List<SamzaSqlScalarFunctionImpl> scalarFunctions) { operatorTable = new ListSqlOperatorTable(getSqlOperators(scalarFunctions)); }
public SamzaSqlUdfOperatorTable(List<SamzaSqlScalarFunctionImpl> scalarFunctions) { operatorTable = new ListSqlOperatorTable(getSqlOperators(scalarFunctions)); }
public MockSqlOperatorTable(SqlOperatorTable parentTable) { super(ImmutableList.of(parentTable, new ListSqlOperatorTable())); listOpTab = (ListSqlOperatorTable) tableList.get(1); }
public MockSqlOperatorTable(SqlOperatorTable parentTable) { super(ImmutableList.of(parentTable, new ListSqlOperatorTable())); listOpTab = (ListSqlOperatorTable) tableList.get(1); }
public MockSqlOperatorTable(SqlOperatorTable parentTable) { super(ImmutableList.of(parentTable, new ListSqlOperatorTable())); listOpTab = (ListSqlOperatorTable) tableList.get(1); }
/** Creates an operator table that contains functions in the given class. * * @see ModelHandler#addFunctions */ public static SqlOperatorTable operatorTable(String className) { // Dummy schema to collect the functions final CalciteSchema schema = CalciteSchema.createRootSchema(false, false); ModelHandler.addFunctions(schema.plus(), null, ImmutableList.of(), className, "*", true); // The following is technical debt; see [CALCITE-2082] Remove // RelDataTypeFactory argument from SqlUserDefinedAggFunction constructor final SqlTypeFactoryImpl typeFactory = new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT); final ListSqlOperatorTable table = new ListSqlOperatorTable(); for (String name : schema.getFunctionNames()) { for (Function function : schema.getFunctions(name, true)) { final SqlIdentifier id = new SqlIdentifier(name, SqlParserPos.ZERO); table.add( toOp(typeFactory, id, function)); } } return table; }
/** Creates an operator table that contains functions in the given class. * * @see ModelHandler#addFunctions */ public static SqlOperatorTable operatorTable(String className) { // Dummy schema to collect the functions final CalciteSchema schema = CalciteSchema.createRootSchema(false, false); ModelHandler.addFunctions(schema.plus(), null, ImmutableList.of(), className, "*", true); // The following is technical debt; see [CALCITE-2082] Remove // RelDataTypeFactory argument from SqlUserDefinedAggFunction constructor final SqlTypeFactoryImpl typeFactory = new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT); final ListSqlOperatorTable table = new ListSqlOperatorTable(); for (String name : schema.getFunctionNames()) { for (Function function : schema.getFunctions(name, true)) { final SqlIdentifier id = new SqlIdentifier(name, SqlParserPos.ZERO); table.add( toOp(typeFactory, id, function)); } } return table; }
SqlOperatorTable opTab = ChainedSqlOperatorTable.of(stdOpTab, new ListSqlOperatorTable( ImmutableList.of(new MyCountAggFunction()))); final SchemaPlus rootSchema = Frameworks.createRootSchema(true);
SqlOperatorTable opTab = ChainedSqlOperatorTable.of(stdOpTab, new ListSqlOperatorTable( ImmutableList.of(new MyCountAggFunction()))); final SchemaPlus rootSchema = Frameworks.createRootSchema(true);