wsjz commented on code in PR #23485: URL: https://github.com/apache/doris/pull/23485#discussion_r1328221908
########## fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java: ########## @@ -533,6 +540,78 @@ public List<Pair<LogicalPlan, StatementContext>> visitMultiStatements(MultiState return logicalPlans; } + /** + * Visit load-statements. + */ + public LogicalPlan visitLoad(LoadContext ctx) { + + BulkStorageDesc bulkDesc = null; + DorisParser.LoadStmtContext loadStmt = ctx.loadStmt(); + if (loadStmt.withRemoteStorageSystem() != null) { + Map<String, String> bulkProperties = + new HashMap<>(visitPropertyItemList(loadStmt.withRemoteStorageSystem().brokerProperties)); + if (loadStmt.withRemoteStorageSystem().S3() != null) { + bulkDesc = new BulkStorageDesc("S3", BulkStorageDesc.StorageType.S3, bulkProperties); + } else if (loadStmt.withRemoteStorageSystem().HDFS() != null) { + bulkDesc = new BulkStorageDesc("HDFS", BulkStorageDesc.StorageType.HDFS, bulkProperties); + } else if (loadStmt.withRemoteStorageSystem().LOCAL() != null) { + bulkDesc = new BulkStorageDesc("LOCAL_HDFS", BulkStorageDesc.StorageType.LOCAL, bulkProperties); + } else if (loadStmt.withRemoteStorageSystem().BROKER() != null + && loadStmt.withRemoteStorageSystem().identifierOrText().getText() != null) { + bulkDesc = new BulkStorageDesc(loadStmt.withRemoteStorageSystem().identifierOrText().getText(), + bulkProperties); + } + } + List<BulkLoadDataDesc> dataDescriptions = new ArrayList<>(); + for (DorisParser.DataDescContext ddc : ctx.loadStmt().dataDescs) { + List<String> tableName = RelationUtil.getQualifierName(ConnectContext.get(), + visitMultipartIdentifier(ddc.tableName)); + List<String> colNames = (ddc.columns == null ? ImmutableList.of() : visitIdentifierList(ddc.columns)); + List<String> columnsFromPath = (ddc.columnsFromPath == null ? ImmutableList.of() + : visitIdentifierList(ddc.columnsFromPath.identifierList())); + List<String> partitions = ddc.partition == null ? ImmutableList.of() : visitIdentifierList(ddc.partition); + // TODO: multi location + List<String> multiFilePaths = new ArrayList<>(); + for (Token filePath : ddc.filePaths) { + multiFilePaths.add(filePath.getText().substring(1, filePath.getText().length() - 1)); + } + List<String> filePaths = ddc.filePath == null ? ImmutableList.of() : multiFilePaths; + List<Expression> colMappingList = (ddc.columnMapping == null ? ImmutableList.of() + : visit(ddc.columnMapping.mappingSet, Expression.class)); + + LoadTask.MergeType mergeType = ddc.mergeType() == null ? LoadTask.MergeType.APPEND + : LoadTask.MergeType.valueOf(ddc.mergeType().getText()); + + String fileFormat = ddc.format == null ? null : ddc.format.getText(); Review Comment: check it in BulkLoadDataDesc.FileFormatDesc -- 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