Skip to content

Commit

Permalink
[fix][hudi] use lowerCase to get hudi fileFormatType (#9873)
Browse files Browse the repository at this point in the history
use lowerCase of inputFormatName to get hudi fileFormatType
  • Loading branch information
dujl authored Jun 9, 2022
1 parent 19bc14c commit 050cbba
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ protected void buildScanRange() throws UserException, IOException {
hdfsParams.setFsName(fsName);
Log.debug("Hudi path's host is " + fsName);

TFileFormatType formatType = null;
if (this.inputFormatName.toUpperCase(Locale.ROOT).contains("parquet")) {
formatType = TFileFormatType.FORMAT_PARQUET;
} else if (this.inputFormatName.toUpperCase(Locale.ROOT).contains("orc")) {
formatType = TFileFormatType.FORMAT_ORC;
TFileFormatType fileFormatType = null;
if (this.inputFormatName.toLowerCase().contains("parquet")) {
fileFormatType = TFileFormatType.FORMAT_PARQUET;
} else if (this.inputFormatName.toLowerCase(Locale.ROOT).contains("orc")) {
fileFormatType = TFileFormatType.FORMAT_ORC;
} else {
throw new UserException("unsupported hudi table type [" + this.inputFormatName + "].");
throw new UserException("Unsupported hudi table format [" + this.inputFormatName + "].");
}

ParamCreateContext context = getParamCreateContexts().get(0);
Expand All @@ -317,7 +317,7 @@ protected void buildScanRange() throws UserException, IOException {
getPartitionKeys());
int numberOfColumnsFromFile = context.slotDescByName.size() - partitionValuesFromPath.size();

TBrokerRangeDesc rangeDesc = createBrokerRangeDesc(fileSplit, formatType,
TBrokerRangeDesc rangeDesc = createBrokerRangeDesc(fileSplit, fileFormatType,
partitionValuesFromPath, numberOfColumnsFromFile, brokerDesc);
rangeDesc.setHdfsParams(hdfsParams);
rangeDesc.setReadByColumnDef(true);
Expand Down

0 comments on commit 050cbba

Please sign in to comment.