Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/17581#discussion_r111073224 --- Diff: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala --- @@ -121,7 +121,12 @@ private[hive] class SparkExecuteStatementOperation( result.toLocalIterator.asScala } else { if (resultList.isEmpty) { - resultList = Some(result.collect()) + val limited = sqlContext.getConf(SQLConf.THRIFTSERVER_RESULT_LIMIT.key).toInt + resultList = if (limited > 0) { + Some(result.take(result.queryExecution.analyzed.maxRows.getOrElse[Long](limited).toInt)) --- End diff -- I am afraid you might get an unexpected outcome. `maxRows` was not introduced for this purpose. Sometimes, the `maxRows`'s default value is None. It might not always be popped up to the top query node.
--- 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