Skip to content

Avatical Removal Part1: remove Avatica dependency from metadata conversion flow#136

Merged
carsheng merged 36 commits intomainfrom
csheng/avatica-removal
Mar 11, 2026
Merged

Avatical Removal Part1: remove Avatica dependency from metadata conversion flow#136
carsheng merged 36 commits intomainfrom
csheng/avatica-removal

Conversation

@carsheng
Copy link
Contributor

@carsheng carsheng commented Nov 13, 2025

This change accomplishes Part 1 of removing Avatica from the datacloud-jdbc driver - specifically focusing on marshalling of column metadata. It removes Avatica dependencies from metadata conversion and introduces a custom SimpleResultSet implementation for database metadata queries which includes much of the JDBc boilerplate that was originally handled by Avatica.
QueryMetadataUtil now uses SimpleMetadataResultSet.of() instead of Avatica-based constructors, and type mappings were updated to use standard JDBCType instead of Avatica's SqlType enum.

@carsheng carsheng force-pushed the csheng/avatica-removal branch from 4bd32a0 to 40ea34f Compare November 13, 2025 00:45
@carsheng carsheng changed the title Csheng/avatica removal Avatical Removal Part1: remove Avatica dependency from metadata conversion flow Nov 14, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 83.65180% with 77 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.34%. Comparing base (f8d84ab) to head (6bae705).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...datacloud/jdbc/core/resultset/SimpleResultSet.java 73.07% 13 Missing and 15 partials ⚠️
...core/resultset/ResultSetWithPositionalGetters.java 35.29% 22 Missing ⚠️
...e/datacloud/jdbc/core/SimpleMetadataResultSet.java 76.78% 7 Missing and 6 partials ⚠️
...ud/jdbc/core/metadata/SimpleResultSetMetaData.java 85.36% 3 Missing and 3 partials ⚠️
...alesforce/datacloud/jdbc/core/MetadataSchemas.java 95.45% 2 Missing ⚠️
...esforce/datacloud/jdbc/core/QueryMetadataUtil.java 92.30% 2 Missing ⚠️
...force/datacloud/jdbc/core/metadata/ColumnType.java 92.30% 1 Missing and 1 partial ⚠️
...loud/jdbc/core/resultset/ForwardOnlyResultSet.java 87.50% 1 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (83.65%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #136      +/-   ##
============================================
- Coverage     82.79%   82.34%   -0.46%     
- Complexity     1347     1549     +202     
============================================
  Files           111      117       +6     
  Lines          4058     4328     +270     
  Branches        413      442      +29     
============================================
+ Hits           3360     3564     +204     
- Misses          508      549      +41     
- Partials        190      215      +25     
Components Coverage Δ
JDBC Core 83.32% <83.65%> (-0.67%) ⬇️
JDBC Main 40.69% <ø> (ø)
JDBC HTTP 91.09% <ø> (ø)
JDBC Utilities 66.07% <ø> (ø)
Spark Datasource ∅ <ø> (∅)
Files with missing lines Coverage Δ
.../datacloud/jdbc/core/resultset/ColumnAccessor.java 100.00% <100.00%> (ø)
...tacloud/jdbc/core/resultset/ReadOnlyResultSet.java 100.00% <100.00%> (ø)
...e/datacloud/jdbc/util/ArrowToColumnTypeMapper.java 62.26% <100.00%> (ø)
...com/salesforce/datacloud/jdbc/util/ArrowUtils.java 84.44% <ø> (+0.31%) ⬆️
...alesforce/datacloud/jdbc/core/MetadataSchemas.java 95.45% <95.45%> (ø)
...esforce/datacloud/jdbc/core/QueryMetadataUtil.java 91.45% <92.30%> (-0.18%) ⬇️
...force/datacloud/jdbc/core/metadata/ColumnType.java 88.75% <92.30%> (ø)
...loud/jdbc/core/resultset/ForwardOnlyResultSet.java 87.50% <87.50%> (ø)
...ud/jdbc/core/metadata/SimpleResultSetMetaData.java 85.36% <85.36%> (ø)
...e/datacloud/jdbc/core/SimpleMetadataResultSet.java 76.78% <76.78%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@carsheng carsheng force-pushed the csheng/avatica-removal branch from 282e5d0 to d56d810 Compare November 24, 2025 22:37
@carsheng carsheng force-pushed the csheng/avatica-removal branch 4 times, most recently from 2d45c7c to c28d02a Compare December 18, 2025 02:30
@KaviarasuSakthivadivel
Copy link
Contributor

I believe these will improve coverage:

  1. Add tests for ResultSetWithPositionalGetters string-based accessors
  2. Test all type conversion edge cases in SimpleResultSet
  3. Add negative test cases (closed ResultSet, invalid columns, null data)

KaviarasuSakthivadivel added a commit that referenced this pull request Mar 6, 2026
Bug: getTableTypes() was returning Map.toString() output instead of
table type names, violating the JDBC specification.

Root Cause: QueryMetadataUtil.constructTableTypesData() was using
entry.getValue() (Map<String,String>) instead of entry.getKey() (String).

Changes:
- Fix QueryMetadataUtil.java:320 - changed entry.getValue() to entry.getKey()
- Add test testGetTableTypesReturnsActualData() to verify correct behavior

Before fix:
  getString("TABLE_TYPE") returned:
  "{SCHEMAS=c.relkind = 'r' AND..., NOSCHEMAS=...}"

After fix:
  getString("TABLE_TYPE") returns:
  "TABLE", "VIEW", "INDEX", etc.

Impact:
- Fixes JDBC specification compliance
- Enables proper database tool integration (DBeaver, IntelliJ, etc.)
- Makes metadata introspection usable

Discovered during PR #136 review.
KaviarasuSakthivadivel added a commit that referenced this pull request Mar 9, 2026
Bug: getTableTypes() was returning Map.toString() output instead of
table type names, violating the JDBC specification.

Root Cause: QueryMetadataUtil.constructTableTypesData() was using
entry.getValue() (Map<String,String>) instead of entry.getKey() (String).

Changes:
- Fix QueryMetadataUtil.java:320 - changed entry.getValue() to entry.getKey()
- Add test testGetTableTypesReturnsActualData() to verify correct behavior

Before fix:
  getString("TABLE_TYPE") returned:
  "{SCHEMAS=c.relkind = 'r' AND..., NOSCHEMAS=...}"

After fix:
  getString("TABLE_TYPE") returns:
  "TABLE", "VIEW", "INDEX", etc.

Impact:
- Fixes JDBC specification compliance
- Enables proper database tool integration (DBeaver, IntelliJ, etc.)
- Makes metadata introspection usable

Discovered during PR #136 review.
@carsheng carsheng force-pushed the csheng/avatica-removal branch from ac6637a to db2c660 Compare March 11, 2026 17:43
@carsheng carsheng merged commit 481096a into main Mar 11, 2026
9 of 13 checks passed
@carsheng carsheng deleted the csheng/avatica-removal branch March 11, 2026 18:30
KaviarasuSakthivadivel added a commit that referenced this pull request Mar 11, 2026
Bug: getTableTypes() was returning Map.toString() output instead of
table type names, violating the JDBC specification.

Root Cause: QueryMetadataUtil.constructTableTypesData() was using
entry.getValue() (Map<String,String>) instead of entry.getKey() (String).

Changes:
- Fix QueryMetadataUtil.java:320 - changed entry.getValue() to entry.getKey()
- Add test testGetTableTypesReturnsActualData() to verify correct behavior

Before fix:
  getString("TABLE_TYPE") returned:
  "{SCHEMAS=c.relkind = 'r' AND..., NOSCHEMAS=...}"

After fix:
  getString("TABLE_TYPE") returns:
  "TABLE", "VIEW", "INDEX", etc.

Impact:
- Fixes JDBC specification compliance
- Enables proper database tool integration (DBeaver, IntelliJ, etc.)
- Makes metadata introspection usable

Discovered during PR #136 review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants