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.
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
[SPARK-50666][SQL] Support hint for reading in JDBC data source #49564
[SPARK-50666][SQL] Support hint for reading in JDBC data source #49564
Changes from all commits
a2d155c
dcedc73
2c129ef
601e9e5
fb1dd05
86c3cdc
1c0f321
e6ba856
3a79c12
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@beliefer I made a check here, and I think the string judgment of the url in
JDBCOptions
is hard-coded.In the current way, if we want to add a new JDBCDialect to support hint, we only need to rewrite the
supportsHint
attribute.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.
We can fix it in this way
https://github.com/apache/spark/pull/49564/files#r1929762553
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.
Should we leave a blank between
hintClause
andcolumnList
?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.
The reason why I don't add a space here is because if the hint is "", for other JDBCDialects that do not support hints, there will be one more space here than before. But for normal hints, when processing the hint content in
JDBCOptions
, a space has been added at the end.s"$value "
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.
The other parts of selectStmt inserts extra space as well. The underlying database can treat these spaces.
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.
Ur, @beliefer . I'd prefer not to add a space with a different reason.
The reason is that HINT is very exceptional use cases. I believe 99% queries will not have this hint option. And, we don't want to add an extra space into our SELECT statement here. It's a kind of regression without any benefit.
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.
Maybe, we want to inject a space only if HINT exists as an alternative if we want to space, @beliefer . To be clear, I just want to avoid case (1) and not against (3).
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.
Yes, that's my purpose. Only add a space at the end when hint is not empty.
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.
@dongjoon-hyun I agree on. Let's check if the hint is not empty.