You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/17 09:36:42 UTC

[GitHub] [spark] HyukjinKwon opened a new pull request, #36576: [SPARK-32268][SQL][TESTS][FOLLOw-UP] Use function registry in the SparkSession

HyukjinKwon opened a new pull request, #36576:
URL: https://github.com/apache/spark/pull/36576

   ### What changes were proposed in this pull request?
   
   This PR proposes:
   1. Use the function registry in the Spark Session being used
   2. Move function registration into `beforeAll`
   
   ### Why are the changes needed?
   
   Registration of the function without `beforeAll` at `builtin` can affect other tests. See also https://lists.apache.org/thread/jp0ccqv10ht716g9xldm2ohdv3mpmmz1.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test-only.
   
   ### How was this patch tested?
   
   Unittests fixed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874632251


##########
sql/core/src/test/scala/org/apache/spark/sql/BloomFilterAggregateQuerySuite.scala:
##########
@@ -35,23 +34,26 @@ class BloomFilterAggregateQuerySuite extends QueryTest with SharedSparkSession {
   val funcId_bloom_filter_agg = new FunctionIdentifier("bloom_filter_agg")
   val funcId_might_contain = new FunctionIdentifier("might_contain")
 
-  // Register 'bloom_filter_agg' to builtin.
-  FunctionRegistry.builtin.registerFunction(funcId_bloom_filter_agg,

Review Comment:
   I think actually the root cause is that:
   1. `BloomFilterAggregateQuerySuite` gets referred first somehow/somewhere
   2. These functions get registered first (because these blocks will be executed when `BloomFilterAggregateQuerySuite` is referred).
   3. Other tests run before `BloomFilterAggregateQuerySuite` actually runs (and deregister these functions at `afterAll`.
   4. Other tests fail because of these two functions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874632251


##########
sql/core/src/test/scala/org/apache/spark/sql/BloomFilterAggregateQuerySuite.scala:
##########
@@ -35,23 +34,26 @@ class BloomFilterAggregateQuerySuite extends QueryTest with SharedSparkSession {
   val funcId_bloom_filter_agg = new FunctionIdentifier("bloom_filter_agg")
   val funcId_might_contain = new FunctionIdentifier("might_contain")
 
-  // Register 'bloom_filter_agg' to builtin.
-  FunctionRegistry.builtin.registerFunction(funcId_bloom_filter_agg,

Review Comment:
   I think Scala version or something else caused the test failure by the different class reference order (vs. CI) during running tests:
   1. `BloomFilterAggregateQuerySuite` gets referred first somehow/somewhere
   2. These functions get registered first (because these previous codes will be executed when `BloomFilterAggregateQuerySuite` is referred).
   3. Other tests run before `BloomFilterAggregateQuerySuite` actually runs (and deregisters these functions at `afterAll`.
   4. Other tests fail because of two functions added by `BloomFilterAggregateQuerySuite`.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #36576:
URL: https://github.com/apache/spark/pull/36576#issuecomment-1128914759

   Merged to master and branch-3.3.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon closed pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession
URL: https://github.com/apache/spark/pull/36576


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874632251


##########
sql/core/src/test/scala/org/apache/spark/sql/BloomFilterAggregateQuerySuite.scala:
##########
@@ -35,23 +34,26 @@ class BloomFilterAggregateQuerySuite extends QueryTest with SharedSparkSession {
   val funcId_bloom_filter_agg = new FunctionIdentifier("bloom_filter_agg")
   val funcId_might_contain = new FunctionIdentifier("might_contain")
 
-  // Register 'bloom_filter_agg' to builtin.
-  FunctionRegistry.builtin.registerFunction(funcId_bloom_filter_agg,

Review Comment:
   I think Scala version or something else caused the test failure by the difference class reference order (vs. CI) during running tests:
   1. `BloomFilterAggregateQuerySuite` gets referred first somehow/somewhere
   2. These functions get registered first (because these previous codes will be executed when `BloomFilterAggregateQuerySuite` is referred).
   3. Other tests run before `BloomFilterAggregateQuerySuite` actually runs (and deregister these functions at `afterAll`.
   4. Other tests fail because of these two functions.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874625022


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -147,6 +147,9 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
   test("SPARK-14415: All functions should have own descriptions") {
     for (f <- spark.sessionState.functionRegistry.listFunction()) {
       if (!Seq("cube", "grouping", "grouping_id", "rollup").contains(f.unquotedString)) {
+        if (f.unquotedString == "bloom_filter_agg") {

Review Comment:
   I was debugging with checkpointing here with IDE 😂 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874598262


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -147,6 +147,9 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
   test("SPARK-14415: All functions should have own descriptions") {
     for (f <- spark.sessionState.functionRegistry.listFunction()) {
       if (!Seq("cube", "grouping", "grouping_id", "rollup").contains(f.unquotedString)) {
+        if (f.unquotedString == "bloom_filter_agg") {

Review Comment:
   do we need this? it looks weird to handle `bloom_filter_agg` here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874632251


##########
sql/core/src/test/scala/org/apache/spark/sql/BloomFilterAggregateQuerySuite.scala:
##########
@@ -35,23 +34,26 @@ class BloomFilterAggregateQuerySuite extends QueryTest with SharedSparkSession {
   val funcId_bloom_filter_agg = new FunctionIdentifier("bloom_filter_agg")
   val funcId_might_contain = new FunctionIdentifier("might_contain")
 
-  // Register 'bloom_filter_agg' to builtin.
-  FunctionRegistry.builtin.registerFunction(funcId_bloom_filter_agg,

Review Comment:
   I think Scala version or something else caused the test failure by the difference class reference order (vs. CI) during running tests:
   1. `BloomFilterAggregateQuerySuite` gets referred first somehow/somewhere
   2. These functions get registered first (because these previous codes will be executed when `BloomFilterAggregateQuerySuite` is referred).
   3. Other tests run before `BloomFilterAggregateQuerySuite` actually runs (and deregisters these functions at `afterAll`.
   4. Other tests fail because of these two functions.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874632251


##########
sql/core/src/test/scala/org/apache/spark/sql/BloomFilterAggregateQuerySuite.scala:
##########
@@ -35,23 +34,26 @@ class BloomFilterAggregateQuerySuite extends QueryTest with SharedSparkSession {
   val funcId_bloom_filter_agg = new FunctionIdentifier("bloom_filter_agg")
   val funcId_might_contain = new FunctionIdentifier("might_contain")
 
-  // Register 'bloom_filter_agg' to builtin.
-  FunctionRegistry.builtin.registerFunction(funcId_bloom_filter_agg,

Review Comment:
   I think Scala version or something else caused the test failure by the difference class reference order (vs. CI) during running tests:
   1. `BloomFilterAggregateQuerySuite` gets referred first somehow/somewhere
   2. These functions get registered first (because these previous codes will be executed when `BloomFilterAggregateQuerySuite` is referred).
   3. Other tests run before `BloomFilterAggregateQuerySuite` actually runs (and deregisters these functions at `afterAll`.
   4. Other tests fail because of two functions added by `BloomFilterAggregateQuerySuite`.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36576: [SPARK-32268][SQL][TESTS][FOLLOW-UP] Use function registry in the SparkSession

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #36576:
URL: https://github.com/apache/spark/pull/36576#discussion_r874624321


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -147,6 +147,9 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
   test("SPARK-14415: All functions should have own descriptions") {
     for (f <- spark.sessionState.functionRegistry.listFunction()) {
       if (!Seq("cube", "grouping", "grouping_id", "rollup").contains(f.unquotedString)) {
+        if (f.unquotedString == "bloom_filter_agg") {

Review Comment:
   oops mistake.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org