Skip to content

Commit cf2f807

Browse files
lianchengmarmbrus
authored andcommitted
[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 (cherry picked from commit 21a95ef) Signed-off-by: Michael Armbrust <[email protected]>
1 parent 8cb4e5b commit cf2f807

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,16 @@ class SparkSQLOperationManager(hiveContext: HiveContext) extends OperationManage
132132
logDebug(result.queryExecution.toString())
133133
val groupId = round(random * 1000000).toString
134134
hiveContext.sparkContext.setJobGroup(groupId, statement)
135-
iter = result.queryExecution.toRdd.toLocalIterator
135+
iter = {
136+
val resultRdd = result.queryExecution.toRdd
137+
val useIncrementalCollect =
138+
hiveContext.getConf("spark.sql.thriftServer.incrementalCollect", "false").toBoolean
139+
if (useIncrementalCollect) {
140+
resultRdd.toLocalIterator
141+
} else {
142+
resultRdd.collect().iterator
143+
}
144+
}
136145
dataTypes = result.queryExecution.analyzed.output.map(_.dataType).toArray
137146
setHasResultSet(true)
138147
} catch {

0 commit comments

Comments
 (0)