Cherry-picked from #45241 Co-authored-by: Siyang Tang <tangsiyang@selectdb.com>
This commit is contained in:
committed by
GitHub
parent
7957e6fe0f
commit
7f8ec3e679
@ -47,6 +47,7 @@ import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -146,6 +147,11 @@ public class ExportStmt extends StatementBase {
|
||||
public void analyze(Analyzer analyzer) throws UserException {
|
||||
super.analyze(analyzer);
|
||||
|
||||
if (!Config.enable_outfile_to_local && Objects.requireNonNull(path)
|
||||
.startsWith(OutFileClause.LOCAL_FILE_PREFIX)) {
|
||||
throw new AnalysisException("`enable_outfile_to_local` = false, exporting file to local fs is disabled.");
|
||||
}
|
||||
|
||||
tableRef = analyzer.resolveTableRef(tableRef);
|
||||
Preconditions.checkNotNull(tableRef);
|
||||
tableRef.analyze(analyzer);
|
||||
|
||||
@ -139,6 +139,10 @@ public class ExportCommand extends Command implements ForwardWithSync {
|
||||
tblName.getDb() + ": " + tblName.getTbl());
|
||||
}
|
||||
|
||||
if (!Config.enable_outfile_to_local && path.startsWith(OutFileClause.LOCAL_FILE_PREFIX)) {
|
||||
throw new AnalysisException("`enable_outfile_to_local` = false, exporting file to local fs is disabled.");
|
||||
}
|
||||
|
||||
// check phases
|
||||
checkAllParameters(ctx, tblName, fileProperties);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user