dengc367 opened a new issue, #14340:
URL: https://github.com/apache/gravitino/issues/14340
### Describe the feature
Expose the native logical views of a StarRocks catalog through Gravitino,
read-only: list
views in a schema, and load a view's comment, output columns and SQL
definition.
### Motivation
StarRocks keeps views next to tables in the same schema. The StarRocks
catalog currently
implements only table operations, so a view is either invisible in Gravitino
or shows up as
a table that fails on the first metadata call. Two things depend on this:
- Semantic Model sources: they validate a source by loading it as a table
and falling back
to the view API on `NoSuchTableException`. Without view support the
fallback cannot
succeed.
- Per-view authorization and the web UI listing: both need `listViews` to
return views.
### Describe the solution
Implement `ViewCatalog` on `StarRocksCatalogOperations`:
- `listViews` from `information_schema.views`. Async materialized views are
deliberately
excluded: StarRocks marks them `TABLE_TYPE = 'VIEW'` in
`information_schema.tables`, but
they have no `information_schema.views` row and are not logical views.
- `loadView` reads the comment and `VIEW_DEFINITION`, and maps columns with
the existing
table column mapping so types match the table API.
- Make the table path raise `NoSuchTableException` for a view name, so
callers can fall
back to the view API.
Create, alter and drop are not part of this: the catalog stays read-only for
views.
### Additional context
A PR follows. Testing was done with unit tests against a mocked JDBC layer,
plus a running
StarRocks cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]