You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2021/06/03 23:33:00 UTC

[jira] [Updated] (FLINK-15867) LAST_VALUE and FIRST_VALUE aggregate function does not support time-related types

     [ https://issues.apache.org/jira/browse/FLINK-15867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flink Jira Bot updated FLINK-15867:
-----------------------------------
    Labels: auto-unassigned pull-request-available stale-major  (was: auto-unassigned pull-request-available)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Major but is unassigned and neither itself nor its Sub-Tasks have been updated for 30 days. I have gone ahead and added a "stale-major" to the issue". If this ticket is a Major, please either assign yourself or give an update. Afterwards, please remove the label or in 7 days the issue will be deprioritized.


> LAST_VALUE and FIRST_VALUE aggregate function does not support time-related types
> ---------------------------------------------------------------------------------
>
>                 Key: FLINK-15867
>                 URL: https://issues.apache.org/jira/browse/FLINK-15867
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.9.2, 1.10.0
>            Reporter: Benoît Paris
>            Priority: Major
>              Labels: auto-unassigned, pull-request-available, stale-major
>         Attachments: flink-test-lastvalue-timestamp.zip
>
>
> The following fails:
> {code:java}
> LAST_VALUE(TIMESTAMP '2020-02-03 16:17:20')
> LAST_VALUE(DATE '2020-02-03')
> LAST_VALUE(TIME '16:17:20')
> LAST_VALUE(NOW()){code}
> But this works:
>  
> {code:java}
> LAST_VALUE(UNIX_TIMESTAMP()) 
> {code}
> Leading me to say it might be more a type/format issue, rather than an actual time processing issue.
> Attached is java + pom + full stacktrace, for reproduction. Stacktrace part is below.
>  
> The ByteLastValueAggFunction, etc types seem trivial to implement, but the in the createLastValueAggFunction only basic types seem to be dealt with. Is there a reason more complicated LogicalTypeRoots might not be implemented ? (old vs new types?)
>  
>  
> Caused by: org.apache.flink.table.api.TableException: LAST_VALUE aggregate function does not support type: ''TIMESTAMP_WITHOUT_TIME_ZONE''.Caused by: org.apache.flink.table.api.TableException: LAST_VALUE aggregate function does not support type: ''TIMESTAMP_WITHOUT_TIME_ZONE''.Please re-check the data type. at org.apache.flink.table.planner.plan.utils.AggFunctionFactory.createLastValueAggFunction(AggFunctionFactory.scala:617) at org.apache.flink.table.planner.plan.utils.AggFunctionFactory.createAggFunction(AggFunctionFactory.scala:113) at org.apache.flink.table.planner.plan.utils.AggregateUtil$$anonfun$9.apply(AggregateUtil.scala:285) at org.apache.flink.table.planner.plan.utils.AggregateUtil$$anonfun$9.apply(AggregateUtil.scala:279) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at scala.collection.TraversableLike$class.map(TraversableLike.scala:234) at scala.collection.AbstractTraversable.map(Traversable.scala:104) at org.apache.flink.table.planner.plan.utils.AggregateUtil$.transformToAggregateInfoList(AggregateUtil.scala:279) at org.apache.flink.table.planner.plan.utils.AggregateUtil$.transformToStreamAggregateInfoList(AggregateUtil.scala:228) at org.apache.flink.table.planner.plan.nodes.physical.stream.StreamExecGroupAggregate.<init>(StreamExecGroupAggregate.scala:72) at org.apache.flink.table.planner.plan.rules.physical.stream.StreamExecGroupAggregateRule.convert(StreamExecGroupAggregateRule.scala:68) at org.apache.calcite.rel.convert.ConverterRule.onMatch(ConverterRule.java:139) at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208) at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:631) at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:328) at org.apache.flink.table.planner.plan.optimize.program.FlinkVolcanoProgram.optimize(FlinkVolcanoProgram.scala:64)
> ----
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)