spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongjoon-hyun <...@git.apache.org>
Subject [GitHub] spark pull request #18257: [SPARK-21041][SQL] SparkSession.range should be c...
Date Sun, 11 Jun 2017 03:26:59 GMT
Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18257#discussion_r121271205
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
---
    @@ -482,11 +482,17 @@ case class Sort(
     
     /** Factory for constructing new `Range` nodes. */
     object Range {
    -  def apply(start: Long, end: Long, step: Long, numSlices: Option[Int]): Range = {
    +  def apply(start: Long, end: Long, step: Long, numSlices: Option[Int])
    +      : LeafNode with MultiInstanceRelation = {
         val output = StructType(StructField("id", LongType, nullable = false) :: Nil).toAttributes
    -    new Range(start, end, step, numSlices, output)
    +    if (start == end || (start < end ^ 0 < step)) {
    +      LocalRelation(output)
    --- End diff --
    
    Actually, at the first commit, I handled this invalid 'Range' in a new optimizer, 'RemoveInvalidRange'.
That would be a similar approach.
    
    I will wait more comment on this~ Thank you for review.


---
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