bharos commented on issue #12099:
URL: https://github.com/apache/gravitino/issues/12099#issuecomment-5055315090

   Verified the two read tools end-to-end against a **real Hive-backed 
Gravitino** (Gravitino playground: Hive + MySQL metastore + Trino), driving the 
MCP server over the **Streamable-HTTP transport** with a real MCP client 
(`fastmcp.Client`, `transport = StreamableHttpTransport`).
   
   **Setup** (partitioned Hive table via Trino):
   
   ```sql
   CREATE TABLE catalog_hive.sales.emp_part (id int, dt varchar) WITH 
(partitioned_by = ARRAY['dt']);
   INSERT ... -- dt='2024-01-01', dt='2024-01-02'
   ```
   
   **Client-side results (over the wire):**
   
   - `list_of_partitions` → `["dt=2024-01-01", "dt=2024-01-02"]`
   - `list_of_partitions(details=true)` → identity partitions with Hive stats 
(`numRows`, `totalSize`, `numFiles`, `rawDataSize`, …)
   - `get_partition("dt=2024-01-01")` → full partition metadata DTO
   
   **Server-side proof — MCP protocol traffic** (the server logged each 
`tools/call` with the tool name, arguments, and timing, alongside the uvicorn 
HTTP access lines):
   
   ```
   INFO event=request_start  method=tools/call  source=client
        
payload={"name":"list_of_partitions","arguments":{"catalog_name":"catalog_hive","schema_name":"sales","table_name":"emp_part"}}
   INFO Request tools/call completed in 135.46ms
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   
   INFO event=request_start  method=tools/call  source=client
        payload={"name":"list_of_partitions","arguments":{...,"details":true}}
   INFO Request tools/call completed in 69.91ms
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   
   INFO event=request_start  method=tools/call  source=client
        
payload={"name":"get_partition","arguments":{...,"partition_name":"dt=2024-01-01"}}
   INFO Request tools/call completed in 47.05ms
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   ```
   
   **Server-side proof — audit log** (each dispatch recorded by the audit 
middleware):
   
   ```json
   {"timestamp": "2026-07-23T06:43:50.997750+00:00", "principal": "anonymous", 
"tool": "list_of_partitions", "outcome": "allow"}
   {"timestamp": "2026-07-23T06:43:51.132335+00:00", "principal": "anonymous", 
"tool": "list_of_partitions", "outcome": "allow"}
   {"timestamp": "2026-07-23T06:43:51.190580+00:00", "principal": "anonymous", 
"tool": "get_partition",      "outcome": "allow"}
   ```
   
   (`principal: anonymous` because the local playground runs without auth.)
   
   Also confirmed the documented behavior for hidden-partitioning catalogs: on 
`lakehouse-iceberg` the tools surface a clean "Table does not support partition 
operations" error rather than partition data.
   


-- 
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]

Reply via email to