@Override public boolean isNull(int field) { checkArgument(field < columnHandles.size(), "Invalid field index"); return currentRowValues[field] == null || currentRowValues[field].isNull(); }
@Override public boolean isNull(int field) { checkArgument(field < columnHandles.size(), "Invalid field index"); return currentRowValues == null || currentRowValues[field].isNull(); }
public static void checkIsNull(Map<DecoderColumnHandle, FieldValueProvider> decodedRow, DecoderColumnHandle handle) { FieldValueProvider provider = decodedRow.get(handle); assertNotNull(provider); assertTrue(provider.isNull()); } }
public void assertMissingDecodedAsNull(Type type) { FieldValueProvider decodedValue = decode(Optional.empty(), type); assertTrue(decodedValue.isNull(), format("expected null when decoding missing field as %s", type)); }
public void assertDecodedAsNull(String jsonValue, Type type) { FieldValueProvider decodedValue = decode(Optional.of(jsonValue), type); assertTrue(decodedValue.isNull(), format("expected null when decoding %s as %s", jsonValue, type)); }
public void assertDecodedAs(String jsonValue, Type type, long expectedValue) { checkArgument(type.getJavaType() == long.class, "Wrong (not long based) presto type '%s'", type); FieldValueProvider decodedValue = decode(Optional.of(jsonValue), type); assertFalse(decodedValue.isNull(), format("expected non null when decoding %s as %s", jsonValue, type)); assertEquals(decodedValue.getLong(), expectedValue); }
public void assertDecodedAs(String jsonValue, Type type, Slice expectedValue) { checkArgument(type.getJavaType() == Slice.class, "Wrong (not Slice based) presto type '%s'", type); FieldValueProvider decodedValue = decode(Optional.of(jsonValue), type); assertFalse(decodedValue.isNull(), format("expected non null when decoding %s as %s", jsonValue, type)); assertEquals(decodedValue.getSlice(), expectedValue); }
public void assertDecodedAs(String jsonValue, Type type, double expectedValue) { checkArgument(type.getJavaType() == double.class, "Wrong (not double based) presto type '%s'", type); FieldValueProvider decodedValue = decode(Optional.of(jsonValue), type); assertFalse(decodedValue.isNull(), format("expected non null when decoding %s as %s", jsonValue, type)); assertEquals(decodedValue.getDouble(), expectedValue); }
public void assertDecodedAs(String jsonValue, Type type, boolean expectedValue) { checkArgument(type.getJavaType() == boolean.class, "Wrong (not boolean based) presto type '%s'", type); FieldValueProvider decodedValue = decode(Optional.of(jsonValue), type); assertFalse(decodedValue.isNull(), format("expected non null when decoding %s as %s", jsonValue, type)); assertEquals(decodedValue.getBoolean(), expectedValue); }
public static void checkIsNull(Set<FieldValueProvider> providers, DecoderColumnHandle handle) { FieldValueProvider provider = findValueProvider(providers, handle); assertNotNull(provider); assertTrue(provider.isNull()); } }