Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #50188

@github-actions github-actions bot requested a review from yiguolei as a code owner April 27, 2025 05:17
@morningman morningman closed this Apr 28, 2025
@morningman morningman reopened this Apr 28, 2025
@morningman
Copy link
Contributor

run buildall

@yiguolei yiguolei closed this Apr 28, 2025
@yiguolei yiguolei reopened this Apr 28, 2025
@yiguolei
Copy link
Contributor

run buildall

### 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".
@morningman morningman force-pushed the auto-pick-50188-branch-2.1 branch from aaf8316 to b0c6941 Compare April 28, 2025 19:54
@morningman
Copy link
Contributor

run buildall

@morningman
Copy link
Contributor

run buildall

@yiguolei yiguolei merged commit a9b948f into branch-2.1 May 6, 2025
22 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-50188-branch-2.1 branch May 6, 2025 02:59
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.

2 participants