我想了解pyspark代码中的概要分析。
接下来是:https://github.com/apache/spark/pull/2351
>>> sc._conf.set("spark.python.profile", "true")
>>> rdd = sc.parallelize(range(100)).map(str)
>>> rdd.count()
100
>>> sc.show_profiles()
============================================================
Profile of RDD<id=1>
============================================================
284 function calls (276 primitive calls) in 0.001 seconds
Ordered by: internal time, cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
4 0.000 0.000 0.000 0.000 serializers.py:198(load_stream)
4 0.000 0.000 0.000 0.000 {reduce}
12/4 0.000 0.000 0.001 0.000 rdd.py:2092(pipeline_func)
4 0.000 0.000 0.000 0.000 {cPickle.loads}
4 0.000 0.000 0.000 0.000 {cPickle.dumps}
104 0.000 0.000 0.000 0.000 rdd.py:852(<genexpr>)
8 0.000 0.000 0.000 0.000 serializers.py:461(read_int)
12 0.000 0.000 0.000 0.000 rdd.py:303(func)上面的效果很好。但是如果我这样做的话:
from pyspark.sql import HiveContext
from pyspark import SparkConf
from pyspark import SparkContext
conf = SparkConf().setAppName("myapp").set("spark.python.profile","true")
sc = SparkContext(conf=conf)
sqlContext = HiveContext(sc)
df=sqlContext.sql("select * from myhivetable")
df.count()
sc.show_profiles()这并没有给我任何东西。我知道了,但是show_profiles()把None给我
感谢您的任何帮助
发布于 2016-09-01 00:00:29
当您使用Spark SQL时,没有要分析的Python代码。唯一的Python是调用Scala引擎。其他的都是在Java虚拟机上执行的。
https://stackoverflow.com/questions/39253203
复制相似问题