diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala index b8a43025882e5..b7ee6a37e21bd 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala @@ -113,7 +113,7 @@ private[sql] case class PhysicalRDD( private[sql] object PhysicalRDD { // Metadata keys val INPUT_PATHS = "InputPaths" - val PUSHED_FILTERS = "PushedFilters" + val HANDLED_FILTERS = "HandledFilters" def createFromDataSource( output: Seq[Attribute], diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala index 8a15a51d825ef..0c62921d8c804 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala @@ -27,7 +27,7 @@ import org.apache.spark.sql.catalyst.planning.PhysicalOperation import org.apache.spark.sql.catalyst.plans.logical import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow, expressions} -import org.apache.spark.sql.execution.PhysicalRDD.{INPUT_PATHS, PUSHED_FILTERS} +import org.apache.spark.sql.execution.PhysicalRDD.{HANDLED_FILTERS, INPUT_PATHS} import org.apache.spark.sql.execution.SparkPlan import org.apache.spark.sql.sources._ import org.apache.spark.sql.types.{StringType, StructType} @@ -307,8 +307,8 @@ private[sql] object DataSourceStrategy extends Strategy with Logging { // A set of column attributes that are only referenced by pushed down filters. We can eliminate // them from requested columns. + val handledPredicates = filterPredicates.filterNot(unhandledPredicates.contains) val handledSet = { - val handledPredicates = filterPredicates.filterNot(unhandledPredicates.contains) val unhandledSet = AttributeSet(unhandledPredicates.flatMap(_.references)) AttributeSet(handledPredicates.flatMap(_.references)) -- (projectSet ++ unhandledSet).map(relation.attributeMap) @@ -321,8 +321,8 @@ private[sql] object DataSourceStrategy extends Strategy with Logging { val metadata: Map[String, String] = { val pairs = ArrayBuffer.empty[(String, String)] - if (pushedFilters.nonEmpty) { - pairs += (PUSHED_FILTERS -> pushedFilters.mkString("[", ", ", "]")) + if (handledPredicates.nonEmpty) { + pairs += (HANDLED_FILTERS -> handledPredicates.mkString("[", ", ", "]")) } relation.relation match { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala index 2fb439f50117a..3f4994b09bb51 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala @@ -160,7 +160,7 @@ class PlannerSuite extends SharedSQLContext { } } - test("SPARK-11390 explain should print PushedFilters of PhysicalRDD") { + test("SPARK-11390 explain should print HandledFilters of PhysicalRDD") { withTempPath { file => val path = file.getCanonicalPath testData.write.parquet(path) @@ -169,7 +169,7 @@ class PlannerSuite extends SharedSQLContext { withTempTable("testPushed") { val exp = sql("select * from testPushed where key = 15").queryExecution.executedPlan - assert(exp.toString.contains("PushedFilters: [EqualTo(key,15)]")) + assert(exp.toString.contains("HandledFilters: [EqualTo(key,15)]")) } } }