Repository: spark
Updated Branches:
  refs/heads/master 490ecfa20 -> 21a95ef05


[SPARK-2590][SQL] Added option to handle incremental collection, disabled by 
default

JIRA issue: [SPARK-2590](https://issues.apache.org/jira/browse/SPARK-2590)

Author: Cheng Lian <[email protected]>

Closes #1853 from liancheng/inc-collect-option and squashes the following 
commits:

cb3ea45 [Cheng Lian] Moved incremental collection option to Thrift server
43ce3aa [Cheng Lian] Changed incremental collect option name
623abde [Cheng Lian] Added option to handle incremental collection, disabled by 
default


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/21a95ef0
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/21a95ef0
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/21a95ef0

Branch: refs/heads/master
Commit: 21a95ef051f7b23a80d147aadb00dfa4ebb169b0
Parents: 490ecfa
Author: Cheng Lian <[email protected]>
Authored: Mon Aug 11 20:08:06 2014 -0700
Committer: Michael Armbrust <[email protected]>
Committed: Mon Aug 11 20:08:06 2014 -0700

----------------------------------------------------------------------
 .../thriftserver/server/SparkSQLOperationManager.scala   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/21a95ef0/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
 
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
index dee0921..f192f49 100644
--- 
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
+++ 
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
@@ -132,7 +132,16 @@ class SparkSQLOperationManager(hiveContext: HiveContext) 
extends OperationManage
           logDebug(result.queryExecution.toString())
           val groupId = round(random * 1000000).toString
           hiveContext.sparkContext.setJobGroup(groupId, statement)
-          iter = result.queryExecution.toRdd.toLocalIterator
+          iter = {
+            val resultRdd = result.queryExecution.toRdd
+            val useIncrementalCollect =
+              hiveContext.getConf("spark.sql.thriftServer.incrementalCollect", 
"false").toBoolean
+            if (useIncrementalCollect) {
+              resultRdd.toLocalIterator
+            } else {
+              resultRdd.collect().iterator
+            }
+          }
           dataTypes = 
result.queryExecution.analyzed.output.map(_.dataType).toArray
           setHasResultSet(true)
         } catch {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to