aokolnychyi commented on code in PR #40734:
URL: https://github.com/apache/spark/pull/40734#discussion_r1164418931


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -389,6 +389,46 @@ case class WriteDelta(
   }
 }
 
+trait V2CreateTableAsSelectPlan extends Command with V2CreateTablePlan with 
KeepAnalyzedQuery {

Review Comment:
   Great point, `AnalysisOnlyCommand` already has the logic to hide children. 
Switched.
   
   All other v2 write commands extend `KeepAnalyzedQuery`. It seems safe to 
remove it and use the optimized plan to construct `DataFrame` as that plan is 
marked as analyzed (so analysis won't be called again). We will re-optimize the 
plan after constructing `DataFrame` but it should be faster than optimizing 
only the analyzed plan (at least we can avoid planning scans multiple times). 
If there is no harm of using the optimized plan to create `DataFrame`, I'll 
follow up with a PR to remove `KeepAnalyzedQuery`.



-- 
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]

Reply via email to