Alexey Leonov-Vendrovskiy created FLINK-35241:
-------------------------------------------------

             Summary: Support SQL FLOOR and CEIL functions with SECOND and 
MINUTE for TIMESTAMP_TLZ
                 Key: FLINK-35241
                 URL: https://issues.apache.org/jira/browse/FLINK-35241
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API
            Reporter: Alexey Leonov-Vendrovskiy


We need a fix for both SECOND and MINUTE.

The following query doesn't work:


{code:java}
SELECT
  FLOOR(
      CAST(TIMESTAMP '2024-04-25 17:19:42.654' AS TIMESTAMP_LTZ(3))
  TO MINUTE) {code}


These two queries work:


{code:java}
SELECT
  FLOOR(
      CAST(TIMESTAMP '2024-04-25 17:19:42.654' AS TIMESTAMP_LTZ(3))
  TO HOUR) {code}
 
{code:java}
SELECT
  FLOOR(
      TIMESTAMP '2024-04-25 17:19:42.654'
  TO MINUTE) {code}


Stack trace:

For the first not working query:
{code:java}
Caused by: io.confluent.flink.table.utils.CleanedException: 
org.codehaus.commons.compiler.CompileException: Line 41, Column 69: No 
applicable constructor/method found for actual parameters 
"org.apache.flink.table.data.TimestampData, 
org.apache.flink.table.data.TimestampData"; candidates are: "public static long 
org.apache.flink.table.runtime.functions.SqlFunctionUtils.floor(long, long)", 
"public static float 
org.apache.flink.table.runtime.functions.SqlFunctionUtils.floor(float)", 
"public static org.apache.flink.table.data.DecimalData 
org.apache.flink.table.runtime.functions.SqlFunctionUtils.floor(org.apache.flink.table.data.DecimalData)",
 "public static int 
org.apache.flink.table.runtime.functions.SqlFunctionUtils.floor(int, int)", 
"public static double 
org.apache.flink.table.runtime.functions.SqlFunctionUtils.floor(double)"
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:13080)
at 
org.codehaus.janino.UnitCompiler.findMostSpecificIInvocable(UnitCompiler.java:9646)
at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9506)
at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:9422)
at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:5263)
... {code}
 
 



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

Reply via email to