jlon opened a new pull request, #11236: URL: https://github.com/apache/paimon/pull/11236
### Purpose Close #11068. `AbstractJsonRecordParser.extractRowData` converted every value with `Objects.toString`, so a JSON null became the literal string `"null"`. For OGG JSON (`OggRecordParser`) and the other parsers built on this class, a `null` column value was stored as `"null"` instead of SQL NULL, while an empty string and the literal string `"null"` were indistinguishable from it. The value map now preserves Java null and only serializes non-basic values, keeping the previous behaviour for every other value. `Collectors.toMap` rejects null values, which is why the stream collector was replaced with an explicit loop over the source map. Consumers already treat a null value as SQL NULL (`CdcRecordUtils.toGenericRow` skips null values, `projectAsInsert` only casts non-null ones), so no downstream change is needed. ### Tests - Added `OggRecordParserTest.testJsonNullIsNotConvertedToString`: one OGG insert event with `"NAME": null`, `"EMPTY_VALUE": ""` and `"LITERAL_NULL": "null"` asserts that `NAME` stays null and the other two values are unchanged. Fails on master (`expected: null but was: "null"`), passes with this change. - Existing parser tests still pass: `mvn -pl paimon-flink/paimon-flink-cdc -Pflink1 -Dtest='*RecordParserTest' test` (26 tests, including canal, maxwell, aliyun, debezium). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
