-
Notifications
You must be signed in to change notification settings - Fork 141
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
Bug Fix: Escape query in spark submit parameter #2587
Bug Fix: Escape query in spark submit parameter #2587
Conversation
Signed-off-by: Sean Kao <[email protected]>
6b2ff02
to
24a23fe
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2587 +/- ##
=========================================
Coverage 95.36% 95.36%
Complexity 5129 5129
=========================================
Files 490 490
Lines 14419 14420 +1
Branches 966 966
=========================================
+ Hits 13751 13752 +1
Misses 643 643
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sean Kao <[email protected]>
spark/src/main/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParameters.java
Show resolved
Hide resolved
spark/src/test/java/org/opensearch/sql/spark/asyncquery/model/SparkSubmitParametersTest.java
Show resolved
Hide resolved
Signed-off-by: Sean Kao <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.x
# Create a new branch
git switch --create backport/backport-2587-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2bcf0b8b3371558a60200c8b994ee6de64ddcf6e
# Push it to GitHub
git push --set-upstream origin backport/backport-2587-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.13 2.13
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.13
# Create a new branch
git switch --create backport/backport-2587-to-2.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 2bcf0b8b3371558a60200c8b994ee6de64ddcf6e
# Push it to GitHub
git push --set-upstream origin backport/backport-2587-to-2.13
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.13 Then, create a pull request where the |
) * escape query in spark submit parameter Signed-off-by: Sean Kao <[email protected]> * spotless Signed-off-by: Sean Kao <[email protected]> * test case for special character Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 2bcf0b8)
) * escape query in spark submit parameter Signed-off-by: Sean Kao <[email protected]> * spotless Signed-off-by: Sean Kao <[email protected]> * test case for special character Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 2bcf0b8)
) * escape query in spark submit parameter Signed-off-by: Sean Kao <[email protected]> * spotless Signed-off-by: Sean Kao <[email protected]> * test case for special character Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 2bcf0b8)
* escape query in spark submit parameter Signed-off-by: Sean Kao <[email protected]> * spotless Signed-off-by: Sean Kao <[email protected]> * test case for special character Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 2bcf0b8)
* escape query in spark submit parameter Signed-off-by: Sean Kao <[email protected]> * spotless Signed-off-by: Sean Kao <[email protected]> * test case for special character Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 2bcf0b8)
Description
Fix EMR spark submit parameter for batch FlintJob parsing issue when query contains quotes.
Ideally would like to test start job run in https://github.com/opensearch-project/sql/blob/main/spark/src/test/java/org/opensearch/sql/spark/client/EmrServerlessClientImplTest.java as well, but the AWSEMRServerless is mocked.
Manually ran end to end test connecting to a real EMR-S application for queries with nested quotes.
Example query:
This creates the index successfully.
The following tests special characters in a string get passed correctly.
Checking the logs, we see this printed as expected:
Issues Resolved
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.