火花查询执行时间 [英] spark query execution time

查看:77
本文介绍了火花查询执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了本地hadoop单节点和配置单元,并且在hdfs中存储了一些配置单元表.然后,我用MySQL Metastore配置Hive.现在我安装了spark和Im在像这样的配置单元表上做一些查询(在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)

var hiveContext = new org.apache.spark.sql.hive.HiveContext(sc) result = hiveContext.sql("SELECT * FROM USERS"); spark.time(result.show)

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆