You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Yunfeng Zhou (Jira)" <ji...@apache.org> on 2022/05/26 07:32:00 UTC

[jira] [Created] (FLINK-27797) PythonTableUtils.getCollectionInputFormat cannot correctly handle None values

Yunfeng Zhou created FLINK-27797:
------------------------------------

             Summary: PythonTableUtils.getCollectionInputFormat cannot correctly handle None values
                 Key: FLINK-27797
                 URL: https://issues.apache.org/jira/browse/FLINK-27797
             Project: Flink
          Issue Type: Bug
          Components: API / Python
    Affects Versions: 1.15.0
            Reporter: Yunfeng Zhou


In `PythonTableUtils.getCollectionInputFormat` there are implementations like follows.
This code can be found at [https://github.com/apache/flink/blob/8488368b86a99a064446ca74e775b67ffff0b94a/flink-python/src/main/java/org/apache/flink/table/utils/python/PythonTableUtils.java#L515]

```
c -> {
            if (c.getClass() != byte[].class || dataType instanceof PickledByteArrayTypeInfo) {
                return c;
            }
```

Here, the generated function did not check `c != null` before doing `c.getClass()`. which might cause that tables created through pyflink cannot parse it when values are `None`.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)