[PECOBLR-1575] cross catalog metadata operations in comparator#1229
[PECOBLR-1575] cross catalog metadata operations in comparator#1229sreekanth-db wants to merge 1 commit intodatabricks:jdbc-comparator-updatedfrom
Conversation
Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
| new String[] {"main", "tpcds_sf100_delta", "%", "%"}); | ||
|
|
||
| // Cross-catalog tests: null catalog (match all catalogs) | ||
| putInMapForKey( |
There was a problem hiding this comment.
lets also add some more combinations, like tableType being TABLE, VIEW apart from null
Also, schema can be pattern, schema can be null
also, table can be null
| putInMapForKey(functionToArgsMap, Map.entry("getSchemas", 2), new String[] {null, "tpcds_%"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getColumns", 4), |
There was a problem hiding this comment.
similarly more combination here as well
| new String[] {null, "tpcds_sf100_delta", "catalog_sales"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getFunctions", 3), |
| new String[] {null, "tpcds_sf100_delta", "aggregate"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getFunctionColumns", 4), |
| new String[] {null, "tpcds_sf100_delta", "aggregate", "%"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getProcedures", 3), |
There was a problem hiding this comment.
here also more combination on schema being null, pattern
| new String[] {null, "tpcds_sf100_delta", "%"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getProcedureColumns", 4), |
| new String[] {null, "tpcds_sf100_delta", "%", "%"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getPrimaryKeys", 3), |
There was a problem hiding this comment.
do we support null catalog here? Or just to compare results for null
| new String[] {null, "oss_jdbc_tests", "test_result_set_types"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getImportedKeys", 3), |
| Map.entry("getImportedKeys", 3), | ||
| new String[] {null, "tpcds_sf100_delta", "catalog_sales"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, |
There was a problem hiding this comment.
I believe this is empty and null anyways is not supported, what is goal, you can add a comment on what you are testing here
| new String[] {null, "tpcds_sf100_delta", "catalog_sales"}); | ||
| putInMapForKey( | ||
| functionToArgsMap, | ||
| Map.entry("getCrossReference", 6), |
|
This PR has been marked as Stale because it has been open for 30 days with no activity. If you would like the PR to remain open, please remove the stale label or comment on the PR. |
|
This PR was closed because it has been inactive for 7 days since being marked as stale. |
Description
Added cross-catalog metadata tests to the JDBC comparator and fixed bug where all old(2.7.6) driver comparisons were failing due to JUnit 5's
autoCloseArgumentsdefault.Changes:
DatabaseMetaDatamethods that accept a catalog parameter (e.g.,getTables(null, ...),getSchemas(null, ...),getColumns(null, ...)), adding 42 new parameterized test invocations to validate cross-catalog metadata behavior.autoCloseArgumentsissue: JUnit 5.8+ defaults to calling.close()on anyAutoCloseableargument (Connection,ResultSet) after each parameterized test invocation. Since the comparator reuses the same connection objects across 4220+ test invocations, JUnit was silently closing them after the first invocation — causing 1917 test failures. SetautoCloseArguments = falseon all 5@ParameterizedTestannotations.ResultSetcomparison inResultSetComparatorwith try-catch to handle lazyResultSeterrors (e.g., old driver'sgetPrimaryKeys(null, ...)returns aResultSetthat throws server errors during iteration).Testing
NO_CHANGELOG=true