for (SqlValidatorScope.Step p : Util.skip(resolve.path.steps())) { type = type.getFieldList().get(p.i).getType();
resolve(prefix.names, liberalMatcher, false, resolved); if (resolved.count() == 1) { final Step lastStep = Util.last(resolved.only().path.steps()); throw validator.newValidationError(prefix, RESOURCE.tableNameNotFoundDidYouMean(prefix.toString(), if (fromPath.stepCount() > 1) { assert fromRowType != null; for (Step p : fromPath.steps()) { fromRowType = fromRowType.getFieldList().get(p.i).getType(); final SqlIdentifier prefix = identifier.getComponent(0, i); final SqlIdentifier suffix3 = identifier.getComponent(i, k + 1); final Step step = Util.last(resolved.resolves.get(0).path.steps()); throw validator.newValidationError(suffix3, RESOURCE.columnNotFoundInTableDidYouMean(suffix3.toString(), for (Step step : path.steps()) { final String name = identifier.names.get(k); if (step.i < 0) {
resolve(prefix.names, liberalMatcher, false, resolved); if (resolved.count() == 1) { final Step lastStep = Util.last(resolved.only().path.steps()); throw validator.newValidationError(prefix, RESOURCE.tableNameNotFoundDidYouMean(prefix.toString(), if (fromPath.stepCount() > 1) { assert fromRowType != null; for (Step p : fromPath.steps()) { fromRowType = fromRowType.getFieldList().get(p.i).getType(); final SqlIdentifier prefix = identifier.getComponent(0, i); final SqlIdentifier suffix3 = identifier.getComponent(i, k + 1); final Step step = Util.last(resolved.resolves.get(0).path.steps()); throw validator.newValidationError(suffix3, RESOURCE.columnNotFoundInTableDidYouMean(suffix3.toString(), for (Step step : path.steps()) { final String name = identifier.names.get(k); if (step.i < 0) {
final SqlValidatorNamespace foundNs = resolve.namespace; final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i; final SqlValidatorScope ancestorScope = resolve.scope; boolean correlInCurrentScope = ancestorScope == bb.scope;
final SqlValidatorNamespace foundNs = resolve.namespace; final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i; final SqlValidatorScope ancestorScope = resolve.scope; boolean correlInCurrentScope = ancestorScope == bb.scope;
final LookupContext rels = new LookupContext(this, inputs, systemFieldList.size()); final RexNode node = lookup(resolve.path.steps().get(0).i, rels); if (node == null) { return null; final CorrelationId correlId = cluster.createCorrel(); mapCorrelToDeferred.put(correlId, lookup); if (resolve.path.steps().get(0).i < 0) { return Pair.of(rexBuilder.makeCorrel(rowType, correlId), null); } else { for (SqlValidatorNamespace c : ancestorScope1.getChildren()) { builder.addAll(c.getRowType().getFieldList()); if (i == resolve.path.steps().get(0).i) { for (RelDataTypeField field : c.getRowType().getFieldList()) { fields.put(field.getName(), field.getIndex() + offset);
for (SqlValidatorScope.Step p : Util.skip(resolve.path.steps())) { type = type.getFieldList().get(p.i).getType();
final SqlValidatorNamespace foundNs = resolve.namespace; final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i; final SqlValidatorScope ancestorScope = resolve.scope; boolean correlInCurrentScope = bb.scope.isWithin(ancestorScope);
final SqlValidatorNamespace foundNs = resolve.namespace; final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i; final SqlValidatorScope ancestorScope = resolve.scope; boolean correlInCurrentScope = bb.scope.isWithin(ancestorScope);
throw validator.newValidationError(id, RESOURCE.objectNotFoundWithin(resolve.remainingNames.get(0), SqlIdentifier.getString(resolve.path.stepNames()))); : previousResolve.path.stepCount(); final int offset = resolve.path.stepCount() + resolve.remainingNames.size() - names.size(); final List<String> prefix = resolve.path.stepNames().subList(0, offset + i); final String next = resolve.path.stepNames().get(i + offset); if (prefix.isEmpty()) { throw validator.newValidationError(id, throw validator.newValidationError(id, RESOURCE.objectNotFoundWithin(resolve.remainingNames.get(0), SqlIdentifier.getString(resolve.path.stepNames())));
final LookupContext rels = new LookupContext(this, inputs, systemFieldList.size()); final RexNode node = lookup(resolve.path.steps().get(0).i, rels); if (node == null) { return null; final CorrelationId correlId = cluster.createCorrel(); mapCorrelToDeferred.put(correlId, lookup); if (resolve.path.steps().get(0).i < 0) { return Pair.of(rexBuilder.makeCorrel(rowType, correlId), null); } else { for (SqlValidatorNamespace c : ancestorScope1.getChildren()) { builder.addAll(c.getRowType().getFieldList()); if (i == resolve.path.steps().get(0).i) { for (RelDataTypeField field : c.getRowType().getFieldList()) { fields.put(c.translate(field.getName()),
final LookupContext rels = new LookupContext(this, inputs, systemFieldList.size()); final RexNode node = lookup(resolve.path.steps().get(0).i, rels); if (node == null) { return null; final CorrelationId correlId = cluster.createCorrel(); mapCorrelToDeferred.put(correlId, lookup); if (resolve.path.steps().get(0).i < 0) { return Pair.of(rexBuilder.makeCorrel(rowType, correlId), null); } else { for (SqlValidatorNamespace c : ancestorScope1.getChildren()) { builder.addAll(c.getRowType().getFieldList()); if (i == resolve.path.steps().get(0).i) { for (RelDataTypeField field : c.getRowType().getFieldList()) { fields.put(field.getName(), field.getIndex() + offset);
for (SqlValidatorScope.Step p : Util.skip(resolve.path.steps())) { type = type.getFieldList().get(p.i).getType();
final LookupContext rels = new LookupContext(this, inputs, systemFieldList.size()); final RexNode node = lookup(resolve.path.steps().get(0).i, rels); if (node == null) { return null; final CorrelationId correlId = cluster.createCorrel(); mapCorrelToDeferred.put(correlId, lookup); if (resolve.path.steps().get(0).i < 0) { return Pair.of(rexBuilder.makeCorrel(rowType, correlId), null); } else { for (SqlValidatorNamespace c : ancestorScope1.getChildren()) { builder.addAll(c.getRowType().getFieldList()); if (i == resolve.path.steps().get(0).i) { for (RelDataTypeField field : c.getRowType().getFieldList()) { fields.put(c.translate(field.getName()),
throw validator.newValidationError(id, RESOURCE.objectNotFoundWithin(resolve.remainingNames.get(0), SqlIdentifier.getString(resolve.path.stepNames()))); : previousResolve.path.stepCount(); final int offset = resolve.path.stepCount() + resolve.remainingNames.size() - names.size(); final List<String> prefix = resolve.path.stepNames().subList(0, offset + i); final String next = resolve.path.stepNames().get(i + offset); if (prefix.isEmpty()) { throw validator.newValidationError(id, throw validator.newValidationError(id, RESOURCE.objectNotFoundWithin(resolve.remainingNames.get(0), SqlIdentifier.getString(resolve.path.stepNames())));
schema.getSubSchema(schemaName, nameMatcher.isCaseSensitive()); if (subSchema != null) { path = path.plus(null, -1, subSchema.name, StructKind.NONE); remainingNames = Util.skip(remainingNames); schema = subSchema; namespace = new SchemaNamespace(validator, ImmutableList.copyOf(path.stepNames())); continue; path = path.plus(null, -1, entry.name, StructKind.NONE); remainingNames = Util.skip(remainingNames); final Table table = entry.getTable();
} else { CalciteSchema matchedSchema = matchedSchemas.stream().findFirst().get().getValue(); path = path.plus(null, -1, matchedSchema.name, StructKind.NONE); schema = matchedSchema; namespace = new SchemaNamespace(validator, ImmutableList.copyOf(path.stepNames())); schemaName = tableName; path = path.plus(null, -1, subSchema.name, StructKind.NONE); remainingNames = Util.skip(remainingNames); schema = subSchema; namespace = new SchemaNamespace(validator, ImmutableList.copyOf(path.stepNames())); continue; path = path.plus(null, -1, entry.name, StructKind.NONE); remainingNames = Util.skip(remainingNames); final Table table = entry.getTable();
final SqlValidatorNamespace ns2 = new FieldNamespace(validator, field.getType()); final Step path2 = path.plus(rowType, field.getIndex(), field.getName(), StructKind.FULLY_QUALIFIED); resolveInNamespace(ns2, nullable, remainder, nameMatcher, path2, if (field0 != null) { final SqlValidatorNamespace ns2 = ns.lookupChild(field0.getName()); final Step path2 = path.plus(rowType, field0.getIndex(), field0.getName(), StructKind.FULLY_QUALIFIED); resolveInNamespace(ns2, nullable, names.subList(1, names.size()), case PEEK_FIELDS_DEFAULT: case PEEK_FIELDS_NO_EXPAND: final Step path2 = path.plus(rowType, field.getIndex(), field.getName(), field.getType().getStructKind()); final SqlValidatorNamespace ns2 = ns.lookupChild(field.getName());
final SqlValidatorScope.Resolve resolve = resolved.only(); final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i;
final SqlValidatorScope.Resolve resolve = resolved.only(); final RelDataType rowType = resolve.rowType(); final int childNamespaceIndex = resolve.path.steps().get(0).i;