Skip to content

Conversation

@eric-wang-1990
Copy link
Contributor

@eric-wang-1990 eric-wang-1990 commented Jun 11, 2025

Description

This PR enhances the C# implementation of GetColumnsExtended by:

  1. Adding FK_NAME and KEQ_SEQ fields to the foreign key fields array
  2. Improving type handling in the relationship data processing to properly handle non-string types like Int32
  3. Preserving original field types from the source schema in the extended results
  4. Removing unnecessary underscore escaping in GetCrossReferenceAsForeignTableAsync since these are exact match queries
  5. Adding schema validation tests for the extended column metadata
  6. Fix the empty foreign key result set name Key_seq to Keq_seq

Rationale

These changes ensure that all necessary foreign key relationship information is available to clients and that the data types are properly preserved when processing relationship data. The additional fields (FK_NAME and KEQ_SEQ) provide important context about foreign key constraints.

Testing

  • Enhanced existing tests to validate the schema of the GetColumnsExtended result
  • Verified proper type handling for both string and integer fields
  • Manually tested with Hive and Databricks connections

@github-actions github-actions bot added this to the ADBC Libraries 19 milestone Jun 11, 2025
@eric-wang-1990 eric-wang-1990 changed the title fix(csharp): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling fix(csharp/src/drivers/apache): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling Jun 11, 2025
@eric-wang-1990 eric-wang-1990 changed the title fix(csharp/src/drivers/apache): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling fix(csharp/src/drivers): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling Jun 11, 2025
@eric-wang-1990 eric-wang-1990 changed the title fix(csharp/src/drivers): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling fix(csharp/src/Drivers): Add FK_NAME and KEQ_SEQ fields to GetColumnsExtended and improve type handling Jun 12, 2025
Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

new Field("KEY_SEQ", Int16Type.Default, true),
new Field("UPDATE_RULE", Int16Type.Default, true),
new Field("DELETE_RULE", Int16Type.Default, true),
new Field("KEQ_SEQ", Int32Type.Default, true),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This column name will never not make me crack up while simultaneously saddening me :/.

@CurtHagenlocher CurtHagenlocher merged commit f5ee01e into apache:main Jun 19, 2025
6 of 8 checks passed
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.

2 participants