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

planner doesn't parse timestamp and date array correctly

    XMLWordPrintableJSON

    Details

      Description

      planner doesn't parse timestamp and date array correctly.

       

      Repro: 

      In a input format (like JBDCInputFormat)'s nextRecord(Row) API

      1. when setting a timestamp datum as java.sql.Timestamp/Date, it works fine
      2. when setting an array of timestamp datums as java.sql.Timestamp[]/Date[], it breaks and below is the strack trace

       

      /Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.time.LocalDateTime
      	at org.apache.flink.table.dataformat.DataFormatConverters$LocalDateTimeConverter.toInternalImpl(DataFormatConverters.java:748)
      	at org.apache.flink.table.dataformat.DataFormatConverters$ObjectArrayConverter.toBinaryArray(DataFormatConverters.java:1110)
      	at org.apache.flink.table.dataformat.DataFormatConverters$ObjectArrayConverter.toInternalImpl(DataFormatConverters.java:1093)
      	at org.apache.flink.table.dataformat.DataFormatConverters$ObjectArrayConverter.toInternalImpl(DataFormatConverters.java:1068)
      	at org.apache.flink.table.dataformat.DataFormatConverters$DataFormatConverter.toInternal(DataFormatConverters.java:344)
      	at org.apache.flink.table.dataformat.DataFormatConverters$RowConverter.toInternalImpl(DataFormatConverters.java:1377)
      	at org.apache.flink.table.dataformat.DataFormatConverters$RowConverter.toInternalImpl(DataFormatConverters.java:1365)
      	at org.apache.flink.table.dataformat.DataFormatConverters$DataFormatConverter.toInternal(DataFormatConverters.java:344)
      	at SourceConversion$1.processElement(Unknown Source)
      	at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.pushToOperator(OperatorChain.java:714)
      	at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:689)
      	at org.apache.flink.streaming.runtime.tasks.OperatorChain$CopyingChainingOutput.collect(OperatorChain.java:669)
      	at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:52)
      	at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:30)
      	at org.apache.flink.streaming.api.operators.StreamSourceContexts$NonTimestampContext.collect(StreamSourceContexts.java:104)
      	at org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction.run(InputFormatSourceFunction.java:93)
      	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:100)
      	at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:63)
      	at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:208)
      

      seems that planner runtime handles java.sql.Timetamp in these two cases differently

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Leonard Xu Leonard Xu
                Reporter:
                phoenixjiangnan Bowen Li
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: