Repository navigation
Conversation
|
Compiled-plan execution fails for Minimal reproduction in a @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();
}The expected row has |
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 |
What is the purpose of the change
UNIX_TIMESTAMP(ts)andUNIX_TIMESTAMP(ts, format)parse their arguments. Marking them as non-deterministic prevents their use in filters on updating tables withtable.optimizer.non-deterministic-update.strategy=TRY_RESOLVE. Only the zero-argument overload reads the current time. FLINK-41637Brief change log
Verifying this change
spotless:checkandverifyforflink-table/flink-table-planner.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex CLI 0.169.1