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)`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to