public Collection<Function> getFunctions(String name) { return CalciteSchema.this.getFunctions(name, true); }
public Collection<Function> getFunctions(String name) { return CalciteSchema.this.getFunctions(name, true); }
if (schema != null) { final String name = Util.last(names); functions2.addAll(schema.getFunctions(name, true));
if (schema != null) { final String name = Util.last(names); functions2.addAll(schema.getFunctions(name, true));
/** 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; }
calciteSchema.getTableBasedOnNullaryFunction("V1", false), nullValue()); assertThat(calciteSchema.getFunctions(viewName, true), hasItem(view)); assertThat(calciteSchema.getFunctions(viewName, false), hasItem(view)); assertThat(calciteSchema.getFunctions("V1", true), not(hasItem(view))); assertThat(calciteSchema.getFunctions("V1", false), not(hasItem(view)));
calciteSchema.getTableBasedOnNullaryFunction("V1", false), nullValue()); assertThat(calciteSchema.getFunctions(viewName, true), hasItem(view)); assertThat(calciteSchema.getFunctions(viewName, false), hasItem(view)); assertThat(calciteSchema.getFunctions("V1", true), not(hasItem(view))); assertThat(calciteSchema.getFunctions("V1", false), not(hasItem(view)));