You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Benchao Li (Jira)" <ji...@apache.org> on 2020/10/14 03:02:01 UTC

[jira] [Commented] (FLINK-19622) flinksql 1.11版本针对avro格式中Map类型value值的空指针异常

    [ https://issues.apache.org/jira/browse/FLINK-19622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17213552#comment-17213552 ] 

Benchao Li commented on FLINK-19622:
------------------------------------

[~奔跑的小飞袁] We should use English in Jira issues, could you please translate your description into English?

BTW, do you want to provide a PR to fix this?

> flinksql 1.11版本针对avro格式中Map类型value值的空指针异常
> -----------------------------------------
>
>                 Key: FLINK-19622
>                 URL: https://issues.apache.org/jira/browse/FLINK-19622
>             Project: Flink
>          Issue Type: Bug
>         Environment: 下面附上源码 AvroRowDataDeserializationSchema
> {code:java}
> 私有 静态DeserializationRuntimeConverter createMapConverter(LogicalType类型){
>    最终DeserializationRuntimeConverter keyConverter = createConverter(
>       DataTypes.STRING()。getLogicalType());
>    最后的DeserializationRuntimeConverter valueConverter = createConverter(
>       extractValueTypeToAvroMap(type));
>    返回avroObject-> {
>        final Map <?,?> map =(Map <?,?>)avroObject;
>       Map < Object,Object > result = new HashMap <>();
>       对于(Map.Entry <?,?> entry:map.entrySet()){
>          对象键= keyConverter.convert(entry.getKey());
>          对象值= valueConverter.convert(entry.getValue());
>          result.put(key,value);
>       }
>       返回 新的GenericMapData(result);
>    };
> }
> {code}
>            Reporter: 宋洪亮
>            Priority: Critical
>
> hello,我在使用flinksql 1.11版本针对kafka中avro格式的数据解析时,使用到了Map类型,针对此类型我的定义是MAP<VARCHAR,VARCHAR>,但是在解析是由于map中的value为空我碰到了空指针异常
>  
>  



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