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/10/14 08:17:00 UTC

[jira] [Closed] (FLINK-19622) Flinksql version 1.11 is for the NullPointerException of the Map type value value in the avro format

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

Jark Wu closed FLINK-19622.
---------------------------
    Resolution: Duplicate

> Flinksql version 1.11 is for the NullPointerException of the Map type value value in the avro format
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-19622
>                 URL: https://issues.apache.org/jira/browse/FLINK-19622
>             Project: Flink
>          Issue Type: Bug
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>    Affects Versions: 1.11.2
>            Reporter: 宋洪亮
>            Priority: Critical
>
> Hello, when I use flinksql version 1.11 to analyze data in avro format in Kafka, I used the Map type. For this type, my definition is MAP<VARCHAR,VARCHAR>, but the analysis is because the value in the map is empty. NullPointerException
> The source code is attached below (AvroRowDataDeserializationSchema)
> {code:java}
> private static DeserializationRuntimeConverter createMapConverter(LogicalType type) {
>    final DeserializationRuntimeConverter keyConverter = createConverter(
>       DataTypes.STRING().getLogicalType());
>    final DeserializationRuntimeConverter valueConverter = createConverter(
>       extractValueTypeToAvroMap(type));
>    return avroObject -> {
>       final Map<?, ?> map = (Map<?, ?>) avroObject;
>       Map<Object, Object> result = new HashMap<>();
>       for (Map.Entry<?, ?> entry : map.entrySet()) {
>          Object key = keyConverter.convert(entry.getKey());
>          Object value = valueConverter.convert(entry.getValue());
>          result.put(key, value);
>       }
>       return new GenericMapData(result);
>    };
> }
> {code}
>  
>  



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