spark查询执行时间 [英] spark query execution time
本文介绍了spark查询执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个本地 hadoop 单节点并安装了 hive,我在 hdfs 中存储了一些 hive 表.然后我用 MySQL Metastore 配置 Hive.现在我安装了 spark 并且我对这样的 hive 表进行了一些查询(在 Scala 中):
I have a local hadoop single node and hive installed and I have some hive tables stored in hdfs. Then I configure Hive with MySQL Metastore. And now I installed spark and Im doing some queries over hive tables like this (in scala):
var hiveContext = new org.apache.spark.sql.hive.HiveContext(sc)
result = hiveContext.sql("SELECT * FROM USERS");
result.show
你知道如何配置spark来显示查询的执行时间吗?因为默认情况下它不显示..
Do you know how to configure spark to show to the execution time of the query? Because for default it is not showing..
推荐答案
使用 spark.time()
.
var hiveContext = new org.apache.spark.sql.hive.HiveContext(sc)result = hiveContext.sql("SELECT * FROM USERS");spark.time(result.show)
这篇关于spark查询执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文