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

ClassCastException when lookup join a JDBC table on INT UNSIGNED column

    XMLWordPrintableJSON

    Details

      Description

      The primary key of the MySQL is an INT UNSIGNED column, but declared INT in Flink.
      I know the docs say it should be decalred BIGINT in Flink, however, would be better not fail the job.

      At least, the exception is hard to understand for users. We can also check the schema before start the job.

      java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
      	at org.apache.flink.table.data.GenericRowData.getInt(GenericRowData.java:149) ~[flink-table-blink_2.11-1.11-vvr-2.1.1-SNAPSHOT.jar:1.11-vvr-2.1.1-SNAPSHOT]
      	at JoinTableFuncCollector$6460.collect(Unknown Source) ~[?:?]
      	at org.apache.flink.table.functions.TableFunction.collect(TableFunction.java:203) ~[flink-table-blink_2.11-1.11-vvr-2.1.1-SNAPSHOT.jar:1.11-vvr-2.1.1-SNAPSHOT]
      	at org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction.eval(JdbcRowDataLookupFunction.java:162) ~[?:?]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jark Jark Wu
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

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