Is your feature request related to a problem?
The OpenSearch SQL JDBC driver (v1.4.0.1, last released August 2023) has zero CI-integrated tests against a real OpenSearch cluster. The sql-jdbc repo uses only WireMock unit tests, and the two existing JDBC-using test suites in this repo (comparisonTest with 460+ queries and integJdbcTest with 6 cursor tests) are excluded from CI and must be run manually (with code changes).
This means:
- We cannot confirm JDBC driver compatibility with new OpenSearch versions (e.g., 3.x) without manual effort
- Regressions in the SQL plugin's JDBC response format or driver-facing behavior go undetected until customers report them
- Key JDBC API surfaces used by BI tools (
DatabaseMetaData, PreparedStatement, explicit type retrieval) have no test coverage at all
What solution would you like?
Wire existing JDBC test suites into CI and add targeted tests for uncovered JDBC API surfaces:
- Enable existing test suites in CI:
- comparisonTest — 460+ SQL queries executed through the JDBC driver against OpenSearch, results compared against H2/SQLite for correctness. Covers
SELECT, WHERE, ORDER BY, GROUP BY, aggregations, JOINs, subqueries, window functions, math/text/date functions, type casting, and 25 bugfix regressions.
- integJdbcTest — 6 tests covering cursor/pagination via the JDBC driver.
- Centralize JDBC driver version — move the default from hardcoded 1.2.0.0 to a property in gradle.properties (set to 1.4.0.1) for easier updates.
- Add new integration tests for gaps not covered by comparisonTest:
| Test Class |
Coverage |
ConnectionIT |
DatabaseMetaData.getTables(), getColumns(), getTypeInfo(), getCatalogs() — the calls BI tools make on connect |
DataRetrievalIT |
Explicit getInt/getString/getDouble/getDate/getTimestamp/getObject + wasNull() + ResultSetMetaData column type verification |
PreparedStatementIT |
Parameterized queries with setString/setInt/setDate/setObject |
ErrorHandlingIT |
Invalid SQL → SQLException, non-existent index → proper error code/message |
All new tests extend SQLIntegTestCase and reuse existing test indices (BANK, DATA_TYPE_NUMERIC, DATA_TYPE_NONNUMERIC, NULL_MISSING).
What alternatives have you considered?
- Tests in the sql-jdbc repo instead: The sql-jdbc repo has no cluster infrastructure (no RestIntegTestTask, no test indices, no plugin loading). Adding it would duplicate everything the SQL repo already has.
- REST-only tests with
format=jdbc: Already exist in integTest (in CI), but these test the JDBC response format, not the JDBC driver. They don't exercise the driver's type mapping, metadata APIs, cursor handling, or connection management.
Do you have any additional context?
- JDBC driver API surface reference: Connection, Statement, PreparedStatement, ResultSet, ResultSetMetaData, DatabaseMetaData (partial — getTables, getColumns, getTypeInfo). No DML, no transactions, no scrollable cursors.
- Existing run commands:
./gradlew :integ-test:comparisonTest -DjdbcDriverVersion=1.4.0.1 and ./gradlew :integ-test:integJdbcTest -DjdbcDriverVersion=1.4.0.1
- Test branch: https://github.com/dai-chen/sql-1/tree/fix/jdbc-correctness-test-infra
Is your feature request related to a problem?
The OpenSearch SQL JDBC driver (v1.4.0.1, last released August 2023) has zero CI-integrated tests against a real OpenSearch cluster. The sql-jdbc repo uses only WireMock unit tests, and the two existing JDBC-using test suites in this repo (
comparisonTestwith 460+ queries andintegJdbcTestwith 6 cursor tests) are excluded from CI and must be run manually (with code changes).This means:
DatabaseMetaData,PreparedStatement, explicit type retrieval) have no test coverage at allWhat solution would you like?
Wire existing JDBC test suites into CI and add targeted tests for uncovered JDBC API surfaces:
SELECT,WHERE,ORDER BY,GROUP BY, aggregations,JOINs, subqueries, window functions, math/text/date functions, type casting, and 25 bugfix regressions.ConnectionITDatabaseMetaData.getTables(),getColumns(),getTypeInfo(),getCatalogs()— the calls BI tools make on connectDataRetrievalITgetInt/getString/getDouble/getDate/getTimestamp/getObject+wasNull()+ResultSetMetaDatacolumn type verificationPreparedStatementITsetString/setInt/setDate/setObjectErrorHandlingITSQLException, non-existent index → proper error code/messageWhat alternatives have you considered?
format=jdbc: Already exist in integTest (in CI), but these test the JDBC response format, not the JDBC driver. They don't exercise the driver's type mapping, metadata APIs, cursor handling, or connection management.Do you have any additional context?
./gradlew :integ-test:comparisonTest -DjdbcDriverVersion=1.4.0.1and./gradlew :integ-test:integJdbcTest -DjdbcDriverVersion=1.4.0.1