bbejeck opened a new pull request, #229: URL: https://github.com/apache/polaris-tools/pull/229
This PR adds **polaris-shell**, an interactive SQL shell for exploring Iceberg tables and catalog metadata through Polaris via its REST catalog API. ## Motivation Getting quick answers about your catalog — table counts, snapshot stats, storage location, small-file diagnostics — currently requires switching to Trino, Spark, or pyiceberg. Polaris Shell provides a lightweight SQL interface for these tasks without spinning up a heavy query engine. ## How it works Connects to Polaris using the Iceberg `RESTCatalog` with OAuth2 client credentials. SQL statements are parsed with an ANTLR 4 grammar, converted to a query plan, and executed directly through the Iceberg Java library — no JDBC driver, no query engine. SQL input → ANTLR parser → QueryPlan → Iceberg REST catalog API → results ## Supported commands | Command | Purpose | | --- | --- | | `SELECT` | Sample table data with predicate pushdown, column projection, `ORDER BY`, `LIMIT` | | `SHOW TABLES IN <namespace>` | List tables and count under a namespace | | `DESCRIBE STATS <table>` | Snapshot count, current snapshot ID, partition spec, schema | | `SHOW TABLE LOCATION <table>` | Storage location | | `SHOW TABLE POLICIES <table>` | Effective Polaris policies | | `DIAGNOSE TABLE <table>` | Small-file count vs. 128 MiB threshold | | `EXPLAIN SELECT ...` | Scan plan: manifest pruning, files eliminated, estimated bytes, warnings | > `SELECT` queries are intended for sampling and exploration, not production workloads. ## Demo A fully self-contained demo runs locally via **Docker Compose + MinIO** — no AWS account or external Polaris server required. See [`polaris-shell/README.md`](polaris-shell/README.md) for full documentation, sample output, configuration reference, and demo instructions. -- 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]
