[BugFix] fix arrow flight empty set column name is 'r'#71534
Conversation
bbaf8ae to
7889511
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7889511be5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7889511 to
1e276ea
Compare
Signed-off-by: SevenJ <wenjun7j@gmail.com>
1e276ea to
1d952a6
Compare
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 31 / 32 (96.88%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
There was a problem hiding this comment.
Pull request overview
This PR fixes Arrow Flight SQL createPreparedStatement returning a placeholder column name (e.g., "r") for queries that produce empty result sets, by deriving and returning the analyzed output schema (column names/types) instead of a hard-coded placeholder.
Changes:
- Update
createPreparedStatementto analyze query statements and build an ArrowSchemafrom analyzed output expressions. - Add placeholder-schema fallback for non-query statements / analysis failures.
- Extend unit tests to validate analyzed schema output, fallback behavior, and that
ConnectContextthread-local state is restored.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
fe/fe-core/src/main/java/com/starrocks/service/arrow/flight/sql/ArrowFlightSqlServiceImpl.java |
Build prepared-statement dataset schema from analyzed query output instead of returning a placeholder "r" schema. |
fe/fe-core/src/test/java/com/starrocks/service/arrow/flight/sql/ArrowFlightSqlServiceImplTest.java |
Add tests asserting prepared-statement schema matches analyzed columns/types and that thread-local ConnectContext is restored. |
|
@Mergifyio backport branch-4.1 |
|
@Mergifyio backport branch-4.0 |
✅ Backports have been createdDetails
|
✅ Backports have been createdDetails
Cherry-pick of 2535348 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348)
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/service/arrow/flight/sql/ArrowFlightSqlServiceImpl.java
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348)
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348)
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348) Signed-off-by: SevenJ <wenjun7j@gmail.com>
Signed-off-by: SevenJ <wenjun7j@gmail.com> (cherry picked from commit 2535348) Signed-off-by: SevenJ <wenjun7j@gmail.com>
…) (#71736) Signed-off-by: SevenJ <wenjun7j@gmail.com>
…) (#71735) Signed-off-by: SevenJ <wenjun7j@gmail.com>
…) (#71632) Signed-off-by: SevenJ <wenjun7j@gmail.com> Co-authored-by: SevenJ <166966490+Wenjun7J@users.noreply.github.com>
Why I'm doing:
For query return empty set, like
select * from table.t1 limit 0, this will return column name'r' , 'r'.The column name is set as 'r' to be a placeholder. But if no data arrived, the jdbc driver will not replace it with correct names.
What I'm doing:
Print the correct column schema. But the jdbc driver still has a bug and will return double column names. apache/arrow-java#44
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: