MCPcopy Create free account
hub / github.com/apache/calcite / table

Method table

core/src/main/java/org/apache/calcite/schema/Schemas.java:295–311  ·  view source on GitHub ↗

Returns an org.apache.calcite.linq4j.Enumerable over object arrays, given a fully-qualified table name which leads to a ScannableTable.

(DataContext root, String... names)

Source from the content-addressed store, hash-verified

293 * arrays, given a fully-qualified table name which leads to a
294 * {@link ScannableTable}. */
295 public static @Nullable Table table(DataContext root, String... names) {
296 SchemaPlus schema = root.getRootSchema();
297 final List<String> nameList = Arrays.asList(names);
298 for (Iterator<? extends String> iterator = nameList.iterator();;) {
299 String name = iterator.next();
300 requireNonNull(schema, "schema");
301 if (iterator.hasNext()) {
302 SchemaPlus next = schema.subSchemas().get(name);
303 if (next == null) {
304 throw new IllegalArgumentException("schema " + name + " is not found in " + schema);
305 }
306 schema = next;
307 } else {
308 return schema.tables().get(name);
309 }
310 }
311 }
312
313 /** Parses and validates a SQL query. For use within Calcite only. */
314 public static CalcitePrepare.ParseResult parse(

Callers

nothing calls this directly

Calls 8

subSchemasMethod · 0.95
getRootSchemaMethod · 0.65
iteratorMethod · 0.65
getMethod · 0.65
tablesMethod · 0.65
asListMethod · 0.45
nextMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected