Skip to content

Conversation

@rdblue
Copy link
Contributor

@rdblue rdblue commented Feb 25, 2022

This fixes a few issues with the JDBC catalog's namespace implementation:

  • Uses a default "exists" property to allow creating a database without custom metadata
  • Implements loadNamespaceMetadata
  • Fixes incorrect NoSuchNamespaceException thrown in dropNamespace (return false instead)
  • Fixes dropNamespace when the namespace exists because properties are set (will remove all properties)
  • Allows an empty map or set of properties in removeProperties and setProperties as noops
  • Moves private helper methods to the end of the JDBCCatalog class
  • Update tests for behavior fixes and to use loadNamespaceMetadata rather than directly using the fetchProperties helper method

@github-actions github-actions bot added the core label Feb 25, 2022
}

return (insertedProperties && updatedProperties);
return hadInserts || hadUpdates;
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be out of scope for this PR, but these operations don't appear to be atomic.

Copy link
Contributor

@danielcweeks danielcweeks left a comment

Choose a reason for hiding this comment

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

Might want to create an issue for the setProperties not being atomic, but that is somewhat unrelated to these changes.

@rdblue rdblue merged commit 4621468 into apache:master Feb 25, 2022
@rdblue
Copy link
Contributor Author

rdblue commented Feb 25, 2022

Might want to create an issue for the setProperties not being atomic, but that is somewhat unrelated to these changes.

I think we're about as close as we can get to atomic with generic SQL since there is no standard way to upsert. I've also thought about doing a unique versioned insert and then dropping old versions. That could work to make it slightly more atomic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants