Skip to content
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

[#2553] refactor: refact catalog-jdbc distribution parameter check #2563

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

zhoukangcn
Copy link
Contributor

What changes were proposed in this pull request?

Refact catalog-jdbc distribution parameter check, move to catalog-jdbc-mysql 、postgres、sqlite

Why are the changes needed?

Fix: #2553

Doris support distribution

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

UT、IT

yuqi1129
yuqi1129 previously approved these changes Mar 18, 2024
Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

LGTM

@yuqi1129
Copy link
Contributor

@mchades
Please also help to take a look.

Index[] indexes) {
Preconditions.checkArgument(
null == distribution || distribution == Distributions.NONE,
"Currently we do not support distribution in Sqlite.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it that we don't support distribution or that SQLite doesn't support distribution?


Preconditions.checkArgument(
null == distribution || distribution == Distributions.NONE,
"Currently we do not support distribution in mysql");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it that we don't support distribution or that MySQL doesn't support distribution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, MySQL, SQlite don't support distribution. The error msg is confusing, I will fix it

Copy link
Contributor

Choose a reason for hiding this comment

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

What about the PG case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PG also do not support distribution. I will fix all error msg

@@ -86,6 +86,7 @@ public void testOperationTable() {
tableComment,
properties,
null,
null,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here should use Distributions.NONE instead of null, right? Because here is testing the behaviors after the CatalogOperationDispatcher, so there will be no null here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Index[] indexes) {
if (ArrayUtils.isNotEmpty(partitioning)) {
throw new UnsupportedOperationException(
"Currently we do not support Partitioning in PostgreSQL");
}
Preconditions.checkArgument(
null == distribution || distribution == Distributions.NONE,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to judge null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's necessray, user use table API may use null for distribution.

Copy link
Contributor

@mchades mchades Mar 19, 2024

Choose a reason for hiding this comment

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

Actually, null has already been transformed into Distributions.NONE before reaching here through CatalogOperationDispatcher:
https://github.com/datastrato/gravitino/blob/0544f2a56896078bb0c97a60e7be2352c036cddc/core/src/main/java/com/datastrato/gravitino/catalog/CatalogOperationDispatcher.java#L475

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I did not notice code in CatalogOperationDispatcher. I will remove null judgement here

@zhoukangcn
Copy link
Contributor Author

@yuqi1129 @mchades could you help to review this PR again. It's updated

Copy link
Contributor

@mchades mchades left a comment

Choose a reason for hiding this comment

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

LGTM

@mchades mchades merged commit 24ad0f3 into apache:main Mar 19, 2024
5 checks passed
@zhoukangcn zhoukangcn deleted the f-2553 branch March 19, 2024 13:10
coolderli pushed a commit to coolderli/gravitino that referenced this pull request Apr 2, 2024
…n parameter check (apache#2563)

### What changes were proposed in this pull request?

Refact catalog-jdbc distribution parameter check, move to
catalog-jdbc-mysql 、postgres、sqlite

### Why are the changes needed?

Fix: apache#2553 

Doris support distribution

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

UT、IT
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.

[Subtask] Refact parameter checking of distribution in catalog jdbc
3 participants