You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "sohardforaname (via GitHub)" <gi...@apache.org> on 2023/07/09 15:38:13 UTC
[GitHub] [doris] sohardforaname commented on a diff in pull request #21197: [Feature](Nereids)support select into outfile
sohardforaname commented on code in PR #21197:
URL: https://github.com/apache/doris/pull/21197#discussion_r1257503099
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -315,7 +318,36 @@ public PlanFragment visitPhysicalOlapTableSink(PhysicalOlapTableSink<? extends P
);
rootFragment.setSink(sink);
+
rootFragment.setOutputPartition(DataPartition.UNPARTITIONED);
+
+ return rootFragment;
+ }
+
+ @Override
+ public PlanFragment visitPhysicalFileSink(PhysicalFileSink<? extends Plan> fileSink,
+ PlanTranslatorContext context) {
+ PlanFragment rootFragment = fileSink.child().accept(this, context);
+ OutFileClause outFile = new OutFileClause(
+ fileSink.getFilePath(),
+ fileSink.getFormat(),
+ fileSink.getProperties()
+ );
+
+ List<Expr> outputExprs = Lists.newArrayList();
+ fileSink.getOutput().stream().map(Slot::getExprId)
+ .forEach(exprId -> outputExprs.add(context.findSlotRef(exprId)));
+ rootFragment.setOutputExprs(outputExprs);
+
+ try {
+ outFile.analyze(null, outputExprs,
+ fileSink.getOutput().stream().map(NamedExpression::getName).collect(Collectors.toList()));
Review Comment:
because the properties' fields is analyzed in the legacy planner's analyze()
--
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-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org