Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-14646

Check non-null for key in KeyGroupStreamPartitioner

    XMLWordPrintableJSON

Details

    Description

      We should check non-null for key in selectChannel function in KeyGroupStreamPartitioner because KeyGroupRangeAssignment does not allow null key for assignment. And if we produce a null key in KeyGroupStreamPartitioner, the exception is not clear enough.

      Caused by: java.lang.NullPointerException
      	at org.apache.flink.runtime.state.KeyGroupRangeAssignment.assignToKeyGroup(KeyGroupRangeAssignment.java:60)
      	at org.apache.flink.runtime.state.KeyGroupRangeAssignment.assignKeyToParallelOperator(KeyGroupRangeAssignment.java:49)
      	at org.apache.flink.streaming.runtime.partitioner.KeyGroupStreamPartitioner.selectChannel(KeyGroupStreamPartitioner.java:58)
      	at org.apache.flink.streaming.runtime.partitioner.KeyGroupStreamPartitioner.selectChannel(KeyGroupStreamPartitioner.java:32)
      	at org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:120)
      	at org.apache.flink.streaming.runtime.io.RecordWriterOutput.pushToRecordWriter(RecordWriterOutput.java:110)
      	... 9 more
      

      Attachments

        Issue Links

          Activity

            People

              wind_ljy Jiayi Liao
              wind_ljy Jiayi Liao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m