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); } }