public Block asBlock() { return Utils.nativeValueToBlock(type, value); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } NullableValue other = (NullableValue) obj; return Objects.equals(this.type, other.type) && (this.value == null) == (other.value == null) && (this.value == null || type.equalTo(Utils.nativeValueToBlock(type, value), 0, Utils.nativeValueToBlock(other.type, other.value), 0)); }
@JsonProperty public Serializable getSerializable() { return new Serializable(type, value == null ? null : Utils.nativeValueToBlock(type, value)); }
public static ValueEntry create(Type type, Object value) { return new ValueEntry(type, Utils.nativeValueToBlock(type, value)); }
private static Marker create(Type type, Optional<Object> value, Bound bound) { return new Marker(type, value.map(object -> Utils.nativeValueToBlock(type, object)), bound); }
@Override public int hashCode() { int hash = Objects.hash(type); if (value != null) { hash = hash * 31 + (int) type.hash(Utils.nativeValueToBlock(type, value), 0); } return hash; }
public static Block create(Type type, Object value, int positionCount) { Block block = Utils.nativeValueToBlock(type, value); if (block instanceof RunLengthEncodedBlock) { block = ((RunLengthEncodedBlock) block).getValue(); } return new RunLengthEncodedBlock(block, positionCount); }
private int compareOriginalValueToCoerced(Type originalValueType, Object originalValue, Type coercedValueType, Object coercedValue) { Signature castToOriginalTypeOperator = metadata.getFunctionRegistry().getCoercion(coercedValueType, originalValueType); Object coercedValueInOriginalType = functionInvoker.invoke(castToOriginalTypeOperator, session.toConnectorSession(), coercedValue); Block originalValueBlock = Utils.nativeValueToBlock(originalValueType, originalValue); Block coercedValueBlock = Utils.nativeValueToBlock(originalValueType, coercedValueInOriginalType); return originalValueType.compareTo(originalValueBlock, 0, coercedValueBlock, 0); }
public Block asBlock() { return Utils.nativeValueToBlock(type, value); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } NullableValue other = (NullableValue) obj; return Objects.equals(this.type, other.type) && (this.value == null) == (other.value == null) && (this.value == null || type.equalTo(Utils.nativeValueToBlock(type, value), 0, Utils.nativeValueToBlock(other.type, other.value), 0)); }
@JsonProperty public Serializable getSerializable() { return new Serializable(type, value == null ? null : Utils.nativeValueToBlock(type, value)); }
@Override public int hashCode() { int hash = Objects.hash(type); if (value != null) { hash = hash * 31 + (int) type.hash(Utils.nativeValueToBlock(type, value), 0); } return hash; }
private static Block buildSingleValueBlock(Type type, Object value) { Block block = nativeValueToBlock(type, value); return new RunLengthEncodedBlock(block, MAX_BATCH_SIZE); }
public static ValueEntry create(Type type, Object value) { return new ValueEntry(type, Utils.nativeValueToBlock(type, value)); }
private static Marker create(Type type, Optional<Object> value, Bound bound) { return new Marker(type, value.map(object -> Utils.nativeValueToBlock(type, object)), bound); }
public static Block create(Type type, Object value, int positionCount) { Block block = Utils.nativeValueToBlock(type, value); if (block instanceof RunLengthEncodedBlock) { block = ((RunLengthEncodedBlock) block).getValue(); } return new RunLengthEncodedBlock(block, positionCount); }