CalvinKirs commented on code in PR #26146:
URL: https://github.com/apache/doris/pull/26146#discussion_r1400294699


##########
fe/fe-core/src/main/java/org/apache/doris/job/base/AbstractJob.java:
##########
@@ -132,23 +153,16 @@ public void updateJobStatus(JobStatus newJobStatus) {
     protected abstract void checkJobParamsInternal();
 
     public static AbstractJob readFields(DataInput in) throws IOException {
-        // todo use RuntimeTypeAdapterFactory of Gson to do the serde
-        JobType jobType = JobType.valueOf(Text.readString(in));
-        switch (jobType) {
-            case INSERT:
-                return InsertJob.readFields(in);
-            case MTMV:
-                // return MTMVJob.readFields(in);
-                break;
-            default:
-                throw new IllegalArgumentException("unknown job type");
-        }
-        throw new IllegalArgumentException("unknown job type");
+        String jsonJob = Text.readString(in);
+        AbstractJob<?> job = GsonUtils.GSON.fromJson(jsonJob, 
AbstractJob.class);
+        job.setRunningTasks(new ArrayList<>());

Review Comment:
   This is an initialization operation. When reading data from the metadata, 
this list should have been empty. However, due to potential reasons related to 
gson serialization, the result is null, thus displaying the initialization.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to