protected SqlValidatorNamespace getChild(String alias) { if (alias == null) { if (children.size() != 1) { throw Util.newInternal( "no alias specified, but more than one table in from list"); } return children.get(0).right; } else { final int i = validator.catalogReader.match(Pair.left(children), alias); if (i >= 0) { return children.get(i).right; } return null; } }
public SqlValidatorNamespace resolve( String name, SqlValidatorScope[] ancestorOut, int[] offsetOut) { // First resolve by looking through the child namespaces. final int i = validator.catalogReader.match(Pair.left(children), name); if (i >= 0) { if (ancestorOut != null) { ancestorOut[0] = this; } if (offsetOut != null) { offsetOut[0] = i; } return children.get(i).right; } // Then call the base class method, which will delegate to the // parent scope. return parent.resolve(name, ancestorOut, offsetOut); }