From 81ea90529f5469f1d8a6c3e980b7b37232d7b571 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Thu, 18 Jul 2024 12:02:28 -0700 Subject: [PATCH] fix: correctly produce Kafka JSON nulls for int fields (#5796) This fixes what was likely a copy-paste error, where the Kafka JSON producing logic checked for `NULL_SHORT` for int fields. None of the other field types were mishandled. It's worth noting that the json producer will omit null fields by default, and to explicitly output a JSON null (`{..., "myIntField": null, ...}`), the `boolean outputNulls` must be set to `true` (exposed as `output_nulls` in python). Fixes #5701 Cherry-pick of #5702 --- .../io/deephaven/kafka/publish/JsonKeyOrValueSerializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/kafka/src/main/java/io/deephaven/kafka/publish/JsonKeyOrValueSerializer.java b/extensions/kafka/src/main/java/io/deephaven/kafka/publish/JsonKeyOrValueSerializer.java index d084747c564..faca56355cf 100644 --- a/extensions/kafka/src/main/java/io/deephaven/kafka/publish/JsonKeyOrValueSerializer.java +++ b/extensions/kafka/src/main/java/io/deephaven/kafka/publish/JsonKeyOrValueSerializer.java @@ -214,7 +214,7 @@ private JSONFieldProcessor makeIntFieldProcessor(final String fieldName, final C @Override void outputField(final int ii, final ObjectNode node, final IntChunk inputChunk) { final int raw = inputChunk.get(ii); - if (raw == QueryConstants.NULL_SHORT) { + if (raw == QueryConstants.NULL_INT) { if (outputNulls) { node.putNull(childNodeFieldName); }