return getTableFrom(names, ImmutableList.<String>of());
}
private RelOptTableImpl getTableFrom(List<String> names,
List<String> schemaNames) {
OptiqSchema schema =
getSchema(Iterables.concat(schemaNames, Util.skipLast(names)));
if (schema == null) {
return null;
}
final String name = Util.last(names);
Pair<String, Table> pair = schema.getTable(name, caseSensitive);
if (pair == null) {
pair = schema.getTableBasedOnNullaryFunction(name, caseSensitive);
}
if (pair != null) {
final Table table = pair.getValue();
final String name2 = pair.getKey();
return RelOptTableImpl.create(this, table.getRowType(typeFactory),
schema.add(name2, table), null);
}
return null;
}