[Fix](transactional-hive) Fix hive transactional table return empty result. (#28518)

This commit is contained in:
Qi Chen
2023-12-19 19:38:48 +08:00
committed by GitHub
parent 7da86c37ec
commit d2275e73df

View File

@ -793,7 +793,7 @@ public class HiveMetaStoreCache {
directory = AcidUtils.getAcidState(new Path(partition.getPath()), jobConf, validWriteIds, false,
true);
}
if (directory == null || directory.getBaseDirectory() == null) {
if (directory == null) {
return Collections.emptyList();
}
if (!directory.getOriginalFiles().isEmpty()) {
@ -809,6 +809,9 @@ public class HiveMetaStoreCache {
Path baseOrDeltaPath = directory.getBaseDirectory() != null ? directory.getBaseDirectory() :
!directory.getCurrentDirectories().isEmpty() ? directory.getCurrentDirectories().get(0)
.getPath() : null;
if (baseOrDeltaPath == null) {
return Collections.emptyList();
}
String acidVersionPath = new Path(baseOrDeltaPath, "_orc_acid_version").toUri().toString();
RemoteFileSystem fs = Env.getCurrentEnv().getExtMetaCacheMgr().getFsCache().getRemoteFileSystem(
new FileSystemCache.FileSystemCacheKey(