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

Core: Introduce AssertViewUUID #8831

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Conversation

nastra
Copy link
Contributor

@nastra nastra commented Oct 13, 2023

No description provided.

@nastra nastra force-pushed the introduce-assert-uuid-req branch from b5a2e6e to c7f0dfb Compare December 6, 2023 09:19
@nastra nastra changed the title Core: Deprecate AssertTableUUID / introduce AssertUUID Core: Introduce AssertViewUUID Dec 6, 2023
@nastra nastra force-pushed the introduce-assert-uuid-req branch from c7f0dfb to 1bbf5f3 Compare December 6, 2023 09:28
@nastra nastra force-pushed the introduce-assert-uuid-req branch from 1bbf5f3 to f343516 Compare December 6, 2023 09:32
@Override
public void validate(TableMetadata base) {
throw new ValidationException(
"Cannot validate %s against a table", this.getClass().getSimpleName());
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this in the base 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.

it's not. We only throw for ViewMetadata but not for TableMetadata in https://github.com/apache/iceberg/pull/8831/files#diff-3594848799883f9d669511640aadba2b625ce3e07b93a2ae211fcc2bb999e0aaR28, but we could change that. Let me know if you'd like me to make that change

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 went ahead and moved this to the base class, so that we're in line with MetadataUpdate:

default void applyTo(TableMetadata.Builder metadataBuilder) {
throw new UnsupportedOperationException(
String.format("Cannot apply update %s to a table", this.getClass().getSimpleName()));
}
default void applyTo(ViewMetadata.Builder viewMetadataBuilder) {
throw new UnsupportedOperationException(
String.format("Cannot apply update %s to a view", this.getClass().getSimpleName()));
}

@@ -2510,6 +2510,32 @@ components:
default-sort-order-id:
type: integer

ViewRequirement:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this separate? I thought that we were just going to add assert-view-uuid to the other. I don't like having separate View and Table requirements since we use the same ones in most places.

Copy link
Contributor

Choose a reason for hiding this comment

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

I followed up with @nastra offline. Since the only requirement for views is assert-view-uuid and we don't want to change or reuse assert-table-uuid, it does make sense to have a separate set of requirements.

@rdblue
Copy link
Contributor

rdblue commented Dec 6, 2023

+1 when tests are passing. Thanks for making the refactor to move methods into the base class.

@rdblue rdblue merged commit d69ba05 into apache:main Dec 6, 2023
46 checks passed
@nastra nastra deleted the introduce-assert-uuid-req branch December 7, 2023 08:52
lisirrx pushed a commit to lisirrx/iceberg that referenced this pull request Jan 4, 2024
devangjhabakh pushed a commit to cdouglas/iceberg that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants