cloud-fan commented on code in PR #36697:
URL: https://github.com/apache/spark/pull/36697#discussion_r884617691
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanPartitioning.scala:
##########
@@ -32,15 +32,15 @@ import
org.apache.spark.util.collection.Utils.sequenceToOption
*/
object V2ScanPartitioning extends Rule[LogicalPlan] with SQLConfHelper {
override def apply(plan: LogicalPlan): LogicalPlan = plan transformDown {
- case d @ DataSourceV2ScanRelation(relation, scan:
SupportsReportPartitioning, _, _) =>
+ case d @ DataSourceV2ScanRelation(relation, scan:
SupportsReportPartitioning, _, None) =>
val funCatalogOpt = relation.catalog.flatMap {
case c: FunctionCatalog => Some(c)
case _ => None
}
val catalystPartitioning = scan.outputPartitioning() match {
case kgp: KeyGroupedPartitioning => sequenceToOption(kgp.keys().map(
- V2ExpressionUtils.toCatalyst(_, relation, funCatalogOpt)))
+ V2ExpressionUtils.toCatalystOpt(_, relation, funCatalogOpt)))
Review Comment:
I'm wondering if we should also fail here. If a data source uses an invalid
partitioning, we should fail the query and let users know, so that they can
debug and fix the data source. Otherwise, users may live with a performance bug
for a while as it's hard to figure out where the problem is. cc @sunchao
--
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]