public PhysType makeNullable(boolean nullable) { if (!nullable) { return this; } return new PhysTypeImpl(typeFactory, typeFactory.createTypeWithNullability(rowType, true), Primitive.box(javaRowClass), format); }
public PhysType makeNullable(boolean nullable) { if (!nullable) { return this; } return new PhysTypeImpl(typeFactory, typeFactory.createTypeWithNullability(rowType, true), Primitive.box(javaRowClass), format); }
public static PhysType of( JavaTypeFactory typeFactory, RelDataType rowType, JavaRowFormat format, boolean optimize) { if (optimize) { format = format.optimize(rowType); } final Type javaRowClass = format.javaRowClass(typeFactory, rowType); return new PhysTypeImpl(typeFactory, rowType, javaRowClass, format); }
public static PhysType of( JavaTypeFactory typeFactory, RelDataType rowType, JavaRowFormat format, boolean optimize) { if (optimize) { format = format.optimize(rowType); } final Type javaRowClass = format.javaRowClass(typeFactory, rowType); return new PhysTypeImpl(typeFactory, rowType, javaRowClass, format); }
static PhysType of( final JavaTypeFactory typeFactory, Type javaRowClass) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); if (javaRowClass instanceof Types.RecordType) { final Types.RecordType recordType = (Types.RecordType) javaRowClass; for (Types.RecordField field : recordType.getRecordFields()) { builder.add(field.getName(), typeFactory.createType(field.getType())); } } RelDataType rowType = builder.build(); // Do not optimize if there are 0 or 1 fields. return new PhysTypeImpl(typeFactory, rowType, javaRowClass, JavaRowFormat.CUSTOM); }
static PhysType of( final JavaTypeFactory typeFactory, Type javaRowClass) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); if (javaRowClass instanceof Types.RecordType) { final Types.RecordType recordType = (Types.RecordType) javaRowClass; for (Types.RecordField field : recordType.getRecordFields()) { builder.add(field.getName(), typeFactory.createType(field.getType())); } } RelDataType rowType = builder.build(); // Do not optimize if there are 0 or 1 fields. return new PhysTypeImpl(typeFactory, rowType, javaRowClass, JavaRowFormat.CUSTOM); }