[feature-wip][multi-catalog]Support caseSensitive field name in file scan node (#11310)
* Impl case sentive in file scan node
This commit is contained in:
@ -222,6 +222,14 @@ public class BrokerUtil {
|
||||
|
||||
public static List<String> parseColumnsFromPath(String filePath, List<String> columnsFromPath)
|
||||
throws UserException {
|
||||
return parseColumnsFromPath(filePath, columnsFromPath, true);
|
||||
}
|
||||
|
||||
public static List<String> parseColumnsFromPath(
|
||||
String filePath,
|
||||
List<String> columnsFromPath,
|
||||
boolean caseSensitive)
|
||||
throws UserException {
|
||||
if (columnsFromPath == null || columnsFromPath.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -246,7 +254,8 @@ public class BrokerUtil {
|
||||
throw new UserException("Fail to parse columnsFromPath, expected: "
|
||||
+ columnsFromPath + ", filePath: " + filePath);
|
||||
}
|
||||
int index = columnsFromPath.indexOf(pair[0]);
|
||||
String parsedColumnName = caseSensitive ? pair[0] : pair[0].toLowerCase();
|
||||
int index = columnsFromPath.indexOf(parsedColumnName);
|
||||
if (index == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ public class HudiScanNode extends BrokerScanNode {
|
||||
|
||||
TScanRangeLocations curLocations = newLocations(context.params, brokerDesc);
|
||||
List<String> partitionValuesFromPath = BrokerUtil.parseColumnsFromPath(fileSplit.getPath().toString(),
|
||||
getPartitionKeys());
|
||||
getPartitionKeys(), false);
|
||||
int numberOfColumnsFromFile = context.slotDescByName.size() - partitionValuesFromPath.size();
|
||||
|
||||
TBrokerRangeDesc rangeDesc = createBrokerRangeDesc(fileSplit, fileFormatType,
|
||||
|
||||
@ -309,7 +309,7 @@ public class ExternalFileScanNode extends ExternalScanNode {
|
||||
totalFileSize += split.getLength();
|
||||
|
||||
List<String> partitionValuesFromPath = BrokerUtil.parseColumnsFromPath(fileSplit.getPath().toString(),
|
||||
partitionKeys);
|
||||
partitionKeys, false);
|
||||
|
||||
TFileRangeDesc rangeDesc = createFileRangeDesc(fileSplit, partitionValuesFromPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user