You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2026/07/19 11:07:00 UTC

[jira] [Created] (FLINK-40182) ArrayToArray and MapToMap generate code which might fail with NPE

Sergey Nuyanzin created FLINK-40182:
---------------------------------------

             Summary: ArrayToArray and MapToMap generate code which might fail with NPE
                 Key: FLINK-40182
                 URL: https://issues.apache.org/jira/browse/FLINK-40182
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
            Reporter: Sergey Nuyanzin
            Assignee: Sergey Nuyanzin


{{ArrayToArrayCastRule}}, {{MapToMapAndMultisetToMultisetCastRule}} generate code that trusted the target type's declared NOT NULL nullability instead of checking the actual runtime value. When the source array/map element was actually null (a cast doesn't enforce constraints, so a NOT NULL target type is not a runtime guarantee), the generated code would either throw an NPE (e.g., unboxing a null) or, for primitive-backed arrays, silently write a default value (e.g., 0) instead of preserving/rejecting the null — masking data corruption.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)