public boolean fieldExists(String name) { final RelDataType rowType = getRowType(); final RelDataType dataType = SqlValidatorUtil.lookupFieldType(rowType, name); return dataType != null; }
SqlValidatorNamespace lookupFieldNamespace( RelDataType rowType, String name) { final RelDataType dataType = SqlValidatorUtil.lookupFieldType(rowType, name); return new FieldNamespace(this, dataType); }
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 RelDataType resolveColumn(String columnName, SqlNode ctx) { int found = 0; RelDataType theType = null; for (Pair<String, SqlValidatorNamespace> pair : children) { SqlValidatorNamespace childNs = pair.right; final RelDataType childRowType = childNs.getRowType(); final RelDataType type = SqlValidatorUtil.lookupFieldType(childRowType, columnName); if (type != null) { found++; theType = type; } } if (found == 0) { return null; } else if (found > 1) { throw validator.newValidationError( ctx, EigenbaseResource.instance().ColumnAmbiguous.ex(columnName)); } else { return theType; } } }
final RelDataType fromRowType = fromNs.getRowType(); final RelDataType type = SqlValidatorUtil.lookupFieldType(fromRowType, columnName); if (type != null) { return identifier; // it was fine already
SqlValidatorUtil.lookupFieldType(type, name); if (fieldType == null) { throw newValidationError(