Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16440#discussion_r94389443
--- Diff:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
---
@@ -111,9 +115,15 @@ private[hive] class SparkExecuteStatementOperation(
// Reset iter to header when fetching start from first row
if (order.equals(FetchOrientation.FETCH_FIRST)) {
- val (ita, itb) = iterHeader.duplicate
- iter = ita
- iterHeader = itb
+ iter = if (useIncrementalCollect) {
+ resultList = None
+ result.toLocalIterator.asScala
+ } else {
+ if (resultList.isEmpty) {
--- End diff --
OK I believe I get it now. I see your approach and it makes sense.
The only real change here is that you hold on to a reference to the whole
data set here rather than `collect()` it into memory. Maybe that's the right
thing to do but that's the only thing I'm wondering about. Previously it seems
like it would `collect()` each time anyway?
Just wondering if that's actually simpler, to avoid keeping a reference to
the whole data set, or whether that defeats a purpose.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]