[
https://issues.apache.org/jira/browse/FLINK-5124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15687674#comment-15687674
]
ASF GitHub Bot commented on FLINK-5124:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/2851#discussion_r89192110
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/codegen/calls/ScalarOperators.scala
---
@@ -656,38 +656,56 @@ object ScalarOperators {
right: GeneratedExpression)
: GeneratedExpression = {
- val operator = if (plus) "+" else "-"
+ val op = if (plus) "+" else "-"
(left.resultType, right.resultType) match {
case (l: TimeIntervalTypeInfo[_], r: TimeIntervalTypeInfo[_]) if l
== r =>
- generateArithmeticOperator(operator, nullCheck, l, left, right)
+ generateArithmeticOperator(op, nullCheck, l, left, right)
case (SqlTimeTypeInfo.DATE, TimeIntervalTypeInfo.INTERVAL_MILLIS) |
(TimeIntervalTypeInfo.INTERVAL_MILLIS, SqlTimeTypeInfo.DATE) =>
generateOperatorIfNotNull(nullCheck, SqlTimeTypeInfo.DATE, left,
right) {
if (isTimePoint(left.resultType)) {
--- End diff --
Wouldn't it be easier to read if this case would be handled by the outer
pattern matching with separate cases for `(SqlTimeTypeInfo.DATE,
TimeIntervalTypeInfo.INTERVAL_MILLIS)` and
`(TimeIntervalTypeInfo.INTERVAL_MILLIS, SqlTimeTypeInfo.DATE)`?
> Support more temporal arithmetic
> --------------------------------
>
> Key: FLINK-5124
> URL: https://issues.apache.org/jira/browse/FLINK-5124
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Reporter: Timo Walther
> Assignee: Timo Walther
>
> Multiple TPC-H queries fail because of missing temporal arithmetic support.
> Since CALCITE-308 has been fixed we can add additional operations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)