hello-stephen commented on code in PR #70408:
URL: https://github.com/apache/doris/pull/70408#discussion_r4751868207


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateTableCommand.java:
##########
@@ -178,13 +199,22 @@ public void validateCreateTableAsSelect(ConnectContext 
ctx, LogicalPlan query) {
         if (slots.size() != ctasCols.size()) {
             throw new AnalysisException("ctas column size is not equal to the 
query's");
         }
+        Plan analyzedPlan = Preconditions.checkNotNull(analyzedPlanRef.get(), 
"analyzedPlan should not be null");

Review Comment:
   [P2] Update the CTAS planner mock for the new analysis hook
   
   The existing 
`CreateTableCommandTest.ctasInheritsOnlyForResolvedInternalOlapTarget` mocks 
construction of `NereidsPlanner` and makes `planWithLock(...)` return an 
integer-only plan directly (test lines 74–76). That bypasses `afterAnalyze`, so 
`analyzedPlanRef` is still null here and the test now throws 
`NullPointerException("analyzedPlan should not be null")` before reaching its 
inheritance assertions, even though its query is only `SELECT 1 AS k`. Update 
that test's planner/statement mocks to supply the captured analyzed plan and 
exercise the hook lifecycle, or require the snapshot only when resolving a 
VARIANT output.



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