Fails on writing nulls to Binary fields in User Defined Parser

tvictortvictor Registered User

We have a Vertica UDP class which parses input from Kafka and writes the output to a Vertica table. One of the columns in this table is a BINARY type that allows NULLS (see [1] below). Inserting nulls into this table via SQL works just fine [2]. However, when trying to insert nulls via the UDP, it fails with the below exception.

, exception: com.vertica.sdk.TypeCoercionException: Object of type <null> cannot be coerced to Binary(4) (Unsupported target type), exception stack:[com.vertica.sdk.NullTypeCoercion.unsupportedType(NullTypeCoercion.java:88), com.vertica.sdk.NullTypeCoercion.asBinaryBytes(NullTypeCoercion.java:115), com.vertica.sdk.PartitionWriter.setValue(PartitionWriter.java:483), com.vertica.sdk.PartitionWriter.setRowFromMap(PartitionWriter.java:622), com.vertica.sdk.PartitionWriter.setRowFromMap(PartitionWriter.java:544),

Does Vertica Java API support Null type coercion for Binary types? I could not glean any information from your docs on this.

Thanks in advance

Tim

[1] create table test_binary( bin_field BINARY(4));
[2] insert into test_binary (bin_field) VALUES(NULL);

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file