[jira] [Created] (FLINK-22042) Fix reading bigint(20) UNSIGNED type field cannot be cast

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-22042) Fix reading bigint(20) UNSIGNED type field cannot be cast

Shang Yuanchun (Jira)
jingzi created FLINK-22042:
------------------------------

             Summary: Fix reading bigint(20) UNSIGNED type field  cannot be cast
                 Key: FLINK-22042
                 URL: https://issues.apache.org/jira/browse/FLINK-22042
             Project: Flink
          Issue Type: New Feature
          Components: API / Core
    Affects Versions: 1.12.2, 1.12.0
            Reporter: jingzi
             Fix For: 1.13.0
         Attachments: error.txt

I use flink-clinet read mysql table,but run failed 

Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

 

mysql table:

`

CREATE TABLE `testlxone` (
 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',

PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC 

`

mysql data

`

1

2

3

`

code:

`

val create ="create table testOne(\n id DECIMAL(20,0)\n)WITH (\n 'connector.type' = 'jdbc',\n 'connector.url' = 'jdbc:mysql://localhost:3306/flink_db?characterEncoding=UTF-8&useSSL=false',\n 'connector.table' = 'testlxone',\n 'connector.username' = 'root',\n 'connector.password' = '123456', \n 'connector.write.flush.max-rows' = '1' \n)"
 System.out.println(create)

val create2 ="create table testTwo(\n id DECIMAL(20,0)\n)WITH (\n 'connector.type' = 'jdbc',\n 'connector.url' = 'jdbc:mysql://localhost:3306/flink_db?characterEncoding=UTF-8&useSSL=false',\n 'connector.table' = 'testlxone',\n 'connector.username' = 'root',\n 'connector.password' = '123456', \n 'connector.write.flush.max-rows' = '1' \n)"

val query = "INSERT INTO testTwo select * from testOne"

 

bsTableEnv.executeSql(create)

bsTableEnv.executeSql(create2)

bsTableEnv.executeSql(query)

`

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)