Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GEOT-7230] Implement a HINT parameter as part of the HANA plug-in #4064

Merged
merged 3 commits into from Oct 21, 2022
Merged

[GEOT-7230] Implement a HINT parameter as part of the HANA plug-in #4064

merged 3 commits into from Oct 21, 2022

Conversation

stefanuhrig
Copy link
Contributor

@stefanuhrig stefanuhrig commented Oct 17, 2022

GEOT-7230 Powered by Pull Request Badge

This pull request adds a new "SELECT Hint" parameter to the HANA JDBC plugin.

SELECT Hints are appended to SELECT queries, embedded in the string

        WITH HINT( <SELECT Hints> )

Setting SELECT Hints enables a user to configure HANA specific query hints that will be considered during query plan generation.

Checklist

For core and extension modules:

  • New unit tests have been added covering the changes.
  • Documentation has been updated (if change is visible to end users).
  • There is an issue in GeoTools Jira (except for changes not visible to end users).
  • Commit message(s) must be in the form [GEOT-XYZW] Title of the Jira ticket.
  • Bug fixes and small new features are presented as a single commit.
  • The commit targets a single objective (if multiple focuses cannot be avoided, each one is in its own commit, and has a separate ticket describing it).

This change adds a new "SELECT Hint" parameter to the HANA JDBC plugin.

"SELECT Hint"s are appended to SELECT queries, embedded in the string

    WITH HINT( <SELECT Hints> )

Setting SELECT Hints enables a user to configure HANA specific query
hints that will be considered during query plan generation.
String.class,
"Comma-separated list of hints that will be applied to SELECT queries, e.g. ESTIMATION_SAPLES(0), NO_HASH_JOIN",
false,
null,
Copy link

Choose a reason for hiding this comment

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

In the documentation it says the fifth parameter is for example input. Should be put ESTIMATION_SAMPLES(0) and NO_HASH_JOIN in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially did this, but then realized that the GeoServer connection dialog uses the sample to pre-populate the textbox. Hence, I reverted it to null.

new Param(
"SELECT Hints",
String.class,
"Comma-separated list of hints that will be applied to SELECT queries, e.g. ESTIMATION_SAPLES(0), NO_HASH_JOIN",
Copy link

Choose a reason for hiding this comment

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

Is there an M missing in ESTIMATION_SAPLES(0)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, fixed it.

@stefanuhrig stefanuhrig merged commit e61ed86 into geotools:main Oct 21, 2022
@geoserver-bot
Copy link
Collaborator

The backport to 28.x failed:

The process '/usr/bin/git' failed with exit code 128
stderr
error: commit 02e8192e63c9b71e8fd4ca013429d8ffe4c4474c is a merge but no -m option was given.
fatal: cherry-pick failed

stdout
Auto-merging modules/plugin/jdbc/jdbc-hana/src/main/java/org/geotools/data/hana/HanaDialect.java
[backport-4064-to-28.x e1bb602eaf] [GEOT-7230] Implement a HINT parameter as part of the HANA plug-in
 Author: Stefan Uhrig <stefan.uhrig@sap.com>
 Date: Thu Oct 13 17:29:43 2022 +0200
 5 files changed, 149 insertions(+), 32 deletions(-)
 create mode 100644 modules/plugin/jdbc/jdbc-hana/src/test/java/org/geotools/data/hana/HanaSelectHintOnlineTest.java

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-28.x 28.x
# Navigate to the new working tree
cd .worktrees/backport-28.x
# Create a new branch
git switch --create backport-4064-to-28.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 0f98e73346b98a67dd2e0acf596b79982eae7471,02e8192e63c9b71e8fd4ca013429d8ffe4c4474c,ffc51f5c06535fef254993138cf336975774d308
# Push it to GitHub
git push --set-upstream origin backport-4064-to-28.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-28.x

Then, create a pull request where the base branch is 28.x and the compare/head branch is backport-4064-to-28.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants