-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
OGR SQL: add SELECT expression [AS] OGR_STYLE HIDDEN to be able to specify feature style string without generating a visible column #10260
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rouault
force-pushed
the
fix_10259
branch
5 times, most recently
from
June 20, 2024 22:38
59a0b07
to
7619587
Compare
dbaston
approved these changes
Jun 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having some config option (OGR_STYLE_HIDDEN=YES) read by OGRGenSQLResultsLayer to do the same
This seems the simplest to me, but the argument about adding the same behavior for FID is a good one.
rouault
force-pushed
the
fix_10259
branch
3 times, most recently
from
June 21, 2024 17:48
c949a85
to
1636ccb
Compare
…ecify feature style string without generating a visible column This is a bit inspired by the HIDDEN keyword used by some other SQL implementations, but generally in other contexts, such as hidden columns in SQLite3 virtual tables (https://www.sqlite.org/vtab.html) or MySQL invisible columns (https://dev.mysql.com/doc/refman/8.4/en/invisible-columns.html), although those are in a CREATE TABLE context. Fixes OSGeo#10259
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a bit inspired by the HIDDEN keyword used by some other SQL implementations, but generally in other contexts, such as hidden columns in SQLite3 virtual tables (https://www.sqlite.org/vtab.html) or MySQL invisible columns (https://dev.mysql.com/doc/refman/8.4/en/invisible-columns.html), although those are in a CREATE TABLE context.
Fixes #10259
@elpaso / @dbaston opinions?
Other alternatives I considered by decreasing order of appeal:
One downside of the implementation is that it makes 'HIDDEN' a reserved keyword, so any field/table with that name must now be quoted, although I could probably tune the BNF to accept 'HIDDEN' as an identifier as I don't think there would be grammar ambiguity in doing so (to be tested...)
I finally selected the HIDDEN SQL keyword because we might potentially use it for other situations (potentially to do things like "SELECT my_id_field AS FID HIDDEN, ..." to set the FID (we can currently select the source fid with SELECT FID ... but not set it)