-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16563][SQL] fix spark sql thrift server FetchResults bug #14218
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
Conversation
…ion FetchResults bug
|
@liancheng hey, please help review (BTW are you the lian cheng from MSTC zju?) |
|
@alicegugu could you add a unit test for this? I think there are some for the thrift server already in |
|
@ericl Hi Eric, two test cases are added for the code change. Please review. Thanks! |
| assertResult(0, "Repeat fetching result from next row") { | ||
|
|
||
| // Fetch first time | ||
| val rows = client.fetchResults(operationHandle) |
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.
Can you assert this also returns 5?
|
Lgtm, just some comments on the tests |
|
@ericl thanks for the comments, comments incorporated in new commit |
|
Lgtm |
|
Jenkins, test this please. |
|
Test build #3209 has finished for PR 14218 at commit
|
|
Merging in master/branch-2.0. |
## What changes were proposed in this pull request? Add a constant iterator which point to head of result. The header will be used to reset iterator when fetch result from first row repeatedly. JIRA ticket https://issues.apache.org/jira/browse/SPARK-16563 ## How was this patch tested? This bug was found when using Cloudera HUE connecting to spark sql thrift server, currently SQL statement result can be only fetched for once. The fix was tested manually with Cloudera HUE, With this fix, HUE can fetch spark SQL results repeatedly through thrift server. Author: Alice <alice.gugu@gmail.com> Author: Alice <guhq@garena.com> Closes #14218 from alicegugu/SparkSQLFetchResultsBug. (cherry picked from commit e17a76e) Signed-off-by: Reynold Xin <rxin@databricks.com>
What changes were proposed in this pull request?
Add a constant iterator which point to head of result. The header will be used to reset iterator when fetch result from first row repeatedly.
JIRA ticket https://issues.apache.org/jira/browse/SPARK-16563
How was this patch tested?
This bug was found when using Cloudera HUE connecting to spark sql thrift server, currently SQL statement result can be only fetched for once. The fix was tested manually with Cloudera HUE, With this fix, HUE can fetch spark SQL results repeatedly through thrift server.