fix(csharp): set BUFFER_LENGTH to null in GetColumns result; re-enable CanGetColumnsExtended for SEA (PECO-3008)#444
Open
eric-wang-1990 wants to merge 2 commits intomainfrom
Conversation
…e-enable CanGetColumnsExtended for SEA (PECO-3008) JDBC spec defines BUFFER_LENGTH as unused — it should always be null. FlatColumnsResultBuilder was computing non-null values for numeric types (INT=4, BIGINT=8, etc.) via ColumnMetadataHelper.GetBufferLength, causing CanGetColumnsExtended to fail for the SEA three-calls fallback path while Thrift (which reads directly from the server and returns null) passed. CreateExtendedColumnsResult (DESC TABLE EXTENDED path) already returned null unconditionally; this change makes FlatColumnsResultBuilder consistent. Removes the Skip.If(Protocol == "rest") guard from CanGetColumnsExtended. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CanGetColumnsExtendedwas skipped for SEA (Skip.If(Protocol == "rest")) because the SEA path returned differentBUFFER_LENGTHvalues than Thrift.Root cause:
FlatColumnsResultBuilder(used by the three-calls fallback path viaGetColumnsAsync) calledColumnMetadataHelper.GetBufferLengthwhich returned non-null values for numeric types (BOOLEAN=1, TINYINT=1, SMALLINT=2, INT=4, FLOAT=4, BIGINT=8, DOUBLE=8, TIMESTAMP=8, DATE=8, DECIMAL=computed). The expected test values and the Thrift path both returnnullfor all columns.The JDBC spec defines
BUFFER_LENGTHas an unused column — it should always benull.CreateExtendedColumnsResult(theDESC TABLE EXTENDEDpath) already returnednullunconditionally viabufferLengthBuilder.AppendNull().FlatColumnsResultBuilderwas inconsistent.Changes
FlatColumnsResultBuilder: replace theGetBufferLengthcall withAppendNull(), makingBUFFER_LENGTHconsistently null across all result paths (matchingCreateExtendedColumnsResultand Thrift).StatementTests.cs: remove theSkip.If(Protocol == "rest")guard fromCanGetColumnsExtended.Test Plan
CanGetColumnsExtendednow runs for both Thrift and SEA protocols, covering bothuseDescTableExtended=trueanduseDescTableExtended=false.Fixes PECO-3008
🤖 Generated with Claude Code