mgaido91 commented on a change in pull request #23802: [SPARK-26893][SQL] Allow
partition pruning with subquery filters on file source
URL: https://github.com/apache/spark/pull/23802#discussion_r258822063
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala
##########
@@ -270,12 +274,12 @@ case class FileSourceScanExec(
"PushedFilters" -> seqToString(pushedDownFilters),
"DataFilters" -> seqToString(dataFilters),
"Location" -> locationDesc)
- val withOptPartitionCount =
- relation.partitionSchemaOption.map { _ =>
- metadata + ("PartitionCount" -> selectedPartitions.size.toString)
- } getOrElse {
- metadata
- }
+ val withOptPartitionCount = if (relation.partitionSchemaOption.isDefined &&
+ !partitionOnlyAvailableAtRuntime) {
+ metadata + ("PartitionCount" -> selectedPartitions.size.toString)
+ } else {
+ metadata
Review comment:
I am wondering about adding here `"PartitionCount" -> "unknown"` or
something which shows that we are reading partitioned data but we don't know
how many of them. On the other side maybe people trust this field to be a
numeric one so I am not sure about the best thing to do honestly. @cloud-fan
@viirya thoughts?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]