Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #50188

### What problem does this PR solve?

The MetaCache is used to cache the external table instance, like hive
table.
The type of cache value is `Optional<Table>`.

When first loading a key, if the key does not exist(table not exists),
the cacheloader
will return `null`, and finally there will be a cache entry `<key,
EmptyOptional>` in cache.

So when the second time to get this key from cache, the cache will
return the `EmptyOptional`
instead of try loading this key again from remote datasource.
But what we expect is to try loading the key from remote datasource if
it does not exist in cache.

So we need check the return result of the cache, if return result is
`null` or `EmptyOptional`,
we should load the key again. Otherwise, the following case may be
failed:

1. select a non-exist hive table in Doris.
2. create the table in Hive.
3. select the table in Doris, expect to get table succeed, but still
return "table does not exist".
@github-actions github-actions bot requested a review from dataroaring as a code owner April 27, 2025 05:17
@Thearas
Copy link
Contributor

Thearas commented Apr 27, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Apr 27, 2025
@Thearas
Copy link
Contributor

Thearas commented Apr 27, 2025

run buildall

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dataroaring dataroaring merged commit 74edb1a into branch-3.0 Apr 28, 2025
22 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-50188-branch-3.0 branch April 28, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants