Skip to content

Commit e572b9a

Browse files
committed
Update HiveStrategies.scala
1 parent 6e643f8 commit e572b9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ private[hive] trait HiveStrategies {
194194
// Filter out all predicates that only deal with partition keys, these are given to the
195195
// hive table scan operator to be used for partition pruning.
196196
val partitionKeyIds = AttributeSet(relation.partitionKeys)
197-
val (pruningPredicates, otherPredicates) = predicates.partition {
198-
_.references.subsetOf(partitionKeyIds)
197+
val (pruningPredicates, otherPredicates) = predicates.partition { x =>
198+
x.references.baseSet != null &&
199+
!x.references.baseSet.isEmpty &&
200+
x.references.subsetOf(partitionKeyIds)
199201
}
200202

201203
pruneFilterProject(

0 commit comments

Comments
 (0)