Skip to content

Commit c7b181e

Browse files
committed
update
1 parent bf74b0e commit c7b181e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ case class PushFilterIntoRelation(conf: SQLConf) extends Rule[LogicalPlan] with
5252
predicate.references.subsetOf(partitionKeyIds)
5353
}
5454
if (pruningPredicates.nonEmpty) {
55-
relation.partitionPruningPred = pruningPredicates
55+
filter.withNewChildren(Seq(relation.copy(partitionPruningPred = pruningPredicates)()))
56+
} else {
57+
filter
5658
}
57-
filter
5859
}
5960
}
6061
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import org.apache.spark.sql.types.BooleanType
4343
private[hive] case class MetastoreRelation(
4444
databaseName: String,
4545
tableName: String,
46-
var partitionPruningPred: Seq[Expression] = Seq.empty[Expression])
46+
partitionPruningPred: Seq[Expression] = Seq.empty)
4747
(val catalogTable: CatalogTable,
4848
@transient private val client: HiveClient,
4949
@transient private val sparkSession: SparkSession)

0 commit comments

Comments
 (0)