Validate object-form semantic model dataset sources - #5406
mattfaltyn wants to merge 2 commits into
Conversation
| semantic_model: | ||
| type: string | ||
| description: The Apache Ossie semantic model serialized as a JSON string. | ||
| description: The Apache Ossie semantic model serialized as a JSON array string. |
There was a problem hiding this comment.
Semantic model itself has changed to a single object instead of an array. The array format only exist in a short period of time before 0.2.0.
There was a problem hiding this comment.
Semantic model itself has changed to a single object instead of an array.
Great catch—thank you! I updated the implementation so the single-object form now goes through the same dataset-source validation, while retaining the array path for compatibility. I also restored the object-form OpenAPI example and added focused regression coverage for an unresolved source in an object document.
There was a problem hiding this comment.
I don't think we need to support the old version(0.1.x), given it is beta and created before the Apache Ossie incubation. Also it's a incompatible change, we may avoid that given Ossie community has moved on.
There was a problem hiding this comment.
I don't think we need to support the old version (0.1.x)
Agreed on not preserving 0.1.x just for compatibility. One detail: both 0.1.1 and the linked 0.2.0.dev0 schema define semantic_model as an array; only the outer document is an object. Did you mean Polaris should intentionally unwrap a single model per entity? If so, I can align the contract.
There was a problem hiding this comment.
Sorry, I thought it was changed to a single object from array already. Let me sync with the Ossie community a bit.
There was a problem hiding this comment.
Hi @mattfaltyn , we have fixed it in the Apache Ossie repo, Ossie PR #383.
There was a problem hiding this comment.
Hi @mattfaltyn, we have fixed it in the Apache Ossie repo, Ossie PR #383.
Thanks for the update! I aligned Polaris with the finalized Ossie contract: one JSON object is now required, arrays are rejected, and the examples use 0.2.0.dev0.
63f0558 to
6e1cbb0
Compare
Summary
Validate every
dataset.sourcein single-object semantic-model documents and reject obsolete array or scalar roots. Apache Ossie PR #383 finalized one semantic model object per document, so Polaris now enforces that contract instead of retaining the temporary array form.Previously, object documents bypassed source validation and could persist dangling table or view references. The OpenAPI example and tests now use the current
0.2.0.dev0object form. Full Apache Ossie JSON Schema validation and document-size limits remain tracked by #5205.Fixes #5405.
Validation
./gradlew :polaris-extensions-semantic-models:test --tests "org.apache.polaris.service.catalog.semanticmodel.SemanticModelCatalogTest" --max-workers=1./gradlew format compileAll --max-workers=1./gradlew :polaris-core:check :polaris-extensions-semantic-models:check --max-workers=1All commands pass on commit
6e1cbb0449with OpenJDK 21.AI assistance
AI assistance was used to investigate the defect, prepare the focused change, and run validation. The author reviewed and understands the implementation.
Checklist
CHANGELOG.md