public Schema getSubSchema(String name) { return schema.getSubSchema(name); }
protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder<String, CalciteSchema> builder) { ImmutableSortedMap<String, CalciteSchema> explicitSubSchemas = builder.build(); for (String schemaName : schema.getSubSchemaNames()) { if (explicitSubSchemas.containsKey(schemaName)) { // explicit subschema wins. continue; } Schema s = schema.getSubSchema(schemaName); if (s != null) { CalciteSchema calciteSchema = new SimpleCalciteSchema(this, s, schemaName); builder.put(schemaName, calciteSchema); } } }
public Schema getSubSchema(String name) { return schema.getSubSchema(name); }
protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder<String, CalciteSchema> builder) { ImmutableSortedMap<String, CalciteSchema> explicitSubSchemas = builder.build(); for (String schemaName : schema.getSubSchemaNames()) { if (explicitSubSchemas.containsKey(schemaName)) { // explicit subschema wins. continue; } Schema s = schema.getSubSchema(schemaName); if (s != null) { CalciteSchema calciteSchema = new SimpleCalciteSchema(this, s, schemaName); builder.put(schemaName, calciteSchema); } } }
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { // Check implicit schemas. Schema s = schema.getSubSchema(schemaName); if (s != null) { return new SimpleCalciteSchema(this, s, schemaName); } return null; }
protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { // Check implicit schemas. Schema s = schema.getSubSchema(schemaName); if (s != null) { return new SimpleCalciteSchema(this, s, schemaName); } return null; }
@SuppressWarnings("NullableProblems") @Override public CalciteSchema load(String schemaName) { final Schema subSchema = calciteSchema.schema.getSubSchema(schemaName); if (subSchema == null) { throw new RuntimeException("sub-schema " + schemaName + " not found"); } return new CachingCalciteSchema(calciteSchema, subSchema, schemaName); } });
@SuppressWarnings("NullableProblems") @Override public CalciteSchema load(String schemaName) { final Schema subSchema = calciteSchema.schema.getSubSchema(schemaName); if (subSchema == null) { throw new RuntimeException("sub-schema " + schemaName + " not found"); } return new CachingCalciteSchema(calciteSchema, subSchema, schemaName); } });
@Override public SchemaPlus getSubSchema(String name) { final Schema subSchema = schema.getSubSchema(name); return subSchema == null ? null : new MySchemaPlus(this, name, subSchema); }
@Override public SchemaPlus getSubSchema(String name) { final Schema subSchema = schema.getSubSchema(name); return subSchema == null ? null : new MySchemaPlus(this, name, subSchema); }
@Override protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { Schema s = schema.getSubSchema(schemaName); if (s != null) { return new DynamicSchema(this, s, schemaName); } CalciteSchema ret = getSubSchemaMap().get(schemaName); return ret; }
/** Creates a path with a given list of names starting from a given root * schema. */ public static Path path(CalciteSchema rootSchema, Iterable<String> names) { final ImmutableList.Builder<Pair<String, Schema>> builder = ImmutableList.builder(); Schema schema = rootSchema.plus(); final Iterator<String> iterator = names.iterator(); if (!iterator.hasNext()) { return PathImpl.EMPTY; } if (!rootSchema.name.isEmpty()) { Preconditions.checkState(rootSchema.name.equals(iterator.next())); } for (;;) { final String name = iterator.next(); builder.add(Pair.of(name, schema)); if (!iterator.hasNext()) { return path(builder.build()); } schema = schema.getSubSchema(name); } }
/** Creates a path with a given list of names starting from a given root * schema. */ public static Path path(CalciteSchema rootSchema, Iterable<String> names) { final ImmutableList.Builder<Pair<String, Schema>> builder = ImmutableList.builder(); Schema schema = rootSchema.plus(); final Iterator<String> iterator = names.iterator(); if (!iterator.hasNext()) { return PathImpl.EMPTY; } if (!rootSchema.name.isEmpty()) { Preconditions.checkState(rootSchema.name.equals(iterator.next())); } for (;;) { final String name = iterator.next(); builder.add(Pair.of(name, schema)); if (!iterator.hasNext()) { return path(builder.build()); } schema = schema.getSubSchema(name); } }