public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { final CalciteSchema schema = SqlValidatorUtil.getSchema(rootSchema, names, nameMatcher); if (schema == null) { return ImmutableList.of(); } final List<SqlMoniker> result = new ArrayList<>(); // Add root schema if not anonymous if (!schema.name.equals("")) { result.add(moniker(schema, null, SqlMonikerType.SCHEMA)); } final Map<String, CalciteSchema> schemaMap = schema.getSubSchemaMap(); for (String subSchema : schemaMap.keySet()) { result.add(moniker(schema, subSchema, SqlMonikerType.SCHEMA)); } for (String table : schema.getTableNames()) { result.add(moniker(schema, table, SqlMonikerType.TABLE)); } final NavigableSet<String> functions = schema.getFunctionNames(); for (String function : functions) { // views are here as well result.add(moniker(schema, function, SqlMonikerType.FUNCTION)); } return result; }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { final CalciteSchema schema = SqlValidatorUtil.getSchema(rootSchema, names, nameMatcher); if (schema == null) { return ImmutableList.of(); } final List<SqlMoniker> result = new ArrayList<>(); // Add root schema if not anonymous if (!schema.name.equals("")) { result.add(moniker(schema, null, SqlMonikerType.SCHEMA)); } final Map<String, CalciteSchema> schemaMap = schema.getSubSchemaMap(); for (String subSchema : schemaMap.keySet()) { result.add(moniker(schema, subSchema, SqlMonikerType.SCHEMA)); } for (String table : schema.getTableNames()) { result.add(moniker(schema, table, SqlMonikerType.TABLE)); } final NavigableSet<String> functions = schema.getFunctionNames(); for (String function : functions) { // views are here as well result.add(moniker(schema, function, SqlMonikerType.FUNCTION)); } return result; }