-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[SPARK-25339][TEST] Refactor FilterPushdownBenchmark #22443
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your swift PR, @wangyum ! I'll take a look tonight. BTW, could you update the title [TESTS]
into [TEST]
because [TEST]
is simpler and more popular from the Spark log?
2 and 3 are possible and convenient as you mentioned. But, we are trying to avoid 2 and 3, aren't we?
Please correct me if I'm wrong, @cloud-fan . |
Test build #96148 has finished for PR 22443 at commit
|
* To run this benchmark: | ||
* 1. without sbt: bin/spark-submit --class <this class> <spark sql test jar> | ||
* 2. build/sbt "sql/test:runMain <this class>" | ||
* 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain <this class>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we print the benchmark result if SPARK_GENERATE_BENCHMARK_FILES
is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC there is a special OutputStream
that can print the output to console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, It can print the output to console if SPARK_GENERATE_BENCHMARK_FILES
not set.
spark/core/src/main/scala/org/apache/spark/util/Benchmark.scala
Lines 59 to 63 in 4e8ac6e
val out = if (output.isDefined) { | |
new PrintStream(new TeeOutputStream(System.out, output.get)) | |
} else { | |
System.out | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the one space indent before the numbered list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@dongjoon-hyun we are trying to avoid the overhead of scalatest, not sbt. So this LGTM |
Thank you for confirmation, @cloud-fan . |
Test build #96213 has finished for PR 22443 at commit
|
retest this please |
Test build #96223 has finished for PR 22443 at commit
|
Jenkins, retest this please. |
Test build #96234 has finished for PR 22443 at commit
|
thanks, merging to master! @dongjoon-hyun Can you create an umbrella JIRA for updating all the benchmark and take care of it? Thanks! |
I see, @cloud-fan . |
@gengliangwang . SPARK-25475 is created like the above, could you revise #22451 in order print the output as a separate file like this PR? |
@dongjoon-hyun No problem. I was waiting for this PR to be merged. |
Thank you, @gengliangwang ! |
if (!file.exists()) { | ||
file.createNewFile() | ||
} | ||
output = Some(new FileOutputStream(file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: try-catch and close it.
if (!file.exists()) { | ||
file.createNewFile() | ||
} | ||
output = Some(new FileOutputStream(file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Option(new FileOutputStream(file))
and remove if (o != null) {
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address them when you fix some codes around here next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @HyukjinKwon. Will fix it next time.
What changes were proposed in this pull request?
Refactor
FilterPushdownBenchmark
usemain
method. we can use 3 ways to run this test now:The method 2 and the method 3 do not need to compile the
spark-sql_*-tests.jar
package. So these two methods are mainly for developers to quickly do benchmark.How was this patch tested?
manual tests