bharos commented on issue #12371:
URL: https://github.com/apache/gravitino/issues/12371#issuecomment-5188274936
Verified the three write tools end-to-end against a **real Iceberg catalog**
(local Gravitino, `iceberg` = lakehouse-iceberg / JDBC backend), driving the
MCP server over the **Streamable-HTTP transport** with a real MCP client
(`fastmcp.Client`, `transport = StreamableHttpTransport`).
**Setup**
```
schema : iceberg.viewtest
columns : id INT (nullable), label STRING (nullable)
representation : SELECT 1 AS id, 'alpha' AS label (dialect: spark)
```
**Client-side results (over the wire) — 14/14 assertions passed:**
- `create_view` → view returned with the columns and representations sent,
plus `defaultCatalog=iceberg`, `defaultSchema=viewtest`
- `create_view` with `default_catalog`/`default_schema` omitted → created;
the optional keys are left out of the request body rather than sent as `null`
- `create_view` with empty `representations` → rejected by the server,
surfaced as a tool error: `Error code: 1001, IllegalArgumentException, Failed
to operate view(s) [v_bad]`
- `list_of_views` → `['v_e2e', 'v_e2e_nodefaults']`
- `alter_view` `setProperty` → `properties.stage == "e2e"`
- `alter_view` `rename` → `name == "v_e2e_renamed"`; the old name no longer
resolves, and `load_view` on the new name still carries the property
- `drop_view` on an existing view → `true` (x2)
- `drop_view` on a missing view → `false`
- `list_of_views` → `[]`
**Server-side proof — audit log** (each dispatch recorded by the audit
middleware, trimmed to the write tools):
```json
{"timestamp": "2026-08-05T06:09:50.334217+00:00", "principal": "super",
"tool": "create_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:50.389035+00:00", "principal": "super",
"tool": "create_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:50.472270+00:00", "principal": "super",
"tool": "create_view", "outcome": "deny", "error_type": "McpError"}
{"timestamp": "2026-08-05T06:09:51.054979+00:00", "principal": "super",
"tool": "alter_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:51.195152+00:00", "principal": "super",
"tool": "alter_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:51.530474+00:00", "principal": "super",
"tool": "drop_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:51.883876+00:00", "principal": "super",
"tool": "drop_view", "outcome": "allow"}
{"timestamp": "2026-08-05T06:09:51.905817+00:00", "principal": "super",
"tool": "drop_view", "outcome": "allow"}
```
The `deny` line is the empty-`representations` rejection propagating back as
a tool error.
The `dropped` response key (`true` vs `false`) and the server-side
validation are the two behaviours the unit tests can only mock, so they were
the point of running this live.
--
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]