Skip to content

GH-46087: [FlightSQL] Allow returning column remarks in FlightSQL's CommandGetTables - #46110

Merged
lidavidm merged 6 commits into
apache:mainfrom
mateuszrzeszutek:remarks
May 3, 2025
Merged

GH-46087: [FlightSQL] Allow returning column remarks in FlightSQL's CommandGetTables#46110
lidavidm merged 6 commits into
apache:mainfrom
mateuszrzeszutek:remarks

Conversation

@mateuszrzeszutek

@mateuszrzeszutekmateuszrzeszutek commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Resolves#46087

Rationale for this change

FlightSQL allows returning various column metadata in CommandGetTables, but one thing that's missing is human-readable column description. This PR proposes adding a new ARROW:FLIGHT:SQL:REMARKS metadata property taht will contain a comment describing a column. This is inspired by JDBC's DatabaseMetaData#getColumns() method, and later on I'm planning on adding this change to arrow-java as well.

What changes are included in this PR?

  • A new column metadata property ARROW:FLIGHT:SQL:REMARKS
  • C++ ColumnMetadata implementation

Please tell me if there's anything else in the other languages that I should add.

Are these changes tested?

Covered by existing tests; no new test cases added.

Are there any user-facing changes?

Yes, a couple new constants/methods added to the ColumnMetadata class and its builder

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #46087has been automatically assigned in GitHub to PR creator.

@raulcd

Copy link
Copy Markdown
Member

macOS 13 and MinGW failures are unrelated and failing on other PRs. See:

@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

Looks like the integration tests have failed on the C++ vs Go/Java comparison:

 panic: expected: schema:
fields: 1
- id: type=int64, nullable
metadata: ["ARROW:FLIGHT:SQL:TABLE_NAME": "test", "ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT": "1", "ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE": "0", "ARROW:FLIGHT:SQL:TYPE_NAME": "type_test", "ARROW:FLIGHT:SQL:SCHEMA_NAME": "schema_test", "ARROW:FLIGHT:SQL:IS_SEARCHABLE": "1", "ARROW:FLIGHT:SQL:CATALOG_NAME": "catalog_test", "ARROW:FLIGHT:SQL:PRECISION": "100"], got: schema:
fields: 1
- id: type=int64, nullable
metadata: ["ARROW:FLIGHT:SQL:TABLE_NAME": "test", "ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT": "1", "ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE": "0", "ARROW:FLIGHT:SQL:TYPE_NAME": "type_test", "ARROW:FLIGHT:SQL:SCHEMA_NAME": "schema_test", "ARROW:FLIGHT:SQL:IS_SEARCHABLE": "1", "ARROW:FLIGHT:SQL:CATALOG_NAME": "catalog_test", "ARROW:FLIGHT:SQL:PRECISION": "100", "ARROW:FLIGHT:SQL:REMARKS": "test column"]

I've reverted the changes to the integration test code here.
I assume there's a dependency between this repo and arrow-go/arrow-java -- should they be updated in some sort of order? Or should the assertions in the other repos be relaxed first?

@mateuszrzeszutek
mateuszrzeszutekforce-pushed the remarks branch 3 times, most recently from 81b10b6 to 4bd6cf8CompareApril 17, 2025 11:38
@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

Hey @lidavidm , any chance you can take a look at this PR?

@lidavidm

Copy link
Copy Markdown
Member

I believe if we want to add this to the spec we should have implementations in at least one other language (preferably both Go/Java if possible, though) and vote on it, as trivial as it is

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The proposal itself seems reasonable, though

Comment threadformat/FlightSql.proto Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: maybe "An explanatory comment" or something (following the JDBC documentation)? Or was this meant to say "A comment describing the column"?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yup, sorry for the typo -- I changed that to "A comment describing the column"

@github-actionsgithub-actionsBot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Apr 22, 2025
@github-actionsgithub-actionsBot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Apr 23, 2025
@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

I believe if we want to add this to the spec we should have implementations in at least one other language (preferably both Go/Java if possible, though) and vote on it, as trivial as it is

Sure, makes sense 👍 . I'll work on the draft PRs and post links here.

@lidavidm

Copy link
Copy Markdown
Member

CC @zeroshade, I assume no objections :)

@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

@lidavidm here's the draft implementation for Java apache/arrow-java#727
I'll prepare a PR for Go as well

@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

And here's the Go PR: apache/arrow-go#361

Comment threadformat/FlightSql.proto Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One thing that I was thinking about, though, should we note that this field was added after the others and clients should be prepared to find it missing?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done

@lidavidm

Copy link
Copy Markdown
Member

Thanks for the PRs. They look reasonable to me. I'd like to let zeroshade take a look and then we can call a vote.

@github-actionsgithub-actionsBot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Apr 25, 2025

@zeroshadezeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No objections from me here. I'll review the Go PR, but I'd say we can move forward with a vote.

@github-actionsgithub-actionsBot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Apr 25, 2025
@lidavidm

Copy link
Copy Markdown
Member

Ah, should we restore the integration test as well? We've required that for votes before. It's OK if it's failing for now. As long as the test is present we can vote and then we can merge the PRs in order.

@mateuszrzeszutek

Copy link
Copy Markdown
ContributorAuthor

It's OK if it's failing for now. As long as the test is present we can vote and then we can merge the PRs in order.

Okay -- I'll add the changes needed to make the tests work to the Java/Go PRs as well

@lidavidm

Copy link
Copy Markdown
Member

Thanks - vote in progress

@singh1203singh1203 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM here.
Thank you!

Comment threadcpp/src/arrow/flight/sql/column_metadata.h Outdated
@lidavidm

Copy link
Copy Markdown
Member

I've closed the vote.

In terms of how to merge this, I think we can merge Go/Java first, then if we rebase here, the integration tests should pass?

@mateuszrzeszutek

mateuszrzeszutek commented May 2, 2025

Copy link
Copy Markdown
ContributorAuthor

In terms of how to merge this, I think we can merge Go/Java first, then if we rebase here, the integration tests should pass?

Sounds good to me 👍

Both Java and Go PRs are ready to review, PTAL at them 🙏

zeroshade pushed a commit to apache/arrow-go that referenced this pull request May 2, 2025
…ommandGetTables (#361)
### Rationale for this change
See apache/arrow#46110
### What changes are included in this PR?
A new column metadata value
### Are these changes tested?
No; there seem to be no tests that'd verify that `ColumnMetadata` works;
should I add unit tests specifically for the new methods?
### Are there any user-facing changes?
Yes, two new methods
lidavidm pushed a commit to apache/arrow-java that referenced this pull request May 3, 2025
…mandGetTables (#727)
Resolves#737 ## What's Changed
This is an implementation of
apache/arrow#46110 for Java
@lidavidm

Copy link
Copy Markdown
Member

Go/Java merged. Re-running integration here.

@lidavidm

Copy link
Copy Markdown
Member

it passes!

@lidavidm
lidavidm merged commit 2bb5fd5 into apache:mainMay 3, 2025
@lidavidmlidavidm removed the awaiting merge Awaiting merge label May 3, 2025
@lidavidm

Copy link
Copy Markdown
Member

Thanks @mateuszrzeszutek!

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 2bb5fd5.

There were 6 benchmark results indicating a performance regression:

The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.

jmao-denver pushed a commit to jmao-denver/dh-flight-sql-jdbc that referenced this pull request Aug 5, 2025
…mandGetTables (#727)
Resolves #737 ## What's Changed
This is an implementation of
apache/arrow#46110 for Java
timhurskidremio pushed a commit to timhurskidremio/dremio-arrow-java that referenced this pull request Dec 5, 2025
…'s CommandGetTables (apache#727)
Resolvesapache#737 ## What's Changed
This is an implementation of
apache/arrow#46110 for Java
timhurskidremio pushed a commit to timhurskidremio/dremio-arrow-java that referenced this pull request Feb 25, 2026
…'s CommandGetTables (apache#727)
Resolvesapache#737 ## What's Changed
This is an implementation of
apache/arrow#46110 for Java
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FlightSQL] Allow returning column remarks in FlightSQL's CommandGetTables

5 participants

@mateuszrzeszutek@raulcd@lidavidm@zeroshade@singh1203