You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "hkad98 (via GitHub)" <gi...@apache.org> on 2026/05/06 10:14:24 UTC

[PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

hkad98 opened a new pull request, #1135:
URL: https://github.com/apache/arrow-java/pull/1135

   ## Rationale
   
   `ArrowFlightStatement#executeFlightInfoQuery` appends the dataset schema columns to the statement's reused `Meta.Signature` without first clearing them, so the column list doubles on every invocation. When the `FlightInfo` has at least one endpoint, `ArrowFlightJdbcVectorSchemaRootResultSet#populateData` overwrites `signature.columns` from the actual stream schema and hides the duplication. With an empty endpoint list — the case reported by @mingnuj in the original issue against a Rust-based Flight SQL server, and independently reproducible against Denodo Express 9.4.2 — that overwrite never runs, and `ResultSetMetaData#getColumnCount()` reports `2× columnCount`. Calcite/Avatica then refuses the metadata with `Cannot have more columns with the same name`.
   
   This is a regression introduced in 15.0.0 by the prepared-statement parameter binding work in [GH-33475](https://github.com/apache/arrow/pull/38404), which made `handle.signature` mutable and shared across the `prepareAndExecute` → `executeFlightInfoQuery` path.
   
   ## Fix
   
   One line: `signature.columns.clear()` before the existing `addAll(...)`. The fresh schema returned at execute time is authoritative; pre-existing entries on the signature are stale by definition. This is exactly the workaround @mingnuj proposed in the issue and confirmed working.
   
   ## Test
   
   Adds `ResultSetMetadataTest#testShouldNotDuplicateColumnsWhenFlightInfoHasNoEndpoints` plus a `LEGACY_REGULAR_NO_ENDPOINTS_SQL_CMD` fixture in `CoreMockedSqlProducers` (registered with an empty result-provider list, so `getFlightInfoStatement` returns a `FlightInfo` with zero endpoints — the bug-triggering shape). The test asserts `getColumnCount() == 1`, fails on `main` with `Expected: <1> but was <2>`, and passes after the fix.
   
   `./gradlew`-equivalent run for this module:
   ```
   mvn -pl flight/flight-sql-jdbc-core test
   ```
   Result: 1234 tests run, 0 failures, 0 errors, 44 skipped.
   
   ## Cross-server reproductions
   
   The bug surfaces against any Flight SQL server that returns an empty endpoint list:
   - Rust-based server in @mingnuj's original report.
   - Denodo Express 9.4.2 (independent reproduction over JDBC).
   
   Wire-level the same `FlightInfo` is parsed correctly as 1 column by `pyarrow.flight`, by ADBC C++ / Python, and by Denodo's own native JDBC driver — only `flight-sql-jdbc-driver` 18.x / 19.0.0 doubles the column count, confirming the issue is Java-side.
   
   Closes #44.


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

Posted by "hkad98 (via GitHub)" <gi...@apache.org>.
hkad98 commented on PR #1135:
URL: https://github.com/apache/arrow-java/pull/1135#issuecomment-5422251809

   @lidavidm rebased.


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1135:
URL: https://github.com/apache/arrow-java/pull/1135#issuecomment-4387052271

   
   <!-- label_helper_comment -->
   Thank you for opening a pull request!
   
   Please label the PR with one or more of:
   
   - bug-fix
   - chore
   - dependencies
   - documentation
   - enhancement
   
   Also, add the 'breaking-change' label if appropriate.
   
   See [CONTRIBUTING.md](https://github.com/apache/arrow-java/blob/main/CONTRIBUTING.md) for details.
   


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #1135:
URL: https://github.com/apache/arrow-java/pull/1135


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

Posted by "weiqxu (via GitHub)" <gi...@apache.org>.
weiqxu commented on PR #1135:
URL: https://github.com/apache/arrow-java/pull/1135#issuecomment-4459176884

   I have meet the same issue. Is this fix be will merged?


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] GH-44: Clear signature columns before re-populating in ArrowFlightStatement#executeFlightInfoQuery [arrow-java]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #1135:
URL: https://github.com/apache/arrow-java/pull/1135#issuecomment-5403118278

   @hkad98 do you mind rebasing?


-- 
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-unsubscribe@arrow.apache.org

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