[ 
https://issues.apache.org/jira/browse/FLINK-35241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906416#comment-17906416
 ] 

Sergey Nuyanzin commented on FLINK-35241:
-----------------------------------------

Merged as 
[c7d8515c0285fc0019571a1f637377630c5a06fa|https://github.com/apache/flink/commit/c7d8515c0285fc0019571a1f637377630c5a06fa]

> 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
>            Assignee: Hanyu Zheng
>            Priority: Major
>              Labels: pull-request-available
>
> 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 from above:
> {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