Skip to content

Conversation

@ajantha-bhat
Copy link
Member

@ajantha-bhat ajantha-bhat commented Dec 17, 2025

Implement view registration support in REST catalog using
the RegisterViewRequest. This adds:

  • registerView method to ViewSessionCatalog and BaseViewSessionCatalog
  • REST endpoint handling in CatalogHandlers
  • Client-side implementation in RESTCatalog and RESTSessionCatalog
  • Resource path support for register-view endpoint
  • Tests for the complete registration flow

assertThat(catalog.dropView(identifier)).isTrue();
assertThat(catalog.viewExists(identifier)).as("View must not exist").isFalse();

// view metadata should still exist after dropping the view as gc is disabled
Copy link
Member Author

Choose a reason for hiding this comment

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

For the REST catalog, it won't be BaseViewOperations, it is RESTViewOperations and doesn't expose fileIO. So, removed the check.

While Registering the view, if the file doesn't exist, It will throw the exception anyways and testcase will fail in that case. Now it is passing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: We may still want to just conditionally perform this assertion if it's a BaseViewOperations that the client doesn't just drop it. You're right that we'd expect the subsequent register to fail if the metadata file doesn't exist but if someone wants to run this test suite against some arbitrary catalog that has a bug on cleanup or maybe there's a bug in that implementation where register doesn't really check the metadata file, it'd be nice to have a clearer failure here rather than proceeding. Keeping the assertion in that case is a minor additional check that allows us to more clearly catch issues like that.

@ajantha-bhat
Copy link
Member Author

Rebasing the PR due to conflict in RESTSessionCatalog

Implement view registration support in REST catalog using
the RegisterViewRequest. This adds:
- registerView method to ViewSessionCatalog and BaseViewSessionCatalog
- REST endpoint handling in CatalogHandlers
- Client-side implementation in RESTCatalog and RESTSessionCatalog
- Resource path support for register-view endpoint
- Tests for the complete registration flow
@nastra nastra changed the title REST: Implement register view for REST catalog Core: Implement register view for REST catalog Jan 19, 2026
checkViewIdentifierIsValid(ident);

Preconditions.checkArgument(
metadataFileLocation != null && !metadataFileLocation.isEmpty(),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We could use Strings.isNullOrEmpty method. Feel free to ignore this comment. I know this condition is consistent with registerTable.

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

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

Thanks @ajantha-bhat! had a minor comment on one of the test changes but other than that it looks good to me

assertThat(catalog.dropView(identifier)).isTrue();
assertThat(catalog.viewExists(identifier)).as("View must not exist").isFalse();

// view metadata should still exist after dropping the view as gc is disabled
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: We may still want to just conditionally perform this assertion if it's a BaseViewOperations that the client doesn't just drop it. You're right that we'd expect the subsequent register to fail if the metadata file doesn't exist but if someone wants to run this test suite against some arbitrary catalog that has a bug on cleanup or maybe there's a bug in that implementation where register doesn't really check the metadata file, it'd be nice to have a clearer failure here rather than proceeding. Keeping the assertion in that case is a minor additional check that allows us to more clearly catch issues like that.

@ajantha-bhat
Copy link
Member Author

Thanks everyone for the reviews. I have addressed the nits and PR is ready.

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.

5 participants