You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by 郝文强 <18...@163.com> on 2021/01/14 09:23:41 UTC

转发:flink-sql字段类型问题




| |
郝文强
|
|
18846086541@163.com
|
签名由网易邮箱大师定制



--------- 转发邮件信息 ---------

发件人: 郝文强 <18...@163.com>
发送日期: 2021年01月14日 17:22
发送至: dev-help@flink.apache.org <de...@flink.apache.org>
主题: flink-sql字段类型问题
sql-client 创建表 报错java.math.BigInteger cannot be cast to java.lang.Long
麻烦各位帮看一下


源数据表是 mysql的information_schema.tables 表
表结构如下:
            table_catalog varchar(64)
table_schema  varchar(64)
table_name  varchar(64)
table_type  enum('base table','view','system view')
engine  varchar(64)
version int
row_format  enum('fixed','dynamic','compressed','redundant','compact','paged')
table_rows  bigint unsigned
avg_row_length  bigint unsigned
data_length bigint unsigned
max_data_length bigint unsigned
index_length  bigint unsigned
data_free bigint unsigned
auto_increment  bigint unsigned
create_time timestamp
update_time datetime
check_time  datetime
table_collation varchar(64)
checksum  bigint
create_options  varchar(256)
table_comment text
我的flink sql 建表语句:
   CREATE TABLE info_table (
  TABLE_CATALOG STRING,
  TABLE_SCHEMA STRING,
  TABLE_NAME STRING,
  TABLE_TYPE STRING,
  ENGINE STRING,
  VERSION INT,
  ROW_FORMAT STRING,
  TABLE_ROWS BIGINT,
  AVG_ROW_LENGTH BIGINT,
  DATA_LENGTH BIGINT,
  MAX_DATA_LENGTH BIGINT,
  INDEX_LENGTH BIGINT,
  DATA_FREE BIGINT,
  AUTO_INCREMENT BIGINT,
  CREATE_TIME TIMESTAMP,
  UPDATE_TIME TIMESTAMP,
  CHECK_TIME TIMESTAMP,
  TABLE_COLLATION STRING,
  CHECKSUM INTEGER,
  CREATE_OPTIONS STRING,
  TABLE_COMMENT STRING,
  PRIMARY KEY (`TABLE_NAME`) NOT ENFORCED
) WITH (
  'connector' = 'jdbc',
  'url' = 'jdbc:mysql://localhost:3306/information_schema',
  'username' = 'root',
  'password' = 'root',
  'table-name' = 'TABLES'
);


反复改了几次类型都报错: 

java.math.BigInteger cannot be cast to java.lang.Integer

java.lang.Long cannot be cast to java.math.BigDecimal

java.lang.Long cannot be cast to java.lang.Integer

| |
郝文强
|
|
18846086541@163.com
|
签名由网易邮箱大师定制