anton5798 commented on code in PR #55546:
URL: https://github.com/apache/spark/pull/55546#discussion_r3140093824
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Relation.scala:
##########
@@ -199,6 +199,20 @@ case class DataSourceV2ScanRelation(
}
override def computeStats(): Statistics = {
+ // If the table reports catalog-level (pre-filter, pre-pruning) statistics
via
+ // SupportsReportCatalogStatistics and those stats carry a row count,
prefer them:
+ // they describe the full table independent of any pushdown and are
typically the
+ // strongest stats available to CBO. Otherwise fall through to the scan's
own
+ // post-pushdown statistics as before.
+ relation.table match {
Review Comment:
Yeah I'm fine with that as well - we can omit the consumer path here
whatsoever and make a separate change later if needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]