github-actions[bot] commented on code in PR #64878:
URL: https://github.com/apache/doris/pull/64878#discussion_r3636543337


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AlterRoutineLoadCommand.java:
##########
@@ -164,15 +186,21 @@ public void validate(ConnectContext ctx) throws 
UserException {
         // check routine load job properties include desired concurrent number 
etc.
         checkJobProperties();
         // check load properties
-        RoutineLoadJob job = Env.getCurrentEnv().getRoutineLoadManager()
-                .getJob(getDbName(), getJobName());
-        this.routineLoadDesc = CreateRoutineLoadInfo.checkLoadProperties(ctx, 
loadPropertyMap,
-                job.getDbFullName(), job.getTableName(), job.isMultiTable(), 
job.getMergeType());
+        RoutineLoadJob job = hasTargetTable()
+                ? 
Env.getCurrentEnv().getRoutineLoadManager().checkPrivAndGetJob(getDbName(), 
getJobName())
+                : 
Env.getCurrentEnv().getRoutineLoadManager().getJob(getDbName(), getJobName());
+        if (MapUtils.isNotEmpty(loadPropertyMap)) {
+            this.routineLoadDesc = 
CreateRoutineLoadInfo.checkLoadProperties(ctx, loadPropertyMap,
+                    job.getDbFullName(), job.getTableName(), 
job.isMultiTable(), job.getMergeType());
+        }
         // check data source properties
         checkDataSourceProperties();
         checkPartialUpdate();
+        if (hasTargetTable()) {
+            validateTargetTable(ctx, job);

Review Comment:
   [P1] Use the actual job label when validating partial-column target 
switches. The new grammar accepts SET TARGET TABLE together with 
PROPERTIES("partial_columns"="true"), but validate() calls checkPartialUpdate() 
before this branch, and that helper calls getJob(getDbName(), getDbName()). For 
an ordinary db1.job1 this returns null and job.isMultiTable() throws a 
NullPointerException; if an unrelated live job named db1 exists, the wrong 
job/table is validated instead. Reuse the already resolved job (or at least 
getJobName()), and add a target-plus-partial_columns test with distinct 
database and job names.



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