Skip to content

Obscure error message on table name clash with a namespace in NoSQL Persistence #4108

@dimas-b

Description

@dimas-b

Describe the bug

When an attempt to create a table clashes with a pre-existing namespace (same name as the new table) and Polaris uses NoSQL persistence, the resulting error message is not user-friendly.

To Reproduce

  1. Run Polaris with NoSQL persistence, e.g. java -Dpolaris.persistence.type=nosql -Dpolaris.persistence.nosql.backend=InMemory -Dpolaris.persistence.auto-bootstrap-types=nosql -jar runtime/server/build/quarkus-app/quarkus-run.jar
  2. Create a catalog
  3. Run Spark
  4. In Spark:
use polaris;
create namespace ns;
create namespace ns.n2;
create table ns.n2 (n string);
[... error message here ...]

Actual Behavior

spark-sql ()> create table ns.n2 (n string);
26/04/01 17:54:38 ERROR SparkSQLDriver: Failed in [create table ns.n2 (n string)]
java.lang.IllegalArgumentException: Mismatch between persisted object type 'ns-l' (interface org.apache.polaris.persistence.nosql.coretypes.content.LocalNamespaceObj) and deserialized interface org.apache.polaris.persistence.nosql.coretypes.content.IcebergTableObj. The object ID 143836371406233600 is possibly already used by another object. If the deserialized type is a GenericObj, ensure that the artifact providing the corresponding ObjType implementation is present and is present in META-INF/services/org.apache.polaris.persistence.nosql.api.obj.ObjType
	at org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:232)
	at org.apache.iceberg.rest.ErrorHandlers$TableErrorHandler.accept(ErrorHandlers.java:124)
	at org.apache.iceberg.rest.ErrorHandlers$TableErrorHandler.accept(ErrorHandlers.java:108)
[...]

Expected Behavior

More user-friendly error message.

Additional context

Commit 2acf472

System information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions