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

[SPARK-25339][TEST] Refactor FilterPushdownBenchmark #22443

Closed
wants to merge 3 commits into from
Closed

[SPARK-25339][TEST] Refactor FilterPushdownBenchmark #22443

wants to merge 3 commits into from

Conversation

wangyum
Copy link
Member

@wangyum wangyum commented Sep 17, 2018

What changes were proposed in this pull request?

Refactor FilterPushdownBenchmark use main method. we can use 3 ways to run this test now:

  1. bin/spark-submit --class org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark spark-sql_2.11-2.5.0-SNAPSHOT-tests.jar
  2. build/sbt "sql/test:runMain org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark"
  3. SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark"

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

@wangyum
Copy link
Member Author

wangyum commented Sep 17, 2018

cc @dongjoon-hyun

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a 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?

@dongjoon-hyun
Copy link
Member

2 and 3 are possible and convenient as you mentioned. But, we are trying to avoid 2 and 3, aren't we?

2. build/sbt "sql/test:runMain org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark"
3. SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark"

Please correct me if I'm wrong, @cloud-fan .

@SparkQA
Copy link

SparkQA commented Sep 17, 2018

Test build #96148 has finished for PR 22443 at commit 6e7cfc8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum changed the title [SPARK-25339][TESTS] Refactor FilterPushdownBenchmark [SPARK-25339][TEST] Refactor FilterPushdownBenchmark Sep 18, 2018
* 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>"
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

val out = if (output.isDefined) {
new PrintStream(new TeeOutputStream(System.out, output.get))
} else {
System.out
}

Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@cloud-fan
Copy link
Contributor

@dongjoon-hyun we are trying to avoid the overhead of scalatest, not sbt. So this LGTM

@dongjoon-hyun
Copy link
Member

Thank you for confirmation, @cloud-fan .

@SparkQA
Copy link

SparkQA commented Sep 19, 2018

Test build #96213 has finished for PR 22443 at commit 075ef7a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Sep 19, 2018

retest this please

@SparkQA
Copy link

SparkQA commented Sep 19, 2018

Test build #96223 has finished for PR 22443 at commit 075ef7a.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Sep 19, 2018

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Sep 19, 2018

Test build #96234 has finished for PR 22443 at commit 075ef7a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@dongjoon-hyun Can you create an umbrella JIRA for updating all the benchmark and take care of it? Thanks!

@asfgit asfgit closed this in 0e31a6f Sep 20, 2018
@dongjoon-hyun
Copy link
Member

I see, @cloud-fan .

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun
Copy link
Member

@gengliangwang . SPARK-25475 is created like the above, could you revise #22451 in order print the output as a separate file like this PR?

@gengliangwang
Copy link
Member

@dongjoon-hyun No problem. I was waiting for this PR to be merged.

@dongjoon-hyun
Copy link
Member

Thank you, @gengliangwang !

if (!file.exists()) {
file.createNewFile()
}
output = Some(new FileOutputStream(file))
Copy link
Member

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))
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

@wangyum wangyum Sep 28, 2018

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.

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