You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2018/06/05 05:53:48 UTC

[GitHub] spark pull request #20915: [SPARK-23803][SQL] Support bucket pruning

Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20915#discussion_r192953104
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala ---
    @@ -50,6 +51,84 @@ import org.apache.spark.sql.execution.SparkPlan
      *     and add it.  Proceed to the next file.
      */
     object FileSourceStrategy extends Strategy with Logging {
    +
    +  // should prune buckets iff num buckets is greater than 1 and there is only one bucket column
    +  private def shouldPruneBuckets(bucketSpec: Option[BucketSpec]): Boolean = {
    +    bucketSpec match {
    +      case Some(spec) => spec.bucketColumnNames.length == 1 && spec.numBuckets > 1
    +      case None => false
    +    }
    +  }
    +
    +  private def getExpressionBuckets(expr: Expression,
    --- End diff --
    
    nit: code style
    ```
    def xxx(
        para1: A,
        para2: B): XXX
    ```


---

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