@Override public long getLong(int field) { return getFieldValueProvider(field, long.class).getLong(); }
@Override public long getLong(int field) { return getFieldValueProvider(field, long.class).getLong(); }
public static void checkValue(Map<DecoderColumnHandle, FieldValueProvider> decodedRow, DecoderColumnHandle handle, long value) { FieldValueProvider provider = decodedRow.get(handle); assertNotNull(provider); assertEquals(provider.getLong(), value); }
public void assertInvalidInput(String jsonValue, Type type, String exceptionRegex) { assertThatThrownBy(() -> decode(Optional.of(jsonValue), type).getLong()) .isInstanceOf(PrestoException.class) .hasMessageMatching(exceptionRegex); }
@Test public void testRuntimeDecodingFailure() { assertRuntimeDecodingFailure(() -> fieldValueDecoderFor(BigintType.BIGINT, "blah").getLong()); }
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 static void checkValue(Set<FieldValueProvider> providers, DecoderColumnHandle handle, long value) { FieldValueProvider provider = findValueProvider(providers, handle); assertNotNull(provider); assertEquals(provider.getLong(), value); }