Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16440#discussion_r94284313
  
    --- 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 --
    
    I suppose I'm asking, why is this an improvement? because in the new 
version, you also buffer the whole result into memory locally.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to