BePPPower commented on code in PR #22854:
URL: https://github.com/apache/doris/pull/22854#discussion_r1294514522


##########
fe/fe-core/src/main/java/org/apache/doris/load/ExportJob.java:
##########
@@ -306,30 +302,104 @@ private void generateQueryStmt(ExportStmt stmt) throws 
UserException {
         }
     }
 
-    private ArrayList<ArrayList<TableRef>> splitTablets(ExportStmt stmt) 
throws UserException {
+    /**
+     * Generate outfile select stmt
+     * @throws UserException
+     */
+    private void generateQueryStmt() throws UserException {
+        SelectList list = new SelectList();
+        if (exportColumns.isEmpty()) {
+            list.addItem(SelectListItem.createStarItem(this.tableName));
+        } else {
+            for (Column column : exportTable.getBaseSchema()) {
+                String colName = column.getName().toLowerCase();
+                if (exportColumns.contains(colName)) {
+                    SlotRef slotRef = new SlotRef(this.tableName, colName);
+                    SelectListItem selectListItem = new 
SelectListItem(slotRef, null);
+                    list.addItem(selectListItem);
+                }
+            }
+        }
+
+        ArrayList<ArrayList<TableRef>> tableRefListPerParallel = 
getTableRefListPerParallel();
+        LOG.info("Export Job [{}] is split into {} Export Task Executor.", id, 
tableRefListPerParallel.size());
+
+        // debug LOG output
+        if (LOG.isDebugEnabled()) {
+            for (int i = 0; i < tableRefListPerParallel.size(); i++) {
+                LOG.debug("ExportTaskExecutor {} is responsible for tablets:", 
i);
+                for (TableRef tableRef : tableRefListPerParallel.get(i)) {
+                    LOG.debug("Tablet id: [{}]", 
tableRef.getSampleTabletIds());
+                }
+            }
+        }
+
+        // generate 'select..outfile..' statement
+        for (ArrayList<TableRef> tableRefList : tableRefListPerParallel) {

Review Comment:
   Actually, there are multiple `TableRef` in tableRefList. Their tableName is 
the same, tablets are different



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