public SqlValidatorTable getTable(List<String> names) { return catalogReader.getTable(names); }
public static void getSchemaObjectMonikers( SqlValidatorCatalogReader catalogReader, List<String> names, List<SqlMoniker> hints) { // Assume that the last name is 'dummy' or similar. List<String> subNames = Util.skipLast(names); hints.addAll(catalogReader.getAllSchemaObjectNames(subNames)); // If the name has length 0, try prepending the name of the default // schema. So, the empty name would yield a list of tables in the // default schema, as well as a list of schemas from the above code. if (subNames.size() == 0) { hints.addAll( catalogReader.getAllSchemaObjectNames( catalogReader.getSchemaName())); } }
public RelDataType getNamedType(SqlIdentifier typeName) { return catalogReader.getNamedType(typeName); }
public boolean fieldExists(String name) { final RelDataType rowType = getRowType(); return validator.catalogReader.field(rowType, name) != null; }
public String getSchemaName() { return catalogReader.getSchemaName(); } }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { return catalogReader.getAllSchemaObjectNames(names); }
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; } }
SqlValidatorNamespace lookupFieldNamespace(RelDataType rowType, String name) { final RelDataTypeField field = catalogReader.field(rowType, name); return new FieldNamespace(this, field.getType()); }
public List<String> getSchemaName() { return catalogReader.getSchemaName(); } }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { return catalogReader.getAllSchemaObjectNames(names); }
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); }
public SqlValidatorTable getTable(List<String> names) { return catalogReader.getTable(names); }
public static void getSchemaObjectMonikers( SqlValidatorCatalogReader catalogReader, List<String> names, List<SqlMoniker> hints) { // Assume that the last name is 'dummy' or similar. List<String> subNames = names.subList(0, names.size() - 1); hints.addAll(catalogReader.getAllSchemaObjectNames(subNames)); // If the name has length 0, try prepending the name of the default // schema. So, the empty name would yield a list of tables in the // default schema, as well as a list of schemas from the above code. if (subNames.size() == 0) { hints.addAll( catalogReader.getAllSchemaObjectNames( Collections.singletonList( catalogReader.getSchemaName()))); } }
public RelDataType getNamedType(SqlIdentifier typeName) { return catalogReader.getNamedType(typeName); }
public SqlIdentifier fullyQualify(SqlIdentifier identifier) { // If it's a simple identifier, look for an alias. if (identifier.isSimple() && validator.getConformance().isSortByAlias()) { String name = identifier.names.get(0); final SqlValidatorNamespace selectNs = validator.getNamespace(select); final RelDataType rowType = selectNs.getRowType(); if (validator.catalogReader.field(rowType, name) != null) { return identifier; } } return super.fullyQualify(identifier); }
public SqlValidatorNamespace getTableNamespace(List<String> names) { SqlValidatorTable table = validator.catalogReader.getTable(names); return table != null ? new TableNamespace(validator, table) : null; }
SqlIdentifier sqlIdentifier = unresolvedConstructor.getSqlIdentifier(); assert sqlIdentifier != null; RelDataType type = catalogReader.getNamedType(sqlIdentifier); if (type == null) {
public RelDataType resolveColumn(String name, SqlNode ctx) { final SqlValidatorNamespace selectNs = validator.getNamespace(select); final RelDataType rowType = selectNs.getRowType(); final RelDataTypeField field = validator.catalogReader.field(rowType, name); if (field != null) { return field.getType(); } final SqlValidatorScope selectScope = validator.getSelectScope(select); return selectScope.resolveColumn(name, ctx); }
public RelOptTable getTableForMember(List<String> names) { final SqlValidatorTable table = catalogReader.getTable(names); final RelDataType rowType = table.getRowType(); final List<RelCollation> collationList = deduceMonotonicity(table); if (names.size() < 3) { String[] newNames2 = {"CATALOG", "SALES", ""}; List<String> newNames = new ArrayList<String>(); int i = 0; while (newNames.size() < newNames2.length) { newNames.add(i, newNames2[i]); ++i; } names = newNames; } return createColumnSet(table, names, rowType, collationList); }
RelDataType type = catalogReader.getNamedType(sqlIdentifier); if (type == null) {