[
https://issues.apache.org/jira/browse/FLINK-12043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16836482#comment-16836482
]
Quan Shi commented on FLINK-12043:
----------------------------------
Hi,
IMO, Flink should make null check in stead of throwing NPE in this place.
Passing null to down operator is hard to avoid. In the production environment,
you may encounter following situations:
1. Source data in a format that doesn't meet the requirements. To avoid null
return, you have to new an empty instance with no values, and filter it
afterwards.
2. Map one java class to another according to some outside conditions, and, not
every one needed to be transformed;
In these cases, empty instance is not a graceful choice.
Some other serializers like DateSerializer has null check already.
Based on the above, I recommend adding null value check for ArraySerializers
too.
Best,
Quan Shi
> Null value check in array serializers classes
> ---------------------------------------------
>
> Key: FLINK-12043
> URL: https://issues.apache.org/jira/browse/FLINK-12043
> Project: Flink
> Issue Type: Bug
> Components: API / Type Serialization System
> Affects Versions: 1.7.2
> Reporter: Quan Shi
> Assignee: aloyszhang
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Null pointer exception when get length of "_from"_ if _"from"_ is null in
> copy() method:
>
> Involved classes:
> {code:java}
> // code placeholder
> public String[] copy(String[] from) {
> String[] target = new String[from.length];
> System.arraycopy(from, 0, target, 0, from.length);
> return target;
> }
> {code}
> Involved serializer classes in package
> "org.apache.flink.api.common.typeutils.base.array"
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)