spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hvanhovell <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14724] Use radix sort for shuffles and ...
Date Tue, 19 Apr 2016 16:54:52 GMT
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12490#discussion_r60268294
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/SortPrefixUtils.scala
---
    @@ -66,6 +66,29 @@ object SortPrefixUtils {
       }
     
       /**
    +   * Returns whether the specified SortOrder can be satisfied with a radix sort on the
prefix.
    +   */
    +  def canSortFullyWithPrefix(sortOrder: SortOrder): Boolean = {
    +    sortOrder.dataType match {
    +      case BooleanType | ByteType | ShortType | IntegerType | LongType | DateType | TimestampType
=>
    +        true
    +      case dt: DecimalType if dt.precision - dt.scale <= Decimal.MAX_LONG_DIGITS =>
    +        true
    +      case FloatType | DoubleType =>
    +        true
    +      case _ =>
    +        false
    +    }
    +  }
    +
    +  /**
    +   * Returns whether the fully sorting on the specified key field is possible with radix
sort.
    +   */
    +  def canSortFullyWithPrefix(field: StructField): Boolean = {
    +    canSortFullyWithPrefix(SortOrder(BoundReference(0, field.dataType, field.nullable),
Ascending))
    --- End diff --
    
    This seems a bit extreme just to pack a `DataType`. Shouldn't there be a function taking
a `DataType` as an argument?


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