Skip to content

Commit

Permalink
[Fix](multi-catalog) Fix NPE when file cache is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaka11chen committed Aug 18, 2023
1 parent 1c3cc77 commit 34fa70a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ public void createScanRangeLocations() throws UserException {
HudiScanNode.setHudiParams(rangeDesc, (HudiSplit) fileSplit);
}

curLocations.getScanRange().getExtScanRange().getFileScanRange().addToRanges(rangeDesc);
TScanRangeLocation location = new TScanRangeLocation();
Backend selectedBackend;
if (enableSqlCache) {
// Use consistent hash to assign the same scan range into the same backend among different queries
Expand All @@ -336,9 +338,6 @@ public void createScanRangeLocations() throws UserException {
} else {
selectedBackend = backendPolicy.getNextBe();
}

curLocations.getScanRange().getExtScanRange().getFileScanRange().addToRanges(rangeDesc);
TScanRangeLocation location = new TScanRangeLocation();
location.setBackendId(selectedBackend.getId());
location.setServer(new TNetworkAddress(selectedBackend.getHost(), selectedBackend.getBePort()));
curLocations.addToLocations(location);
Expand Down Expand Up @@ -465,7 +464,7 @@ protected static Optional<TFileType> getTFileType(String location) {
} else if (location.startsWith(FeConstants.FS_PREFIX_HDFS)) {
return Optional.of(TFileType.FILE_HDFS);
} else if (location.startsWith(FeConstants.FS_PREFIX_COSN)) {
return Optional.of(TFileType.FILE_HDFS);
return Optional.of(TFileType.FILE_BROKER);
} else if (location.startsWith(FeConstants.FS_PREFIX_FILE)) {
return Optional.of(TFileType.FILE_LOCAL);
} else if (location.startsWith(FeConstants.FS_PREFIX_OFS)) {
Expand Down

0 comments on commit 34fa70a

Please sign in to comment.