flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7814) Add BETWEEN and NOT BETWEEN expression to Table API
Date Thu, 17 May 2018 09:53:00 GMT

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

ASF GitHub Bot commented on FLINK-7814:
---------------------------------------

Github user xccui commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6027#discussion_r188894442
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/logic.scala
---
    @@ -105,3 +105,75 @@ case class If(
         }
       }
     }
    +
    +abstract class BetweenProperty(
    +  expr: Expression,
    +  lowerBound: Expression,
    +  upperBound: Expression) extends Expression {
    +
    +  override private[flink] def resultType: TypeInformation[_] = BasicTypeInfo.BOOLEAN_TYPE_INFO
    +
    +  override private[flink] def children: Seq[Expression] = Seq(expr, lowerBound, upperBound)
    +
    +  override private[flink] def validateInput(): ValidationResult = {
    +    (expr.resultType, lowerBound.resultType, upperBound.resultType) match {
    +      case (exprType, lowerType, upperType)
    +        if isNumeric(exprType) && isNumeric(lowerType) && isNumeric(upperType)
    +      => ValidationSuccess
    +      case (exprType, lowerType, upperType)
    +        if isComparable(exprType) && exprType == lowerType && exprType
== upperType
    +      => ValidationSuccess
    +      case (exprType, lowerType, upperType) =>
    +        ValidationFailure(
    +          s"Between is only supported for numeric types and " +
    +            s"comparable types of same type, got $exprType, $lowerType and $upperType"
    --- End diff --
    
    Between is only supported for numeric types and identical comparable types, but got $exprType,
$lowerType and $upperType.


> Add BETWEEN and NOT BETWEEN expression to Table API
> ---------------------------------------------------
>
>                 Key: FLINK-7814
>                 URL: https://issues.apache.org/jira/browse/FLINK-7814
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API &amp; SQL
>    Affects Versions: 1.4.0
>            Reporter: Fabian Hueske
>            Assignee: Ruidong Li
>            Priority: Minor
>
> * The Table API does not have a BETWEEN expression. BETWEEN is quite handy when defining
join predicates for window joins.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message