[fix](outfile) unify broker and hdfs path in outfile (#18809)

unify broker and hdfs path in outfile
fix fe ut and add outfile case
This commit is contained in:
slothever
2023-04-20 21:01:39 +08:00
committed by GitHub
parent 94509e51af
commit 097dcf2119
2 changed files with 87 additions and 44 deletions

View File

@ -552,7 +552,14 @@ public class OutFileClause {
} else {
isLocalOutput = false;
}
if (properties != null) {
String namePrefix = properties.containsKey(PROP_BROKER_NAME)
? BROKER_PROP_PREFIX + HdfsResource.DSF_NAMESERVICES : HdfsResource.DSF_NAMESERVICES;
String dfsNameServices = properties.getOrDefault(namePrefix, "");
if (!Strings.isNullOrEmpty(dfsNameServices) && !filePath.contains(dfsNameServices)) {
filePath = filePath.replace(HDFS_FILE_PREFIX, HDFS_FILE_PREFIX + dfsNameServices);
}
}
if (Strings.isNullOrEmpty(filePath)) {
throw new AnalysisException("Must specify file in OUTFILE clause");
}