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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to