Re:Re: flink sql 写 hive分区表失败

2020-05-28 文章 Zhou Zach
回复的好详细!而且引出了相关的测试用例 Thanks very much! 在 2020-05-28 14:23:33,"Leonard Xu" 写道: > >>|INSERT INTO dwdCatalog.dwd.t1_copy partition (`p_year` = p_year, >> `p_month` = p_month) >>|select id,name from dwdCatalog.dwd.t1 where `p_year` = 2020 and >> `p_month` = 4 >

Re: flink sql 写 hive分区表失败

2020-05-28 文章 Leonard Xu
>|INSERT INTO dwdCatalog.dwd.t1_copy partition (`p_year` = p_year, > `p_month` = p_month) >|select id,name from dwdCatalog.dwd.t1 where `p_year` = 2020 and > `p_month` = 4 动态分区不是这样指定的,和hive的语法是一样的,下面两种应该都可以,flink这边文档少了点,可以参考[1][2] INSERT INTO dwdCatalog.dwd.t1_copy

Re:Re: flink sql 写 hive分区表失败

2020-05-28 文章 Zhou Zach
多谢指点,可以了。 但是换成动态插入,有问题: org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: SQL parse failed. Encountered "p_year" at line 3, column 58. Was expecting one of: "DATE" ... "FALSE" ... "INTERVAL" ... "NULL" ... "TIME" ... "TIMESTAMP"

Re: flink sql 写 hive分区表失败

2020-05-27 文章 Leonard Xu
Hi, >|select * from dwdCatalog.dwd.t1 where `p_year` = 2020 and `p_month` = > 5 应该是 select * 会把分区字段一起带出来吧,你字段就不匹配了,select里加上你需要的字段吧 祝好, Leonard Xu > 在 2020年5月28日,12:57,Zhou Zach 写道: > > org.apache.flink.client.program.ProgramInvocationException: The main method > caused an error:

flink sql 写 hive分区表失败

2020-05-27 文章 Zhou Zach
org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Field types of query result and registered TableSink dwdCatalog.dwd.t1_copy do not match. Query schema: [id: BIGINT, name: STRING, p_year: INT, p_month: INT, EXPR$4: INT NOT NULL, EXPR$5: INT NOT NULL]