問題:Flink版本1.13,在我們使用FlinkSQL讀取Mysql中數(shù)據(jù)的時(shí)候,發(fā)現(xiàn)讀取出來的時(shí)間字段中的數(shù)據(jù)和Mysql表中的數(shù)據(jù)相差13個(gè)小時(shí),Mysql建表語(yǔ)句及插入的數(shù)據(jù)如下;
CREATE TABLE `mysql_example` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`name` varchar(64) DEFAULT NULL COMMENT '姓名',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '創(chuàng)建時(shí)間',
PRIMARY KEY (`id`)
)?
COMMENT = 'mysql例子'
ENGINE = InnoDB;insert into mysql_example values(1,'li','2024-01-01 14:06:30');
insert into mysql_example values(2,'張三','2024-01-01 14:06:30');
FlinkSQL的語(yǔ)句及查詢出的結(jié)果如下文章來源:http://www.zghlxwxcb.cn/news/detail-804099.html
CREATE TABLE mysql_table?(
? ? ?id BIGINT,
? ? ?name STRING,
? ? ?create_time TIMESTAMP
) WITH (
? 'connector' = 'jdbc',
? 'url' = '文章來源地址http://www.zghlxwxcb.cn/news/detail-804099.html
到了這里,關(guān)于【Flink】FlinkSQL讀取Mysql表中時(shí)間字段相差13個(gè)小時(shí)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!