public static TypeInfo convertListType(RelDataType rType) { return TypeInfoFactory.getListTypeInfo(convert(rType.getComponentType())); }
public static TypeInfo convertListType(RelDataType rType) { return TypeInfoFactory.getListTypeInfo(convert(rType.getComponentType())); }
public static TypeInfo convert(RelDataType rType) { if (rType.isStruct()) { return convertStructType(rType); } else if (rType.getComponentType() != null) { return convertListType(rType); } else if (rType.getKeyType() != null) { return convertMapType(rType); } else { return convertPrimitiveType(rType); } }
public static TypeInfo convert(RelDataType rType) { if (rType.isStruct()) { return convertStructType(rType); } else if (rType.getComponentType() != null) { return convertListType(rType); } else if (rType.getKeyType() != null) { return convertMapType(rType); } else { return convertPrimitiveType(rType); } }
Assert.assertTrue(relDataType instanceof ArraySqlType); Assert.assertEquals(SqlTypeName.ARRAY, relDataType.getSqlTypeName()); Assert.assertTrue(relDataType.getComponentType() instanceof BasicSqlType); Assert.assertEquals(SqlTypeName.VARCHAR, relDataType.getComponentType().getSqlTypeName()); Assert.assertTrue(relDataType.isNullable());
public RelDataType getComponentType() { return delegate.getComponentType(); }
public RelDataType getComponentType() { return delegate.getComponentType(); }
public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } if (!containsType(type2)) { throw new IllegalArgumentException("must contain type: " + type2); } return getComponentType().getPrecedenceList() .compareTypePrecedence(type1.getComponentType(), type2.getComponentType()); } };
public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } if (!containsType(type2)) { throw new IllegalArgumentException("must contain type: " + type2); } return getComponentType().getPrecedenceList() .compareTypePrecedence(type1.getComponentType(), type2.getComponentType()); } };
public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } if (!containsType(type2)) { throw new IllegalArgumentException("must contain type: " + type2); } return getComponentType().getPrecedenceList() .compareTypePrecedence(type1.getComponentType(), type2.getComponentType()); } };
public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } if (!containsType(type2)) { throw new IllegalArgumentException("must contain type: " + type2); } return getComponentType().getPrecedenceList() .compareTypePrecedence(type1.getComponentType(), type2.getComponentType()); } };
public static TypeInfo convertListType(RelDataType rType) { return TypeInfoFactory.getListTypeInfo(convert(rType.getComponentType())); }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
public PhysType component(int fieldOrdinal) { final RelDataTypeField field = rowType.getFieldList().get(fieldOrdinal); return PhysTypeImpl.of(typeFactory, toStruct(field.getType().getComponentType()), format, false); }
public PhysType component(int fieldOrdinal) { final RelDataTypeField field = rowType.getFieldList().get(fieldOrdinal); return PhysTypeImpl.of(typeFactory, toStruct(field.getType().getComponentType()), format, false); }
public static TypeInfo convert(RelDataType rType) { if (rType.isStruct()) { return convertStructType(rType); } else if (rType.getComponentType() != null) { return convertListType(rType); } else if (rType.getKeyType() != null) { return convertMapType(rType); } else { return convertPrimitiveType(rType); } }
@Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) { final RelDataTypeFactory typeFactory = opBinding.getTypeFactory(); final RelDataType operandType = opBinding.getOperandType(0); switch (operandType.getSqlTypeName()) { case ARRAY: return typeFactory.createTypeWithNullability( operandType.getComponentType(), true); case MAP: return typeFactory.createTypeWithNullability(operandType.getValueType(), true); case ANY: case DYNAMIC_STAR: return typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true); default: throw new AssertionError(); } } }