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

[#2466] feat(catalog-kafka): Add code skeleton for Kafka catalog #2509

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

mchades
Copy link
Contributor

@mchades mchades commented Mar 11, 2024

What changes were proposed in this pull request?

This PR adds a basic code skeleton for Kafka catalog. The code skeleton doesn't address the detailed code logic, just builds a basic skeleton and metadata definition for Kafka catalog

Why are the changes needed?

Fix: #2466

Does this PR introduce any user-facing change?

No

How was this patch tested?

UT will be added later when detailed code logic is added.

@mchades mchades requested a review from jerryshao March 11, 2024 12:48
@mchades mchades self-assigned this Mar 11, 2024
throw new UnsupportedOperationException(
"Hive catalog does not support topic properties metadata");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not provide a default implementation instead of implementing a throw UnsupportedOperationException in each class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we need to draw the attention of the developers of the catalog to this interface.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will cause trouble for extensions. For example, if another xxxPropertiesMetadata is added to the interface, all subclasses will have to add the same code, isn't that troublesome?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe you could create a separate issue for this? Since tablePropertiesMetadata and filesetPropertiesMetadata have the same implementations, we should incorporate overall changes in another PR.
What would you suggest? @jerryshao

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think we can create a separate issue to rethink the current interface of xxxPropertiesMetadata.

"The Kafka broker(s) to connect to, allowing for multiple brokers by comma-separating them",
true /* immutable */,
false /* hidden */));

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this only include one attribute, with the other attributes to be added in a later PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, other properties' metadata will be added in a later PR


val copyCatalogLibs by registering(Copy::class) {
dependsOn(copyDepends, "build")
from("build/libs_all", "build/libs")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should follow what @yuqi1129 just changed in #2397

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rebase and fixed

Comment on lines +96 to +111
@Override
public Schema createSchema(NameIdentifier ident, String comment, Map<String, String> properties)
throws NoSuchCatalogException, SchemaAlreadyExistsException {
throw new UnsupportedOperationException();
}

@Override
public Schema loadSchema(NameIdentifier ident) throws NoSuchSchemaException {
throw new UnsupportedOperationException();
}

@Override
public Schema alterSchema(NameIdentifier ident, SchemaChange... changes)
throws NoSuchSchemaException {
throw new UnsupportedOperationException();
}
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 unsupported or you will do in the next PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, schema-relative operations will be done in another pull request.

register("copyLibAndConfig", Copy::class) {
dependsOn(copyCatalogConfig, copyCatalogLibs)
}
}
Copy link
Contributor

@jerryshao jerryshao Mar 13, 2024

Choose a reason for hiding this comment

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

I think you still miss several integration test related codes here, are you going to do this in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, a todo added to the below

Copy link
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@diqiu50 diqiu50 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 20f91b4 into apache:main Mar 13, 2024
12 checks passed
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] Add the code skeleton for messaging catalog
3 participants