public void resolveTable(List<String> names, SqlNameMatcher nameMatcher, Path path, Resolved resolved) { final List<Resolve> imperfectResolves = new ArrayList<>(); final List<Resolve> resolves = ((ResolvedImpl) resolved).resolves; // Look in the default schema, then default catalog, then root schema. for (List<String> schemaPath : validator.catalogReader.getSchemaPaths()) { resolve_(validator.catalogReader.getRootSchema(), names, schemaPath, nameMatcher, path, resolved); for (Resolve resolve : resolves) { if (resolve.remainingNames.isEmpty()) { // There is a full match. Return it as the only match. ((ResolvedImpl) resolved).clear(); resolves.add(resolve); return; } } imperfectResolves.addAll(resolves); } // If there were no matches in the last round, restore those found in // previous rounds if (resolves.isEmpty()) { resolves.addAll(imperfectResolves); } }
public void resolveTable(List<String> names, SqlNameMatcher nameMatcher, Path path, Resolved resolved) { final List<Resolve> imperfectResolves = new ArrayList<>(); final List<Resolve> resolves = ((ResolvedImpl) resolved).resolves; // Look in the default schema, then default catalog, then root schema. for (List<String> schemaPath : validator.catalogReader.getSchemaPaths()) { resolve_(validator.catalogReader.getRootSchema(), names, schemaPath, nameMatcher, path, resolved); for (Resolve resolve : resolves) { if (resolve.remainingNames.isEmpty()) { // There is a full match. Return it as the only match. ((ResolvedImpl) resolved).clear(); resolves.add(resolve); return; } } imperfectResolves.addAll(resolves); } // If there were no matches in the last round, restore those found in // previous rounds if (resolves.isEmpty()) { resolves.addAll(imperfectResolves); } }
resolved.clear(); parentScope.resolveTable(names, liberalMatcher, SqlValidatorScope.Path.EMPTY, resolved);
for (; i > 0; i--) { final SqlIdentifier prefix = identifier.getComponent(0, i); resolved.clear(); resolve(prefix.names, nameMatcher, false, resolved); if (resolved.count() == 1) { resolved.clear(); resolve(prefix.names, liberalMatcher, false, resolved); if (resolved.count() == 1) { resolved.clear(); resolveInNamespace(fromNs, false, suffix.names, nameMatcher, Path.EMPTY, resolved); resolved.clear(); resolveInNamespace(fromNs, false, suffix.names, liberalMatcher, Path.EMPTY, resolved); for (; k > i; --k) { SqlIdentifier suffix2 = identifier.getComponent(i, k); resolved.clear(); resolveInNamespace(fromNs, false, suffix2.names, nameMatcher, Path.EMPTY, resolved);
for (; i > 0; i--) { final SqlIdentifier prefix = identifier.getComponent(0, i); resolved.clear(); resolve(prefix.names, nameMatcher, false, resolved); if (resolved.count() == 1) { resolved.clear(); resolve(prefix.names, liberalMatcher, false, resolved); if (resolved.count() == 1) { resolved.clear(); resolveInNamespace(fromNs, false, suffix.names, nameMatcher, Path.EMPTY, resolved); resolved.clear(); resolveInNamespace(fromNs, false, suffix.names, liberalMatcher, Path.EMPTY, resolved); for (; k > i; --k) { SqlIdentifier suffix2 = identifier.getComponent(i, k); resolved.clear(); resolveInNamespace(fromNs, false, suffix2.names, nameMatcher, Path.EMPTY, resolved);
resolved.clear(); parentScope.resolveTable(names, liberalMatcher, SqlValidatorScope.Path.EMPTY, resolved);