Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 15, 2016

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.

@ghost
Copy link
Author

ghost commented Jul 15, 2016

@liancheng hey, please help review (BTW are you the lian cheng from MSTC zju?)

@ericl
Copy link
Contributor

ericl commented Jul 20, 2016

@alicegugu could you add a unit test for this? I think there are some for the thrift server already in HiveThriftServer2Suites.

@ghost
Copy link
Author

ghost commented Aug 7, 2016

@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)
Copy link
Contributor

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?

@ericl
Copy link
Contributor

ericl commented Aug 7, 2016

Lgtm, just some comments on the tests

@ghost
Copy link
Author

ghost commented Aug 8, 2016

@ericl thanks for the comments, comments incorporated in new commit

@ericl
Copy link
Contributor

ericl commented Aug 8, 2016

Lgtm

@rxin
Copy link
Contributor

rxin commented Aug 8, 2016

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Aug 8, 2016

Test build #3209 has finished for PR 14218 at commit 1ba8910.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Aug 9, 2016

Merging in master/branch-2.0.

asfgit pushed a commit that referenced this pull request Aug 9, 2016
## 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>
@asfgit asfgit closed this in e17a76e Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants