File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
main/scala/org/apache/comet/rules
test/scala/org/apache/comet Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -140,11 +140,15 @@ case class CometScanRule(session: SparkSession)
140140 private def transformV1Scan (plan : SparkPlan , scanExec : FileSourceScanExec ): SparkPlan = {
141141
142142 val hasDPP = scanExec.partitionFilters.exists(isDynamicPruningFilter)
143+ val aqeEnabled = session.sessionState.conf.adaptiveExecutionEnabled
143144
144- // DPP is supported for native_datafusion scans via lazy partition serialization.
145- // Only fall back for other scan implementations when DPP fallback is enabled.
145+ // DPP is supported for native_datafusion scans via lazy partition serialization,
146+ // but only in AQE mode where subqueries are properly prepared before execution.
147+ // In non-AQE mode, DPP subqueries aren't ready when the scan tries to use them.
146148 val scanImpl = COMET_NATIVE_SCAN_IMPL .get()
147- if (COMET_DPP_FALLBACK_ENABLED .get() && hasDPP && scanImpl != SCAN_NATIVE_DATAFUSION ) {
149+ val shouldFallbackForDPP = COMET_DPP_FALLBACK_ENABLED .get() && hasDPP &&
150+ (scanImpl != SCAN_NATIVE_DATAFUSION || ! aqeEnabled)
151+ if (shouldFallbackForDPP) {
148152 return withInfo(scanExec, " Dynamic Partition Pruning is not supported for this scan type" )
149153 }
150154
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ class CometNativeScanDPPSuite extends CometTestBase {
3939 collect(plan) { case s : CometNativeScanExec => s }
4040 }
4141
42- test(" DPP - non-AQE mode with partitioned fact table" ) {
42+ // DPP in non-AQE mode requires subquery to be prepared before scan execution.
43+ // This is currently not supported by CometNativeScan - AQE mode is recommended.
44+ ignore(" DPP - non-AQE mode with partitioned fact table" ) {
4345 withTempDir { dir =>
4446 val factDir = new File (dir, " fact" )
4547 val dimDir = new File (dir, " dim" )
You can’t perform that action at this time.
0 commit comments