This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 747fff370b1 branch-4.2: [fix](fe) Propagate JSON properties for 
multi-table routine load (#69453)
747fff370b1 is described below

commit 747fff370b16ebeddf8f05917e2ddf423aa8ca6b
Author: hui lai <[email protected]>
AuthorDate: Fri Oct 23 10:46:14 2026 +0800

    branch-4.2: [fix](fe) Propagate JSON properties for multi-table routine 
load (#69453)
    
    ### What problem does this PR solve?
    
    Issue Number: None
    
    Related PR: #67510
    
    Problem Summary: Backport #67510 to branch-4.2. Multi-table routine load
    rebuilds stream-load tasks when planning dynamic target tables, but
    omitted the job's `jsonpaths` and `num_as_string` properties. Propagate
    both properties so per-table plans honor the configured JSON paths and
    number handling.
    
    The target branch does not contain `NereidsStreamLoadTaskTest`, so this
    backport adds the JSON-property test as a new file.
    
    ### Release note
    
    Fix multi-table routine load to honor `jsonpaths` and `num_as_string`
    for dynamic target tables.
    
    ### Check List (For Author)
    
    - Test: Compilation and tests skipped as requested. The original PR's
    unit test is included in this backport. CI requested with `run
    buildall`.
    - Behavior changed: Yes. Multi-table routine load applies configured
    `jsonpaths` and `num_as_string` during per-table planning.
    - Does this need documentation: No.
---
 .../doris/nereids/load/NereidsStreamLoadTask.java  |  2 +
 .../nereids/load/NereidsStreamLoadTaskTest.java    | 60 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/load/NereidsStreamLoadTask.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/load/NereidsStreamLoadTask.java
index 4b6385c5e54..4c0be605701 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/load/NereidsStreamLoadTask.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/load/NereidsStreamLoadTask.java
@@ -378,6 +378,8 @@ public class NereidsStreamLoadTask implements 
NereidsLoadTaskInfo {
         this.timezone = task.getTimezone();
         this.formatType = task.getFormatType();
         this.stripOuterArray = task.isStripOuterArray();
+        this.numAsString = task.isNumAsString();
+        this.jsonPaths = task.getJsonPaths();
         this.jsonRoot = task.getJsonRoot();
         this.sendBatchParallelism = task.getSendBatchParallelism();
         this.loadToSingleTablet = task.isLoadToSingleTablet();
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/load/NereidsStreamLoadTaskTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/load/NereidsStreamLoadTaskTest.java
new file mode 100644
index 00000000000..97591c68c0a
--- /dev/null
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/load/NereidsStreamLoadTaskTest.java
@@ -0,0 +1,60 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.load;
+
+import org.apache.doris.task.LoadTaskInfo;
+import org.apache.doris.thrift.TFileCompressType;
+import org.apache.doris.thrift.TFileFormatType;
+import org.apache.doris.thrift.TFileType;
+import org.apache.doris.thrift.TStreamLoadPutRequest;
+import org.apache.doris.thrift.TUniqueId;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+public class NereidsStreamLoadTaskTest {
+    @Test
+    public void testMultiTableBaseTaskCopiesJsonProperties() throws Exception {
+        TStreamLoadPutRequest request = new TStreamLoadPutRequest();
+        request.setLoadId(new TUniqueId(1, 2));
+        request.setTxnId(3);
+        request.setFileType(TFileType.FILE_STREAM);
+        request.setFormatType(TFileFormatType.FORMAT_JSON);
+        request.setCompressType(TFileCompressType.PLAIN);
+
+        NereidsStreamLoadTask streamLoadTask = 
NereidsStreamLoadTask.fromTStreamLoadPutRequest(request);
+        LoadTaskInfo routineLoadTask = Mockito.mock(LoadTaskInfo.class);
+        
Mockito.when(routineLoadTask.getFormatType()).thenReturn(TFileFormatType.FORMAT_JSON);
+        Mockito.when(routineLoadTask.getJsonPaths()).thenReturn(
+                "[\"$.meta.id\", \"$.meta.ts\", \"$.value.score\", 
\"$.value.region\"]");
+        
Mockito.when(routineLoadTask.getJsonRoot()).thenReturn("$.payload.items");
+        Mockito.when(routineLoadTask.isStripOuterArray()).thenReturn(true);
+        Mockito.when(routineLoadTask.isNumAsString()).thenReturn(true);
+
+        streamLoadTask.setMultiTableBaseTaskInfo(routineLoadTask);
+
+        Assertions.assertEquals(TFileFormatType.FORMAT_JSON, 
streamLoadTask.getFormatType());
+        Assertions.assertEquals(
+                "[\"$.meta.id\", \"$.meta.ts\", \"$.value.score\", 
\"$.value.region\"]",
+                streamLoadTask.getJsonPaths());
+        Assertions.assertEquals("$.payload.items", 
streamLoadTask.getJsonRoot());
+        Assertions.assertTrue(streamLoadTask.isStripOuterArray());
+        Assertions.assertTrue(streamLoadTask.isNumAsString());
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to