morningman commented on code in PR #21871:
URL: https://github.com/apache/doris/pull/21871#discussion_r1265510058
##########
fe/fe-core/src/main/java/org/apache/doris/planner/external/hudi/HudiScanNode.java:
##########
@@ -247,78 +257,76 @@ public List<Split> getSplits() throws UserException {
if (ugi != null) {
try {
partitions = ugi.doAs(
- (PrivilegedExceptionAction<List<HivePartition>>) () ->
getPrunedPartitions(hudiClient));
+ (PrivilegedExceptionAction<List<HivePartition>>) () ->
getPrunedPartitions(hudiClient,
+ snapshotTimestamp));
} catch (Exception e) {
throw new UserException(e);
}
} else {
- partitions = getPrunedPartitions(hudiClient);
+ partitions = getPrunedPartitions(hudiClient, snapshotTimestamp);
}
- try {
- for (HivePartition partition : partitions) {
- String globPath;
- String partitionName = "";
- if (partition.isDummyPartition()) {
- globPath = hudiClient.getBasePathV2().toString() + "/*";
- } else {
- partitionName =
FSUtils.getRelativePartitionPath(hudiClient.getBasePathV2(),
- new Path(partition.getPath()));
- globPath = String.format("%s/%s/*",
hudiClient.getBasePathV2().toString(), partitionName);
- }
- List<FileStatus> statuses =
FSUtils.getGlobStatusExcludingMetaFolder(hudiClient.getRawFs(),
+ return partitions.parallelStream().flatMap(partition -> {
Review Comment:
Better use a specified thread pool to do this, or it will use global
ForkedJoinPool, which may be effected by other process.
How about use executor in ExternalMetaCacheMgr?
##########
fe/fe-core/src/main/java/org/apache/doris/planner/external/hudi/HudiCachedPartitionProcessor.java:
##########
@@ -74,6 +73,31 @@ public void cleanTablePartitions(String dbName, String
tblName) {
.forEach(partitionCache::invalidate);
}
+ public TablePartitionValues getSnapshotPartitionValues(HMSExternalTable
table,
+ HoodieTableMetaClient tableMetaClient, String timestamp) {
+ assert (catalogId == table.getCatalog().getId());
Review Comment:
Prefer to use `Preconditions.checkState()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]