Skip to content

Commit 3a25912

Browse files
[fix](export) Make available for export command
1 parent 8a14454 commit 3a25912

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

fe/fe-core/src/main/java/org/apache/doris/analysis/ExportStmt.java

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
import java.util.List;
4949
import java.util.Map;
50+
import java.util.Objects;
5051
import java.util.Optional;
5152
import java.util.UUID;
5253

@@ -146,6 +147,11 @@ public boolean needAuditEncryption() {
146147
public void analyze(Analyzer analyzer) throws UserException {
147148
super.analyze(analyzer);
148149

150+
if (!Config.enable_outfile_to_local && Objects.requireNonNull(path)
151+
.startsWith(OutFileClause.LOCAL_FILE_PREFIX)) {
152+
throw new AnalysisException("`enable_outfile_to_local` = false, exporting file to local fs is disabled.");
153+
}
154+
149155
tableRef = analyzer.resolveTableRef(tableRef);
150156
Preconditions.checkNotNull(tableRef);
151157
tableRef.analyze(analyzer);

fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ExportCommand.java

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
140140
tblName.getDb() + ": " + tblName.getTbl());
141141
}
142142

143+
if (!Config.enable_outfile_to_local && path.startsWith(OutFileClause.LOCAL_FILE_PREFIX)) {
144+
throw new AnalysisException("`enable_outfile_to_local` = false, exporting file to local fs is disabled.");
145+
}
146+
143147
// check phases
144148
checkAllParameters(ctx, tblName, fileProperties);
145149

0 commit comments

Comments
 (0)