Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-35241

Support SQL FLOOR and CEIL functions with SECOND and MINUTE for TIMESTAMP_TLZ

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Table SQL / API
    • None

    Description

      We need a fix for both SECOND and MINUTE.

      The following query doesn't work:

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

      These two queries work:

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

       

      SELECT
        FLOOR(
            TIMESTAMP '2024-04-25 17:19:42.654'
        TO MINUTE) 

      Stack trace for the first not working query from above:

      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)
      ... 

       
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            AlexeyLV Alexey Leonov-Vendrovskiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: