You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Saketh Kurnool (Jira)" <ji...@apache.org> on 2026/10/08 18:25:00 UTC

[jira] [Created] (FLINK-40962) LAG() unsupported for TIMESTAMP_LTZ arguments in batch mode

Saketh Kurnool created FLINK-40962:
--------------------------------------

             Summary: LAG() unsupported for TIMESTAMP_LTZ arguments in batch mode
                 Key: FLINK-40962
                 URL: https://issues.apache.org/jira/browse/FLINK-40962
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / Planner
            Reporter: Saketh Kurnool


h1. Issue

The `LAG()` window function is rejected for `TIMESTAMP_LTZ` argument types in batch/snapshot mode. It works in streaming mode. Concretely:

 
{code:java}
Failed to (re)submit Job to Flink: {"errors":["Unsupported call: LAG(TIMESTAMP_LTZ(3)) \nIf you think this function should be supported, you can create an issue and start a discussion for it."]}{code}
 

 
h1. Proposal

Add the missing `TIMESTAMP_LTZ` case to `AggFunctionFactory.createBatchLeadLagAggFunction`
h2. Files to modify
 * `flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/LeadLagAggFunction.java`: add a `LocalZonedTimestampLeadLagAggFunction` static inner class that returns `DataTypes.TIMESTAMP_LTZ` as the result type
 * `flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala`: add a case for `TIMESTAMP_LTZ` to `createBatchLeadLagAggFunction` to return a `LocalZonedTimestampLeadLagAggFunction`



--
This message was sent by Atlassian Jira
(v8.20.10#820010)