if (type.isStruct()) {
public SqlValidatorNamespace lookupChild(String name) { if (rowType.isStruct()) { return validator.lookupFieldNamespace( rowType, name); } return null; }
public RelDataType leastRestrictive(List<RelDataType> types) { assert (types != null); assert (types.size() >= 1); RelDataType type0 = types.get(0); if (type0.isStruct()) { return leastRestrictiveStructuredType(types); } return null; }
public RelDataType leastRestrictive(List<RelDataType> types) { assert types != null; assert types.size() >= 1; RelDataType type0 = types.get(0); if (type0.isStruct()) { return leastRestrictiveStructuredType(types); } return null; }
public SqlValidatorNamespace lookupChild(String name) { if (rowType.isStruct()) { return validator.lookupFieldNamespace( rowType, name); } return null; }
public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType[] operandTypes) { for (int i = 0; i < operandTypes.length; ++i) { operandTypes[i] = returnType.isStruct() ? returnType.getFieldList().get(i).getType() : returnType; } } };
public static String dumpType(RelDataType type) { final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); final TypeDumper typeDumper = new TypeDumper(pw); if (type.isStruct()) { typeDumper.acceptFields(type.getFieldList()); } else { typeDumper.accept(type); } pw.flush(); return sw.toString(); }
public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType [] operandTypes) { for (int i = 0; i < operandTypes.length; ++i) { operandTypes[i] = returnType.isStruct() ? returnType.getFieldList().get(i).getType() : returnType; } } };
public static String dumpType(RelDataType type) { final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); final TypeDumper typeDumper = new TypeDumper(pw); if (type.isStruct()) { typeDumper.acceptFields(type.getFieldList()); } else { typeDumper.accept(type); } pw.flush(); return sw.toString(); }
private static RelDataType makeStruct( RelDataTypeFactory typeFactory, RelDataType type) { if (type.isStruct()) { return type; } return typeFactory.createStructType( RelDataTypeFactory.FieldInfoBuilder.of("$0", type)); }
static Class javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { if (type.isStruct() && type.getFieldCount() == 1) { type = type.getFieldList().get(0).getType(); } final Type clazz = typeFactory.getJavaClass(type); return clazz instanceof Class ? (Class) clazz : Object[].class; }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType type = opBinding.getOperandType(0); if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } assert type instanceof ArraySqlType || type instanceof MultisetSqlType; return type.getComponentType(); }
static Class javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { if (type.isStruct() && type.getFieldCount() == 1) { type = type.getFieldList().get(0).getType(); } final Type clazz = typeFactory.getJavaClass(type); return clazz instanceof Class ? (Class) clazz : Object[].class; }
private static RelDataType makeStruct( RelDataTypeFactory typeFactory, RelDataType type) { if (type.isStruct()) { return type; } return typeFactory.builder().add("$0", type).build(); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType type = opBinding.getOperandType(0); if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } MultisetSqlType t = (MultisetSqlType) type; return t.getComponentType(); }
/** * Returns the type of the argument to UNNEST. */ private RelDataType inferReturnType() { final SqlNode operand = unnest.operand(0); RelDataType type = validator.getValidatedNodeType(operand); // If sub-query, pick out first column. // TODO: Handle this using usual sub-select validation. if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } MultisetSqlType t = (MultisetSqlType) type; return t.getComponentType(); }
public void rewriteRel(AggregateRel rel) { RelDataType inputType = rel.getChild().getRowType(); for (RelDataTypeField field : inputType.getFieldList()) { if (field.getType().isStruct()) { // TODO jvs 10-Feb-2005 throw Util.needToImplement("aggregation on structured types"); } } rewriteGeneric(rel); }
public void rewriteRel(AggregateRel rel) { RelDataType inputType = rel.getChild().getRowType(); for (RelDataTypeField field : inputType.getFieldList()) { if (field.getType().isStruct()) { // TODO jvs 10-Feb-2005 throw Util.needToImplement("aggregation on structured types"); } } rewriteGeneric(rel); }
protected RelDataType validateImpl() { // Validate the call and its arguments, and infer the return type. validator.validateCall(unnest, scope); RelDataType type = unnest.getOperator().validateOperands(validator, scope, unnest); if (type.isStruct()) { return type; } return validator.getTypeFactory().createStructType( new RelDataType[] { type }, new String[] { validator.deriveAlias(unnest, 0) }); }
protected RelDataType validateImpl() { // Validate the call and its arguments, and infer the return type. validator.validateCall(unnest, scope); RelDataType type = unnest.getOperator().validateOperands(validator, scope, unnest); if (type.isStruct()) { return type; } return validator.getTypeFactory().builder() .add(validator.deriveAlias(unnest, 0), type) .build(); }