Skip to content

Conversation

@flyrain
Copy link
Contributor

@flyrain flyrain commented Sep 3, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage for location validation of Iceberg views, ensuring that views respect allowed location constraints similar to tables.

  • Adds two new test methods that verify view creation and updates within and outside allowed locations
  • Introduces supporting test infrastructure including view constants and helper methods
  • Imports necessary dependencies for view testing functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

createCatalog(services, Map.of(), catalogBaseLocation, List.of(catalogBaseLocation));
createNamespace(services, namespaceLocation);

var locationNotAllowed = Paths.get(tmpDir.toUri().toString()).toString();
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

Converting URI to string and then back to Path is unnecessary. Use tmpDir.toAbsolutePath().toString() directly for consistency with other location variables in the test.

Suggested change
var locationNotAllowed = Paths.get(tmpDir.toUri().toString()).toString();
var locationNotAllowed = tmpDir.toAbsolutePath().toString();

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment makes sense to me... however, the code suggestion probably needs to be tmpDir.toAbsolutePath().toUri().toString() to match line 208.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using this to make it more explicitly

tmpDir.resolve("location-not-allowed").toAbsolutePath().toUri().toString();

@flyrain flyrain changed the title Add location tests for views Service: Add location tests for views Sep 3, 2025
@flyrain
Copy link
Contributor Author

flyrain commented Sep 3, 2025

The test failure isn't related

InMemoryBufferPolarisPersistenceEventListenerTest > testProcessEventIsThreadSafe() FAILED
    java.lang.AssertionError at InMemoryBufferPolarisPersistenceEventListenerTest.java:219

It seems a flaky test introduced by #1844. cc @adnanhemani

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Sep 3, 2025
@flyrain flyrain merged commit 40283b2 into apache:main Sep 3, 2025
15 of 16 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Sep 3, 2025
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