String correlName = createCorrel(); mapCorrelToDeferred.put(correlName, lookup); final RelDataType rowType = foundNs.getRowType(); return rexBuilder.makeCorrel(rowType, correlName);
SqlValidatorNamespace child = children.get(i); namespaceOffset += child.getRowType().getFieldCount(); catalogReader.field(foundNs.getRowType(), originalFieldName); int pos = namespaceOffset + field.getIndex();
children.get(j).getRowType().getFieldCount(); catalogReader.field(foundNs.getRowType(), originalFieldName); int origPos = namespaceOffset + field.getIndex(); validator.getNamespace(selectScope.getNode()); final List<String> names = selectNamespace.getRowType().getFieldNames(); int sysFieldCount = selectList.size() - names.size(); for (SqlNode expr : selectList) {
public RelDataType getRowType() { return namespace.getRowType(); }
public RelDataType getRowType() { return namespace.getRowType(); }
public RelDataType getValidatedNodeTypeIfKnown(SqlNode node) { final RelDataType type = nodeToTypeMap.get(node); if (type != null) { return type; } final SqlValidatorNamespace ns = getNamespace(node); if (ns != null) { return ns.getRowType(); } final SqlNode original = originalExprs.get(node); if (original != null) { return getValidatedNodeType(original); } return null; }
final List<String> columnList = SqlValidatorUtil.deriveNaturalJoinColumnList( validator.getNamespace(left).getRowType(), validator.getNamespace(right).getRowType()); conditionExp = convertUsing(leftRel, rightRel, columnList); } else {
public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { SqlSelect subSelect = (SqlSelect) call.operands[0]; subSelect.validateExpr(validator, scope); SqlValidatorNamespace ns = validator.getNamespace(subSelect); assert null != ns.getRowType(); return SqlTypeUtil.createMultisetType( validator.getTypeFactory(), ns.getRowType(), false); }
public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { SqlSelect subSelect = call.operand(0); subSelect.validateExpr(validator, scope); SqlValidatorNamespace ns = validator.getNamespace(subSelect); assert null != ns.getRowType(); return SqlTypeUtil.createMultisetType( validator.getTypeFactory(), ns.getRowType(), false); }
protected void addColumnNames( SqlValidatorNamespace ns, List<SqlMoniker> colNames) { final RelDataType rowType; try { rowType = ns.getRowType(); } catch (Error e) { // namespace is not good - bail out. return; } for (RelDataTypeField field : rowType.getFieldList()) { colNames.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.COLUMN)); } }
OrderExpressionExpander(SqlSelect select, SqlNode root) { super(getOrderScope(select)); this.select = select; this.root = root; this.aliasList = getNamespace(select).getRowType().getFieldNames(); }
OrderExpressionExpander(SqlSelect select, SqlNode root) { super(getOrderScope(select)); this.select = select; this.root = root; this.aliasList = getNamespace(select).getRowType().getFieldNames(); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; return callBinding.getValidator().getNamespace( callBinding.getCall()).getRowType(); } };
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { SqlCallBinding callBinding = (SqlCallBinding) opBinding; return callBinding.getValidator().getNamespace( callBinding.getCall()).getRowType(); } };
/** * Validates a namespace. */ protected void validateNamespace(final SqlValidatorNamespace namespace) { namespace.validate(); setValidatedNodeType( namespace.getNode(), namespace.getRowType()); }
public RelDataType resolveColumn(String name, SqlNode ctx) { final SqlValidatorNamespace selectNs = validator.getNamespace(select); final RelDataType rowType = selectNs.getRowType(); final RelDataType dataType = SqlValidatorUtil.lookupFieldType(rowType, name); if (dataType != null) { return dataType; } final SqlValidatorScope selectScope = validator.getSelectScope(select); return selectScope.resolveColumn(name, ctx); }
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 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); }
private RelDataType validateUsingCol(SqlIdentifier id, SqlNode leftOrRight) { if (id.names.size() == 1) { String name = id.names.get(0); final SqlValidatorNamespace namespace = getNamespace(leftOrRight); final RelDataType rowType = namespace.getRowType(); final RelDataTypeField field = catalogReader.field(rowType, name); if (field != null) { if (Collections.frequency(rowType.getFieldNames(), name) > 1) { throw newValidationError(id, RESOURCE.columnInUsingNotUnique(id.toString())); } return field.getType(); } } throw newValidationError(id, RESOURCE.columnNotFound(id.toString())); }
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[0]; final SqlValidatorNamespace selectNs = validator.getNamespace(select); final RelDataType rowType = selectNs.getRowType(); if (SqlValidatorUtil.lookupField(rowType, name) != null) { return identifier; } } return super.fullyQualify(identifier); }