-
Notifications
You must be signed in to change notification settings - Fork 3.6k
branch-4.0: [fix](hive) refresh hive cache when inconsistency #58074 #58187
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
Merged
+38
−22
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### What problem does this PR solve?
The issue is that the user changed a single-level partition table to a
two-level partition table on the Hive side, but the cache on the Doris
side was not updated in time. In the stack trace, partitionColumnTypes
is obtained from the SchemaCache, while partitionName is obtained from
the partitionCache. This can lead to inconsistencies during the user’s
operations.
The current fix is to detect this error, invalidate the SchemaCache, and
then retry.
```
java.lang.IllegalStateException: dt=20240905/core_tag=cold vs. [varchar(65533)]
at com.google.common.base.Preconditions.checkState(Preconditions.java:512) ~[guava-32.1.2-jre.jar:?]
at org.apache.doris.datasource.hive.HiveMetaStoreCache.toListPartitionItem(HiveMetaStoreCache.java:291) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.hive.HiveMetaStoreCache.loadPartitionValues(HiveMetaStoreCache.java:263) ~[doris-fe.jar:1.2-SNAPSHOT]
at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:145) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at com.github.benmanes.caffeine.cache.LocalCache.lambda$statsAware$0(LocalCache.java:139) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) ~[?:?]
at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:56) ~[hive-catalog-shade-2.1.1.jar:2.1.1]
at org.apache.doris.datasource.hive.HiveMetaStoreCache.getPartitionValues(HiveMetaStoreCache.java:475) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.hive.HiveMetaStoreCache.getPartitionValues(HiveMetaStoreCache.java:471) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.hive.HMSExternalTable.getNameToPartitionItems(HMSExternalTable.java:313) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.ExternalTable.initSelectedPartitions(ExternalTable.java:379) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalFileScan.<init>(LogicalFileScan.java:66) ~[doris-fe.jar:1.2-SNAPSHOT]
at ...
```
Alao add a new method `getHivePartitionValues()` to wrap the
`cache.getPartitionValues()` method.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
yiguolei
approved these changes
Nov 21, 2025
Contributor
Author
|
PR approved by at least one committer and no changes requested. |
Contributor
Author
|
PR approved by anyone and no changes requested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #58074