Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

构建MySQL到StarRocks, Flink实时同步时,timestamp->datetime类型值为NULL #222

Closed
sszc opened this issue May 8, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@sszc
Copy link

sszc commented May 8, 2023

版本:3.7.1, 问题如标题。

DDL

  • mysql建表
CREATE TABLE promo_member (
  id bigint(18) NOT NULL AUTO_INCREMENT,
  promo_code varchar(40) NOT NULL DEFAULT '',
  promo_name varchar(40) NOT NULL DEFAULT '',
  is_delete tinyint(4) NOT NULL DEFAULT '0',
  create_id varchar(20) NOT NULL DEFAULT '',
  create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
  update_id varchar(20) NOT NULL DEFAULT '',
  update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 
  PRIMARY KEY (id),
  KEY idx_promo_code (promo_code)
) 
  • starrocks建表
CREATE TABLE promo_member
(
    id                   BIGINT NOT NULL,
    promo_code           VARCHAR(120),
    promo_name           VARCHAR(120),
    is_delete            TINYINT,
    create_id            VARCHAR(60),
    create_time          DATETIME,
    update_id            VARCHAR(60),
    update_time          DATETIME
)
 ENGINE=olap
PRIMARY KEY(id)
DISTRIBUTED BY HASH(id)
BUCKETS 3
PROPERTIES("replication_num" = "1")

写入后create_time和update_time都为NULL
image

@BI_张建

@baisui1981 baisui1981 added this to the v3.7.2 milestone May 8, 2023
@baisui1981
Copy link
Member

修复了,chunjun starrock 模块的一个bug,qlangtech/chunjun@e9dec06
在值序列化过程,加SerializerFeature.WriteDateUseDateFormat feautre,将datetime类型的值序列化成 yyyy-mm-dd HH:mm:ss 这样的格式就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants