public RelOptTableImpl getTable(final String[] names) { List<Pair<String, Object>> pairs = new ArrayList<Pair<String, Object>>(); Schema schema2 = schema; for (int i = 0; i < names.length; i++) { final String name = names[i]; Schema subSchema = schema2.getSubSchema(name); if (subSchema != null) { pairs.add(Pair.<String, Object>of(name, subSchema)); schema2 = subSchema; continue; } final Table table = schema2.getTable(name); if (table != null) { pairs.add(Pair.<String, Object>of(name, table)); if (i != names.length - 1) { // not enough objects to match all names return null; } return new RelOptTableImpl( this, typeFactory.createType(table.getElementType()), names, table); } return null; } return null; }
public Schema getSubSchema(String name) { return schema.getSubSchema(name); }