Au-Miner commented on PR #30080:
URL: https://github.com/apache/flink/pull/30080#issuecomment-7151893293
> **编译计划执行失败`UNIX_TIMESTAMP(ts)`。`08cb2981`直接**执行相同的 SQL
语句成功,并且在父提交处编译计划的往返通信成功`b1f051d0`。加载此计划的作业在启动前失败。
>
> 子类中的最小复制`JsonPlanTestBase`:
>
> @Test
> void restoresUnixTimestamp() throws Exception {
> tableEnv.getConfig().setLocalTimeZone(ZoneId.of("UTC"));
> createTestValuesSourceTable(
> "InputTimes", List.of(Row.of("2020-01-01 00:00:00")), "ts
STRING");
> createTestValuesSinkTable("Result", "now BIGINT", "parsed BIGINT");
>
> String sql = "INSERT INTO Result "
> + "SELECT UNIX_TIMESTAMP(), UNIX_TIMESTAMP(ts) FROM
InputTimes";
> String json = tableEnv.compilePlanSql(sql).asJsonString();
>
tableEnv.loadPlan(PlanReference.fromJsonString(json)).execute().await();
> }
> 预期行已存在`parsed = 1577836800`。然而,PR 提交`CodeGenException: Unsupported call:
UNIX_TIMESTAMP(STRING)`在代码生成期间抛出异常。[`deserializeCall`](https://github.com/apache/flink/blob/08cb2981020f14a5fbbf59bb98b62ef8a9dc9d30/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/RexNodeJsonDeserializer.java#L375-L396)运算符在读取其操作数之前解析,[查找结果](https://github.com/apache/flink/blob/08cb2981020f14a5fbbf59bb98b62ef8a9dc9d30/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/RexNodeJsonDeserializer.java#L610-L628)返回第一个同名候选运算符。恢复过程能否根据序列化操作数的数量选择重载运算符?使用非常量进行往返测试`ts`可以覆盖此路径。
Thank you for discovering this issue. Yes, because of the introduction of
the parameterless UNIX_TIMESTAMP, the current deserialization process results
in multiple built-in functions, and the default first one is taken as the
deserialization result. This logic should be replaced with selecting different
built-in functions based on the number of overloaded parameters. I will try to
fix this logic and address it as a pre-PR. What do you think
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]