/** * Returns an implementation of * {@link RelProtoDataType} * that copies a given type using the given type factory. */ public static RelProtoDataType proto(final RelDataType protoType) { assert protoType != null; return typeFactory -> typeFactory.copyType(protoType); }
/** * Returns an implementation of * {@link RelProtoDataType} * that copies a given type using the given type factory. */ public static RelProtoDataType proto(final RelDataType protoType) { assert protoType != null; return typeFactory -> typeFactory.copyType(protoType); }
public RelDataType copyOf(RelDataType type) { return cluster.getTypeFactory().copyType(type); }
private RelDataType copy(RelDataType type) { return builder.getTypeFactory().copyType(type); }
private RelDataType copy(RelDataType type) { return builder.getTypeFactory().copyType(type); }
@Override public T read(final Kryo kryo, final Input input, final Class<T> type) { // do not use delegate.read because we do not want it to cache the object. Rather, we will cache the normalized type. final T dataType = kryo.newInstance(type); final FieldSerializer.CachedField[] fields = delegate.getFields(); for (int i = 0, n = fields.length; i < n; i++) { fields[i].read(input, dataType); } // be gentle to calcite and normalize the returned data type. normalization here means to use same type instances. final T result = (T) typeFactory.copyType(dataType); kryo.reference(result); return result; }