Append URL parameters in TrinoContainer.getJdbcUrl() - #12073
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesTrino JDBC URL parameters
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Configured Trino JDBC URL parameters are propagated and validated by integration coverage; no actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JdbcDatabaseContainer.withUrlParam(...)is a silent no-op onTrinoContainer: parameters are stored inurlParameters, but they only reach the JDBC URL if the subclass'sgetJdbcUrl()appendsconstructUrlParameters(...)— and Trino's never did. Every other non-OracleJdbcDatabaseContainersubclass (MySQL, PostgreSQL, MariaDB, TiDB, CockroachDB, Db2, MSSQLServer, ClickHouse, CrateDB, OceanBase, Timeplus, Databend, YugabyteDB) applies the idiom; Oracle is a deliberate exception (thin-URL syntax). The gap traces to thewithUrlParamrollout in #1874 (2019), which predated Presto's fix — Trino was created by copying Presto, and the neworg.testcontainers.trinopackage copied it again.The Trino JDBC driver supports URL query parameters (
jdbc:trino://host:port/catalog?prop=value— SSL,applicationNamePrefix, session properties), so the dropped setting is meaningful, and because the failure mode leaves defaults in place there is no error pointing at Testcontainers.This change appends
constructUrlParameters("?", "&")in both theorg.testcontainers.trino.TrinoContainerand the deprecatedorg.testcontainers.containers.TrinoContainer(the frozen Presto module is left untouched), and addstestWithAdditionalUrlParamInJdbcUrlmirroring the existing MySQL test of the same name. Verified against a livetrinodb/trino:476container: the test fails before the change (URL contains no?) and passes after, including aSELECT 1throughcreateConnection()over the parameterized URL.spotlessApplyproduced no further changes.Prepared with the assistance of Claude (Anthropic); the failing/passing runs against the live container were verified by execution.
🤖 Generated with Claude Code
Summary by CodeRabbit