public JavaTypeFactory getTypeFactory() { return connection.getTypeFactory(); }
public JavaTypeFactory getTypeFactory() { return connection.getTypeFactory(); }
private Table createCloneTable(QueryProvider queryProvider, QueryableTable sourceTable, String name) { final Queryable<Object> queryable = sourceTable.asQueryable(queryProvider, sourceSchema, name); final JavaTypeFactory typeFactory = ((CalciteConnection) queryProvider).getTypeFactory(); return createCloneTable(typeFactory, Schemas.proto(sourceTable), ImmutableList.of(), null, queryable); }
private Table createCloneTable(QueryProvider queryProvider, QueryableTable sourceTable, String name) { final Queryable<Object> queryable = sourceTable.asQueryable(queryProvider, sourceSchema, name); final JavaTypeFactory typeFactory = ((CalciteConnection) queryProvider).getTypeFactory(); return createCloneTable(typeFactory, Schemas.proto(sourceTable), ImmutableList.of(), null, queryable); }
@Override public TranslatableTable apply(List<Object> arguments) { assert arguments.isEmpty(); CalcitePrepare.ParseResult parsed = Schemas.parse(MATERIALIZATION_CONNECTION, schema, schemaPath, viewSql); final List<String> schemaPath1 = schemaPath != null ? schemaPath : schema.path(null); final JavaTypeFactory typeFactory = MATERIALIZATION_CONNECTION.getTypeFactory(); return new MaterializedViewTable(typeFactory.getJavaClass(parsed.rowType), RelDataTypeImpl.proto(parsed.rowType), viewSql, schemaPath1, viewPath, key); } }
@Override public TranslatableTable apply(List<Object> arguments) { assert arguments.isEmpty(); CalcitePrepare.ParseResult parsed = Schemas.parse(MATERIALIZATION_CONNECTION, schema, schemaPath, viewSql); final List<String> schemaPath1 = schemaPath != null ? schemaPath : schema.path(null); final JavaTypeFactory typeFactory = MATERIALIZATION_CONNECTION.getTypeFactory(); return new MaterializedViewTable(typeFactory.getJavaClass(parsed.rowType), RelDataTypeImpl.proto(parsed.rowType), viewSql, schemaPath1, viewPath, key); } }
public Enumerator<T> enumerator() { final JavaTypeFactory typeFactory = ((CalciteConnection) queryProvider).getTypeFactory(); final SqlString sql = generateSql(); //noinspection unchecked final Enumerable<T> enumerable = (Enumerable<T>) ResultSetEnumerable.of( jdbcSchema.getDataSource(), sql.getSql(), JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory))); return enumerable.enumerator(); } }
final CalcitePrepare.CalciteSignature<Object> calciteSignature = Schemas.prepare(connection, schema, viewSchemaPath, viewSql, map); return CloneSchema.createCloneTable(connection.getTypeFactory(), RelDataTypeImpl.proto(calciteSignature.rowType), calciteSignature.getCollationList(),
public Enumerator<T> enumerator() { final JavaTypeFactory typeFactory = ((CalciteConnection) queryProvider).getTypeFactory(); final SqlString sql = generateSql(); //noinspection unchecked final Enumerable<T> enumerable = (Enumerable<T>) ResultSetEnumerable.of( jdbcSchema.getDataSource(), sql.getSql(), JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory))); return enumerable.enumerator(); } }
final CalcitePrepare.CalciteSignature<Object> calciteSignature = Schemas.prepare(connection, schema, viewSchemaPath, viewSql, map); return CloneSchema.createCloneTable(connection.getTypeFactory(), RelDataTypeImpl.proto(calciteSignature.rowType), calciteSignature.getCollationList(),
tableEntry = schema.add(tableName, table, ImmutableList.of(viewSql)); Hook.CREATE_MATERIALIZATION.run(tableName); rowType = table.getRowType(connection.getTypeFactory());
tableEntry = schema.add(tableName, table, ImmutableList.of(viewSql)); Hook.CREATE_MATERIALIZATION.run(tableName); rowType = table.getRowType(connection.getTypeFactory());
/** * 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); } }