Skip to content

Commit

Permalink
fix: correctly produce Kafka JSON nulls for int fields
Browse files Browse the repository at this point in the history
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
  • Loading branch information
devinrsmith committed Jul 1, 2024
1 parent 5a81698 commit b7bebb2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private JSONFieldProcessor makeIntFieldProcessor(final String fieldName, final C
@Override
void outputField(final int ii, final ObjectNode node, final IntChunk<Values> inputChunk) {
final int raw = inputChunk.get(ii);
if (raw == QueryConstants.NULL_SHORT) {
if (raw == QueryConstants.NULL_INT) {
if (outputNulls) {
node.putNull(childNodeFieldName);
}
Expand Down

0 comments on commit b7bebb2

Please sign in to comment.