Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug][hudi] use lowerCase to get hudi fileFormatType #9873

Merged
merged 2 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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