Skip to content

GH-39558: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE, SQL_NULL_ORDERING and SQL_MAX_COLUMNS_IN_TABLE support to SqlInfoBuilder#39561

Merged
lidavidm merged 3 commits intoapache:mainfrom
thermo911:fix-sql-info-builder
Jan 12, 2024
Merged

GH-39558: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE, SQL_NULL_ORDERING and SQL_MAX_COLUMNS_IN_TABLE support to SqlInfoBuilder#39561
lidavidm merged 3 commits intoapache:mainfrom
thermo911:fix-sql-info-builder

Conversation

@thermo911
Copy link
Copy Markdown
Contributor

@thermo911 thermo911 commented Jan 11, 2024

This PR adds ability to specify SQL_ALL_TABLES_ARE_SELECTABLE and SQL_NULL_ORDERING metadata in org.apache.arrow.flight.sql.SqlInfoBuilder.

Rationale for this change

Without this change it is impossible to specify whether all tables are selectable, supported null ordering and maximum number of columns in table using SqlInfoBuilder.

What changes are included in this PR?

In this PR two methods are added to SqlInfoBuilder:

  • withSqlAllTablesAreSelectable accepting boolean parameter that specifies whether all tables are selectable
  • withSqlNullOrdering accepting org.apache.arrow.flight.sql.impl.FlightSql.SqlNullOrdering value that specifies supported null ordering
  • withSqlMaxColumnsInTable accepting long parameter that specifies maximum number of columns in table

Are these changes tested?

To ensure correctness org.apache.arrow.flight.TestFlightSql#testGetSqlInfoResultsWithManyArgs test is added).

Are there any user-facing changes?

This PR does not contain any breaking changes of user API.

@thermo911 thermo911 requested a review from lidavidm as a code owner January 11, 2024 10:17
@thermo911 thermo911 changed the title MINOR: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE and SQL_NULL_ORDERING support to SqlInfoBuilder GH-39558: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE and SQL_NULL_ORDERING support to SqlInfoBuilder Jan 11, 2024
@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 11, 2024
@thermo911 thermo911 changed the title GH-39558: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE and SQL_NULL_ORDERING support to SqlInfoBuilder GH-39558: [Java] Add SQL_ALL_TABLES_ARE_SELECTABLE, SQL_NULL_ORDERING and SQL_MAX_COLUMNS_IN_TABLE support to SqlInfoBuilder Jan 11, 2024
@github-actions
Copy link
Copy Markdown

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

@thermo911
Copy link
Copy Markdown
Contributor Author

BTW, it seems that not all methods in SqlInfoBuilder are tested. Is there any reason for that?

Copy link
Copy Markdown
Contributor Author

@thermo911 thermo911 left a comment

Choose a reason for hiding this comment

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

The changes are pretty simple.

Copy link
Copy Markdown
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

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.

Could you add, or file an issue for, generic methods to handle arbitrary metadata entries?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you give an example, please? Currently, SqlInfoBuilder has private methods like withEnumProvider, withBooleanProvider etc. used by public methods like withSqlAllTablesAreSelectable. Should API be extended with smth similar?

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.

Right, I think we could basically make those public or something similar, to give future users an escape hatch.

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.

(Of course, I appreciate that you took the time to file the PR and add actually-structured bindings still!)

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.

I'll merge this PR now though

@github-actions github-actions bot added awaiting merge Awaiting merge awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review awaiting merge Awaiting merge labels Jan 12, 2024
@lidavidm lidavidm merged commit 22b42b0 into apache:main Jan 12, 2024
@lidavidm lidavidm removed the awaiting changes Awaiting changes label Jan 12, 2024
@thermo911 thermo911 deleted the fix-sql-info-builder branch January 12, 2024 20:10
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 22b42b0.

There were no benchmark performance regressions. 🎉

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

dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…DERING and SQL_MAX_COLUMNS_IN_TABLE support to SqlInfoBuilder (apache#39561)

This PR adds ability to specify `SQL_ALL_TABLES_ARE_SELECTABLE` and `SQL_NULL_ORDERING` metadata in `org.apache.arrow.flight.sql.SqlInfoBuilder`.

### Rationale for this change

Without this change it is impossible to specify whether all tables are selectable, supported null ordering and maximum number of columns in table using `SqlInfoBuilder`.

### What changes are included in this PR?

In this PR two methods are added to `SqlInfoBuilder`:
- `withSqlAllTablesAreSelectable` accepting boolean parameter that specifies whether all tables are selectable
- `withSqlNullOrdering` accepting `org.apache.arrow.flight.sql.impl.FlightSql.SqlNullOrdering` value that specifies supported null ordering
- `withSqlMaxColumnsInTable` accepting long parameter that specifies maximum number of columns in table

### Are these changes tested?

To ensure correctness `org.apache.arrow.flight.TestFlightSql#testGetSqlInfoResultsWithManyArgs` test is added).

### Are there any user-facing changes?

This PR does not contain any breaking changes of user API.

* Closes: apache#39558

Authored-by: Alexander Blazhkov <ablazhkov@querifylabs.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
…DERING and SQL_MAX_COLUMNS_IN_TABLE support to SqlInfoBuilder (apache#39561)

This PR adds ability to specify `SQL_ALL_TABLES_ARE_SELECTABLE` and `SQL_NULL_ORDERING` metadata in `org.apache.arrow.flight.sql.SqlInfoBuilder`.

### Rationale for this change

Without this change it is impossible to specify whether all tables are selectable, supported null ordering and maximum number of columns in table using `SqlInfoBuilder`.

### What changes are included in this PR?

In this PR two methods are added to `SqlInfoBuilder`:
- `withSqlAllTablesAreSelectable` accepting boolean parameter that specifies whether all tables are selectable
- `withSqlNullOrdering` accepting `org.apache.arrow.flight.sql.impl.FlightSql.SqlNullOrdering` value that specifies supported null ordering
- `withSqlMaxColumnsInTable` accepting long parameter that specifies maximum number of columns in table

### Are these changes tested?

To ensure correctness `org.apache.arrow.flight.TestFlightSql#testGetSqlInfoResultsWithManyArgs` test is added).

### Are there any user-facing changes?

This PR does not contain any breaking changes of user API.

* Closes: apache#39558

Authored-by: Alexander Blazhkov <ablazhkov@querifylabs.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for free to 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.

[Java] SQL_ALL_TABLES_ARE_SELECTABLE, SQL_NULL_ORDERING, SQL_MAX_COLUMNS_IN_TABLE are not supported in SqlInfoBuilder

3 participants