BePPPower commented on code in PR #22854: URL: https://github.com/apache/doris/pull/22854#discussion_r1294424533
########## fe/fe-core/src/main/java/org/apache/doris/load/ExportJob.java: ########## @@ -215,55 +220,37 @@ public ExportJob(long jobId) { this.id = jobId; } - public void setJob(ExportStmt stmt) throws UserException { - String dbName = stmt.getTblName().getDb(); - Database db = Env.getCurrentInternalCatalog().getDbOrDdlException(dbName); - Preconditions.checkNotNull(stmt.getBrokerDesc()); - this.brokerDesc = stmt.getBrokerDesc(); - this.columnSeparator = stmt.getColumnSeparator(); - this.lineDelimiter = stmt.getLineDelimiter(); - this.label = stmt.getLabel(); - this.queryId = ConnectContext.get() != null ? DebugUtil.printId(ConnectContext.get().queryId()) : "N/A"; - String path = stmt.getPath(); - Preconditions.checkArgument(!Strings.isNullOrEmpty(path)); - this.whereExpr = stmt.getWhereExpr(); - this.parallelNum = stmt.getParallelNum(); - this.exportPath = path; - this.sessionVariables = stmt.getSessionVariables(); - this.timeoutSecond = sessionVariables.getQueryTimeoutS(); - - this.qualifiedUser = stmt.getQualifiedUser(); - this.userIdentity = stmt.getUserIdentity(); - this.format = stmt.getFormat(); - this.maxFileSize = stmt.getMaxFileSize(); - this.deleteExistingFiles = stmt.getDeleteExistingFiles(); - this.partitionNames = stmt.getPartitions(); - - this.exportTable = db.getTableOrDdlException(stmt.getTblName().getTbl()); - this.columns = stmt.getColumns(); - this.tableRef = stmt.getTableRef(); - if (!Strings.isNullOrEmpty(this.columns)) { - Splitter split = Splitter.on(',').trimResults().omitEmptyStrings(); - this.exportColumns = split.splitToList(stmt.getColumns().toLowerCase()); - } + /** + * For an ExportJob: + * The ExportJob is divided into multiple 'ExportTaskExecutor' + * according to the 'parallelism' set by the user. + * The tablets which will be exported by this ExportJob are divided into 'parallelism' copies, + * and each ExportTaskExecutor is responsible for a list of tablets. + * The tablets responsible for an ExportTaskExecutor will be assigned to multiple OutfileStmt + * according to the 'TABLETS_NUM_PER_OUTFILE_IN_EXPORT'. + * + * @throws UserException + */ + public void analyze() throws UserException { exportTable.readLock(); try { - this.dbId = db.getId(); - this.tableId = exportTable.getId(); - this.tableName = stmt.getTblName(); - if (selectStmtList.isEmpty()) { - // This scenario is used for 'EXPORT TABLE tbl INTO PATH' - // we need generate Select Statement - generateQueryStmt(stmt); - } + // generateQueryStmtOld + generateQueryStmt(); } finally { exportTable.readUnlock(); } - this.sql = stmt.toSql(); - this.origStmt = stmt.getOrigStmt(); + generateExportJobExecutor(); + } + + public void generateExportJobExecutor() { Review Comment: done -- 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