final RelOptPlanner planner = root.rel.getCluster().getPlanner(); final DataContext dataContext = context.getDataContext(); planner.setExecutor(new RexExecutorImpl(dataContext));
final RelOptPlanner planner = root.rel.getCluster().getPlanner(); final DataContext dataContext = context.getDataContext(); planner.setExecutor(new RexExecutorImpl(dataContext));
/** * Creates a context for the purposes of preparing a statement. * * @param connection Connection * @param schema Schema * @param schemaPath Path wherein to look for functions * @param objectPath Path of the object being analyzed (usually a view), * or null * @param propValues Connection properties * @return Context */ private static CalcitePrepare.Context makeContext( CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, List<String> objectPath, final ImmutableMap<CalciteConnectionProperty, String> propValues) { if (connection == null) { final CalcitePrepare.Context context0 = CalcitePrepare.Dummy.peek(); final CalciteConnectionConfig config = mutate(context0.config(), propValues); return makeContext(config, context0.getTypeFactory(), context0.getDataContext(), schema, schemaPath, objectPath); } else { final CalciteConnectionConfig config = mutate(connection.config(), propValues); return makeContext(config, connection.getTypeFactory(), createDataContext(connection, schema.root().plus()), schema, schemaPath, objectPath); } }
/** * Creates a context for the purposes of preparing a statement. * * @param connection Connection * @param schema Schema * @param schemaPath Path wherein to look for functions * @param objectPath Path of the object being analyzed (usually a view), * or null * @param propValues Connection properties * @return Context */ private static CalcitePrepare.Context makeContext( CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, List<String> objectPath, final ImmutableMap<CalciteConnectionProperty, String> propValues) { if (connection == null) { final CalcitePrepare.Context context0 = CalcitePrepare.Dummy.peek(); final CalciteConnectionConfig config = mutate(context0.config(), propValues); return makeContext(config, context0.getTypeFactory(), context0.getDataContext(), schema, schemaPath, objectPath); } else { final CalciteConnectionConfig config = mutate(connection.config(), propValues); return makeContext(config, connection.getTypeFactory(), createDataContext(connection, schema.root().plus()), schema, schemaPath, objectPath); } }