You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/11/11 02:59:00 UTC

[jira] [Closed] (FLINK-19912) JSON format fails to serialize map value with null keys

     [ https://issues.apache.org/jira/browse/FLINK-19912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu closed FLINK-19912.
---------------------------
    Resolution: Fixed

Fixed in master (1.12.0): ba7c232cd2519995b693376cdf08b028e8f2e260

> JSON format fails to serialize map value with null keys
> -------------------------------------------------------
>
>                 Key: FLINK-19912
>                 URL: https://issues.apache.org/jira/browse/FLINK-19912
>             Project: Flink
>          Issue Type: Improvement
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>    Affects Versions: 1.12.0
>            Reporter: hailong wang
>            Assignee: hailong wang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>
> When JsonRowDataSerializationSchema serializing map data with null keys, it will throw NPE. 
> As discussed following, we propose to introduce format options to solve this problem.
> {{json.map-null-key.mode}} controls the handling mode when encountering null keys for map data. 
>  - {{FAIL}} (default): throws exception
>  - {{DROP}}: drop null key entries
>  - {{LITERAL}}: serialize null keys as string literal which is determined by {{json.map-null-key.literal}} option.
> The default value of {{json.map-null-key.literal}} is "null".



--
This message was sent by Atlassian Jira
(v8.3.4#803005)