diff options
author | Steve Lindemann <steve.lindemann@engineersgatelp.com> | 2015-07-06 10:17:05 -0700 |
---|---|---|
committer | Cheng Lian <lian@databricks.com> | 2015-07-06 10:17:05 -0700 |
commit | 39e4e7e4d89077a637c4cad3a986e0e3447d1ae7 (patch) | |
tree | 558fa9891084fbbe453368d1ca4ad1aa278ceed2 /sql | |
parent | 86768b7b3b0c2964e744bc491bc20a1d3140ce93 (diff) | |
download | spark-39e4e7e4d89077a637c4cad3a986e0e3447d1ae7.tar.gz spark-39e4e7e4d89077a637c4cad3a986e0e3447d1ae7.tar.bz2 spark-39e4e7e4d89077a637c4cad3a986e0e3447d1ae7.zip |
[SPARK-8841] [SQL] Fix partition pruning percentage log message
When pruning partitions for a query plan, a message is logged indicating what how many partitions were selected based on predicate criteria, and what percent were pruned.
The current release erroneously uses `1 - total/selected` to compute this quantity, leading to nonsense messages like "pruned -1000% partitions". The fix is simple and obvious.
Author: Steve Lindemann <steve.lindemann@engineersgatelp.com>
Closes #7227 from srlindemann/master and squashes the following commits:
c788061 [Steve Lindemann] fix percentPruned log message
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/sources/DataSourceStrategy.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/sources/DataSourceStrategy.scala b/sql/core/src/main/scala/org/apache/spark/sql/sources/DataSourceStrategy.scala index ce16e050c5..66f7ba9014 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/sources/DataSourceStrategy.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/sources/DataSourceStrategy.scala @@ -65,7 +65,7 @@ private[sql] object DataSourceStrategy extends Strategy with Logging { logInfo { val total = t.partitionSpec.partitions.length val selected = selectedPartitions.length - val percentPruned = (1 - total.toDouble / selected.toDouble) * 100 + val percentPruned = (1 - selected.toDouble / total.toDouble) * 100 s"Selected $selected partitions out of $total, pruned $percentPruned% partitions." } |