Skip to content

Commit

Permalink
fix: correctly produce Kafka JSON nulls for int fields (#5796)
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
Cherry-pick of #5702
  • Loading branch information
devinrsmith authored Jul 18, 2024
1 parent de54114 commit 81ea905
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 81ea905

Please sign in to comment.