spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7294][SQL] ADD BETWEEN
Date Sat, 02 May 2015 07:40:45 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5839#discussion_r29546014
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Column.scala ---
    @@ -296,6 +296,25 @@ class Column(protected[sql] val expr: Expression) extends Logging
{
       def eqNullSafe(other: Any): Column = this <=> other
     
       /**
    +   * True if the current column is between the lower bound and upper bound, inclusive.
    +   *
    +   * @group java_expr_ops
    +   */
    +  def between(lowerBound: String, upperBound: String): Column = {
    +    between(Column(lowerBound), Column(upperBound))
    +  }
    +
    +  /**
    +   * True if the current column is between the lower bound and upper bound, inclusive.
    +   *
    +   * @group java_expr_ops
    +   */
    +  def between(lowerBound: Column, upperBound: Column): Column = {
    +    And(GreaterThanOrEqual(this.expr, lowerBound.expr),
    --- End diff --
    
    actually - how about we change the implementation here to use Column directly, i.e.
    ```scala
    (this >= lowerBound) && (this <= upperBound)
    ```
    
    and the Python one simply calls the JVM function?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message