eric-wang-1990 opened a new pull request, #2886:
URL: https://github.com/apache/arrow-adbc/pull/2886

   ## Arrow ADBC: Primary Key and Foreign Key Metadata Optimization
   
   ### Description
   
   This PR adds support for optimizing Primary Key and Foreign Key metadata 
queries in the C# Databricks ADBC driver. It introduces a new connection 
parameter `adbc.databricks.enable_pk_fk` that allows users to control whether 
the driver should make PK/FK metadata calls to the server or return empty 
results for improved performance.
   
   ### Background
   
   Primary Key and Foreign Key metadata queries can be expensive operations, 
particularly in Databricks environments where they may not be fully supported 
in certain catalogs. This implementation provides a way to optimize these 
operations by:
   
   1. Allowing users to disable PK/FK metadata calls entirely via configuration
   2. Automatically returning empty results for legacy catalogs (SPARK, 
hive_metastore) where PK/FK metadata is not supported
   3. Ensuring that empty results maintain schema compatibility with real 
metadata responses
   
   ### Proposed Changes
   
   - Add new connection parameter `adbc.databricks.enable_pk_fk` to control 
PK/FK metadata behavior (default: true)
   - Implement special handling for legacy catalogs (SPARK, hive_metastore) to 
return empty results without server calls
   - Modify method visibility in base classes to allow proper overriding in 
derived classes
   - Add comprehensive test coverage for the new functionality
   
   ### How is this tested?
   
   Added unit tests that verify:
   1. The correct behavior of the `ShouldReturnEmptyPkFkResult` method with 
various combinations of settings
   2. Schema compatibility between empty results and real metadata responses
   3. Proper handling of different catalog scenarios
   
   These tests ensure that the optimization works correctly while maintaining 
compatibility with client applications that expect consistent schema structures.


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to