forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-26092][table-runtime] Fix
JSON_OBJECTAGG
when emitting NULL
Previously, when the Json aggregation is taking place, and id JsonOnNull.NULL is selected, which means that we still want to emit a `null` JSON node, .i.e `{.... "myField" : null ... }` when no values get accumulated, we used a null `StringData` object. When `state.backend.changelog.enabled` is enabled, the contents of the map accumulating the aggregated records, gets serialized leading to NPE, since `null` is not supported by `StringDataSerilizer`. To solve this, we instead create a StringData with an empty `byte[]`, which denotes the null, and when the aggregation ends and we create the final JSON result, we check for a `byte[]` of `length` `0` in order to write the JSON `null` node.
- Loading branch information
1 parent
a4d194e
commit 4c89959
Showing
2 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters