Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printReport error on the complex query #17

Closed
Jirapong opened this issue Oct 31, 2018 · 3 comments
Closed

printReport error on the complex query #17

Jirapong opened this issue Oct 31, 2018 · 3 comments

Comments

@Jirapong
Copy link
Contributor

Jirapong commented Oct 31, 2018

I got an error after run following command

val stageMetrics = ch.cern.sparkmeasure.StageMetrics(spark) 

stageMetrics.begin()

spark.sql("SELECT 1=1")

stageMetrics.end()
stageMetrics.printReport()

got following error

at ch.cern.sparkmeasure.StageMetrics$$anonfun$report$1.apply(stagemetrics.scala:184)
	at ch.cern.sparkmeasure.StageMetrics$$anonfun$report$1.apply(stagemetrics.scala:184)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)
	at ch.cern.sparkmeasure.StageMetrics.report(stagemetrics.scala:184)
	at ch.cern.sparkmeasure.StageMetrics.printReport(stagemetrics.scala:193)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw$$iw$$iw$$iw$$iw$$iw.<init>(command-652119476452024:3)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw$$iw$$iw$$iw$$iw.<init>(command-652119476452024:48)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw$$iw$$iw$$iw.<init>(command-652119476452024:50)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw$$iw$$iw.<init>(command-652119476452024:52)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw$$iw.<init>(command-652119476452024:54)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$$iw.<init>(command-652119476452024:56)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read.<init>(command-652119476452024:58)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$.<init>(command-652119476452024:62)
	at linea8b963cf2ca141a2ac1e991add9914c629.$read$.<clinit>(command-652119476452024)
	at linea8b963cf2ca141a2ac1e991add9914c629.$eval$.$print$lzycompute(<notebook>:7)
	at linea8b963cf2ca141a2ac1e991add9914c629.$eval$.$print(<notebook>:6)
@LucaCanali
Copy link
Owner

Hi,
The intended usage is:

val stageMetrics = ch.cern.sparkmeasure.StageMetrics(spark) 
stageMetrics.begin()

...execute one or more Spark jobs...

stageMetrics.end()
stageMetrics.printReport()

See also https://github.com/LucaCanali/sparkMeasure/blob/master/docs/Scala_shell_and_notebooks.md
Please check again if this works in your case.

@Jirapong
Copy link
Contributor Author

Jirapong commented Nov 6, 2018

Sorry that is a wrong syntax. I believe the error caused by metric is not produce any number like

val stageMetrics = ch.cern.sparkmeasure.StageMetrics(spark) 

stageMetrics.begin()
spark.sql("SELECT 1=1")
stageMetrics.end()
stageMetrics.printReport()


scala> spark.sql("select * from PerfStageMetrics").show
+-----+--------+-------+----+--------------+--------------+-------------+--------+---------------+---------------+-----------------------+--------------------------+-----------------------+---------+----------+-----------------------+----------------+------------------+-------------------+-----------+---------+--------------+------------+--------------------+---------------------+-------------------------+-------------------------+--------------------------+----------------+-------------------+---------------------+
|jobId|jobGroup|stageId|name|submissionTime|completionTime|stageDuration|numTasks|executorRunTime|executorCpuTime|executorDeserializeTime|executorDeserializeCpuTime|resultSerializationTime|jvmGCTime|resultSize|numUpdatedBlockStatuses|diskBytesSpilled|memoryBytesSpilled|peakExecutionMemory|recordsRead|bytesRead|recordsWritten|bytesWritten|shuffleFetchWaitTime|shuffleTotalBytesRead|shuffleTotalBlocksFetched|shuffleLocalBlocksFetched|shuffleRemoteBlocksFetched|shuffleWriteTime|shuffleBytesWritten|shuffleRecordsWritten|
+-----+--------+-------+----+--------------+--------------+-------------+--------+---------------+---------------+-----------------------+--------------------------+-----------------------+---------+----------+-----------------------+----------------+------------------+-------------------+-----------+---------+--------------+------------+--------------------+---------------------+-------------------------+-------------------------+--------------------------+----------------+-------------------+---------------------+
+-----+--------+-------+----+--------------+--------------+-------------+--------+---------------+---------------+-----------------------+--------------------------+-----------------------+---------+----------+-----------------------+----------------+------------------+-------------------+-----------+---------+--------------+------------+--------------------+---------------------+-------------------------+-------------------------+--------------------------+----------------+-------------------+---------------------+

BTW, I'm working on PR to prevent this error.

@LucaCanali
Copy link
Owner

PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants