You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wayneguow (via GitHub)" <gi...@apache.org> on 2024/07/19 06:19:14 UTC

[PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'common/utils/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   This PR aims to upgrade `h2` from 2.2.220 to 2.3.230.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   2.3.230 is latest version of `h2`, there are a lot of bug fixes and improvements.
   Full change notes:
   https://www.h2database.com/html/changelog.html
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   Pass GA.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   <!--
   If generative AI tooling has been used in the process of authoring this patch, please include the
   phrase: 'Generated-by: ' followed by the name of the tool and its version.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   No.


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1689741608


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1258,25 +1258,29 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
     checkAnswer(df15, Seq(Row(1, "cathy", 9000, 1200, false),
       Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    val df16 = spark.table("h2.test.employee")
-      .filter(sin($"bonus") < -0.08)
-      .filter(sinh($"bonus") > 200)
-      .filter(cos($"bonus") > 0.9)
-      .filter(cosh($"bonus") > 200)
-      .filter(tan($"bonus") < -0.08)
-      .filter(tanh($"bonus") === 1)
-      .filter(cot($"bonus") < -11)
-      .filter(asin($"bonus") > 0.1)
-      .filter(acos($"bonus") > 1.4)
-      .filter(atan($"bonus") > 1.4)
-      .filter(atan2($"bonus", $"bonus") > 0.7)
+    val df16 = sql(
+      """
+        |SELECT * FROM h2.test.employee
+        |WHERE sin(bonus) < -0.08
+        |AND sinh(bonus) > 200
+        |AND cos(bonus) > 0.9
+        |AND cosh(bonus) > 200
+        |AND tan(bonus) < -0.08
+        |AND tanh(bonus) = 1
+        |AND cot(bonus) < -11
+        |AND asin(bonus / salary) > 0.13
+        |AND acos(bonus / salary) < 1.47
+        |AND atan(bonus) > 1.4
+        |AND atan2(bonus, bonus) > 0.7
+        |""".stripMargin)
     checkFiltersRemoved(df16)

Review Comment:
   I guess that the push-down processing for complex filters is inconsistent when turning on and off ansi mode, so I first constructed some suitable data and restored the fiters of `asin` and `acos` to simple. This is the followup pr #47472



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2244127438

   Thank you all. @dongjoon-hyun @LuciferYang 


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1689993950


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1258,25 +1258,29 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
     checkAnswer(df15, Seq(Row(1, "cathy", 9000, 1200, false),
       Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    val df16 = spark.table("h2.test.employee")
-      .filter(sin($"bonus") < -0.08)
-      .filter(sinh($"bonus") > 200)
-      .filter(cos($"bonus") > 0.9)
-      .filter(cosh($"bonus") > 200)
-      .filter(tan($"bonus") < -0.08)
-      .filter(tanh($"bonus") === 1)
-      .filter(cot($"bonus") < -11)
-      .filter(asin($"bonus") > 0.1)
-      .filter(acos($"bonus") > 1.4)
-      .filter(atan($"bonus") > 1.4)
-      .filter(atan2($"bonus", $"bonus") > 0.7)
+    val df16 = sql(
+      """
+        |SELECT * FROM h2.test.employee
+        |WHERE sin(bonus) < -0.08
+        |AND sinh(bonus) > 200
+        |AND cos(bonus) > 0.9
+        |AND cosh(bonus) > 200
+        |AND tan(bonus) < -0.08
+        |AND tanh(bonus) = 1
+        |AND cot(bonus) < -11
+        |AND asin(bonus / salary) > 0.13
+        |AND acos(bonus / salary) < 1.47
+        |AND atan(bonus) > 1.4
+        |AND atan2(bonus, bonus) > 0.7
+        |""".stripMargin)
     checkFiltersRemoved(df16)

Review Comment:
   Thank you all for the reporting NON-ANSI mode issue and the quick follow-up.



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2239688962

   To @wayneguow , please mention the following in the PR description and title. It improves the visibility of your contribution. Since it's non-trivial contribution, I'd recommend you to get a better credit in the community for this activity. This PR is better than a simple version-string-change PR, isn't it? 😄 
   
   > Yes. After this commit( https://github.com/h2database/h2database/commit/186647d4a35d05681febf4f53502b306aa6d511a), the behavior of asin and acos has changed in h2, complying with Standard SQL, and throwing exceptions directly when the argument is invalid(< -1d || > 1d).


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2238837740

   > ```
   > [info] - scan with filter push-down *** FAILED *** (10 seconds, 332 milliseconds)
   > [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 216.0 failed 1 times, most recent failure: Lost task 0.0 in stage 216.0 (TID 200) (localhost executor driver): org.h2.jdbc.JdbcSQLDataException: Invalid value "1200.0" for parameter "ASIN() argument"; SQL statement:
   > [info] SELECT "DEPT","NAME","SALARY","BONUS","IS_MANAGER" FROM "test"."employee"  WHERE ("BONUS" IS NOT NULL) AND (SIN("BONUS") < -0.08) AND (SINH("BONUS") > 200.0) AND (COS("BONUS") > 0.9) AND (COSH("BONUS") > 200.0) AND (TAN("BONUS") < -0.08) AND (TANH("BONUS") = 1.0) AND (COT("BONUS") < -11.0) AND (ASIN("BONUS") > 0.1) AND (ACOS("BONUS") > 1.4) AND (ATAN("BONUS") > 1.4) AND ((ATAN2("BONUS", "BONUS")) > 0.7) [90008-230]
   > [info] 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:658)
   > [info] 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
   > [info] 	at org.h2.message.DbException.get(DbException.java:223)
   > [info] 	at org.h2.message.DbException.getInvalidValueException(DbException.java:298)
   > [info] 	at org.h2.expression.function.MathFunction1.getValue(MathFunction1.java:160)
   > [info] 	at org.h2.expression.condition.Comparison.getValue(Comparison.java:225)
   > [info] 	at org.h2.expression.condition.ConditionAndOrN.getValue(ConditionAndOrN.java:128)
   > [info] 	at org.h2.expression.Expression.getBooleanValue(Expression.java:343)
   > [info] 	at org.h2.command.query.Select.isConditionMet(Select.java:452)
   > [info] 	at org.h2.command.query.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1889)
   > [info] 	at org.h2.result.LazyResult.hasNext(LazyResult.java:78)
   > [info] 	at org.h2.result.FetchedResult.next(FetchedResult.java:34)
   > [info] 	at org.h2.command.query.Select.queryFlat(Select.java:767)
   > [info] 	at org.h2.command.query.Select.queryWithoutCache(Select.java:891)
   > [info] 	at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:211)
   > [info] 	at org.h2.command.query.Query.query(Query.java:534)
   > [info] 	at org.h2.command.query.Query.query(Query.java:497)
   > ```
   > 
   > the failed test seems related to this pr.
   
   Yes. After this commit( https://github.com/h2database/h2database/commit/186647d4a35d05681febf4f53502b306aa6d511a), the behavior of `asin` and `acos` has changed in `h2`, complying with Standard SQL, and throwing exceptions directly when the argument is invalid(< -1d ||  > 1d).


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2244126500

   Merged into master. Thanks @wayneguow and @dongjoon-hyun  ~


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1686150662


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1275,11 +1275,32 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
       "BONUS IS NOT NULL, SIN(BONUS) < -0.08, SINH(BONUS) > 200.0, COS(BONUS) > 0.9, " +
       "COSH(BONUS) > 200.0, TAN(BONUS) < -0.08, TANH(BONUS) = 1.0, COT(BONUS) < -11.0, " +
       "ASIN(BONUS) > 0.1, ACOS(BONUS) > 1.4, ATAN(BONUS) > 1.4, (ATAN2(BONUS, BONUS)) > 0.7],")
-    checkAnswer(df16, Seq(Row(1, "cathy", 9000, 1200, false),
-      Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    // H2 does not support log2, asinh, acosh, atanh, cbrt
+    // When arguments for asin and acos are invalid (< -1 || > 1) in H2
+    val e = intercept[SparkException] {

Review Comment:
   Can the test for df16 be fixed in place to use a set of compliant data, and then place the test with exceptional data into a separate test suite? Name this new test case with the prefix `SPARK-48943:`. By doing this, there should also be no need to rename `df17`.



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang closed pull request #47414: [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL 
URL: https://github.com/apache/spark/pull/47414


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1689601515


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1258,25 +1258,29 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
     checkAnswer(df15, Seq(Row(1, "cathy", 9000, 1200, false),
       Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    val df16 = spark.table("h2.test.employee")
-      .filter(sin($"bonus") < -0.08)
-      .filter(sinh($"bonus") > 200)
-      .filter(cos($"bonus") > 0.9)
-      .filter(cosh($"bonus") > 200)
-      .filter(tan($"bonus") < -0.08)
-      .filter(tanh($"bonus") === 1)
-      .filter(cot($"bonus") < -11)
-      .filter(asin($"bonus") > 0.1)
-      .filter(acos($"bonus") > 1.4)
-      .filter(atan($"bonus") > 1.4)
-      .filter(atan2($"bonus", $"bonus") > 0.7)
+    val df16 = sql(
+      """
+        |SELECT * FROM h2.test.employee
+        |WHERE sin(bonus) < -0.08
+        |AND sinh(bonus) > 200
+        |AND cos(bonus) > 0.9
+        |AND cosh(bonus) > 200
+        |AND tan(bonus) < -0.08
+        |AND tanh(bonus) = 1
+        |AND cot(bonus) < -11
+        |AND asin(bonus / salary) > 0.13
+        |AND acos(bonus / salary) < 1.47
+        |AND atan(bonus) > 1.4
+        |AND atan2(bonus, bonus) > 0.7
+        |""".stripMargin)
     checkFiltersRemoved(df16)

Review Comment:
   This test fails with ANSI mode off. Can you fix this test please? https://github.com/apache/spark/actions/runs/10068969366 https://productionresultssa13.blob.core.windows.net/actions-results/50788c6b-3e5d-4211-88e0-f20adb701789/workflow-job-run-a6191a53-8500-5ada-dd0e-e26b8ef2ec1c/logs/job/job-logs.txt?rsct=text%2Fplain&se=2024-07-24T11%3A25%3A17Z&sig=kdcaR6m%2ByrA32cr2iLkgBNpNKewVY9tmZy0TvylAGCI%3D&ske=2024-07-24T22%3A16%3A30Z&skoid=ca7593d4-ee42-46cd-af88-8b886a2f84eb&sks=b&skt=2024-07-24T10%3A16%3A30Z&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skv=2024-05-04&sp=r&spr=https&sr=b&st=2024-07-24T11%3A15%3A12Z&sv=2024-05-04



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2238603818

   ```
   [info] - scan with filter push-down *** FAILED *** (10 seconds, 332 milliseconds)
   [info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 216.0 failed 1 times, most recent failure: Lost task 0.0 in stage 216.0 (TID 200) (localhost executor driver): org.h2.jdbc.JdbcSQLDataException: Invalid value "1200.0" for parameter "ASIN() argument"; SQL statement:
   [info] SELECT "DEPT","NAME","SALARY","BONUS","IS_MANAGER" FROM "test"."employee"  WHERE ("BONUS" IS NOT NULL) AND (SIN("BONUS") < -0.08) AND (SINH("BONUS") > 200.0) AND (COS("BONUS") > 0.9) AND (COSH("BONUS") > 200.0) AND (TAN("BONUS") < -0.08) AND (TANH("BONUS") = 1.0) AND (COT("BONUS") < -11.0) AND (ASIN("BONUS") > 0.1) AND (ACOS("BONUS") > 1.4) AND (ATAN("BONUS") > 1.4) AND ((ATAN2("BONUS", "BONUS")) > 0.7) [90008-230]
   [info] 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:658)
   [info] 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
   [info] 	at org.h2.message.DbException.get(DbException.java:223)
   [info] 	at org.h2.message.DbException.getInvalidValueException(DbException.java:298)
   [info] 	at org.h2.expression.function.MathFunction1.getValue(MathFunction1.java:160)
   [info] 	at org.h2.expression.condition.Comparison.getValue(Comparison.java:225)
   [info] 	at org.h2.expression.condition.ConditionAndOrN.getValue(ConditionAndOrN.java:128)
   [info] 	at org.h2.expression.Expression.getBooleanValue(Expression.java:343)
   [info] 	at org.h2.command.query.Select.isConditionMet(Select.java:452)
   [info] 	at org.h2.command.query.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1889)
   [info] 	at org.h2.result.LazyResult.hasNext(LazyResult.java:78)
   [info] 	at org.h2.result.FetchedResult.next(FetchedResult.java:34)
   [info] 	at org.h2.command.query.Select.queryFlat(Select.java:767)
   [info] 	at org.h2.command.query.Select.queryWithoutCache(Select.java:891)
   [info] 	at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:211)
   [info] 	at org.h2.command.query.Query.query(Query.java:534)
   [info] 	at org.h2.command.query.Query.query(Query.java:497)
   ```
   
   the failed test seems related to this pr.


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2239746681

   > To @wayneguow , please mention the following in the PR description and title. It improves the visibility of your contribution. Since it's non-trivial contribution, I'd recommend you to get a better credit in the community for this activity. This PR is better than a simple version-string-change PR, isn't it? 😄
   > 
   > > Yes. After this commit( [h2database/h2database@186647d](https://github.com/h2database/h2database/commit/186647d4a35d05681febf4f53502b306aa6d511a)), the behavior of asin and acos has changed in h2, complying with Standard SQL, and throwing exceptions directly when the argument is invalid(< -1d || > 1d).
   
   @dongjoon-hyun  I really appreciate your guidance, not merely for helping me do things right, but for empowering me to make greater progress in the future. Let's do better. 😀


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1689606514


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1258,25 +1258,29 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
     checkAnswer(df15, Seq(Row(1, "cathy", 9000, 1200, false),
       Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    val df16 = spark.table("h2.test.employee")
-      .filter(sin($"bonus") < -0.08)
-      .filter(sinh($"bonus") > 200)
-      .filter(cos($"bonus") > 0.9)
-      .filter(cosh($"bonus") > 200)
-      .filter(tan($"bonus") < -0.08)
-      .filter(tanh($"bonus") === 1)
-      .filter(cot($"bonus") < -11)
-      .filter(asin($"bonus") > 0.1)
-      .filter(acos($"bonus") > 1.4)
-      .filter(atan($"bonus") > 1.4)
-      .filter(atan2($"bonus", $"bonus") > 0.7)
+    val df16 = sql(
+      """
+        |SELECT * FROM h2.test.employee
+        |WHERE sin(bonus) < -0.08
+        |AND sinh(bonus) > 200
+        |AND cos(bonus) > 0.9
+        |AND cosh(bonus) > 200
+        |AND tan(bonus) < -0.08
+        |AND tanh(bonus) = 1
+        |AND cot(bonus) < -11
+        |AND asin(bonus / salary) > 0.13
+        |AND acos(bonus / salary) < 1.47
+        |AND atan(bonus) > 1.4
+        |AND atan2(bonus, bonus) > 0.7
+        |""".stripMargin)
     checkFiltersRemoved(df16)

Review Comment:
   Thanks for reporting this and reminding me, let me make a check and fix it.



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1689604445


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1258,25 +1258,29 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
     checkAnswer(df15, Seq(Row(1, "cathy", 9000, 1200, false),
       Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    val df16 = spark.table("h2.test.employee")
-      .filter(sin($"bonus") < -0.08)
-      .filter(sinh($"bonus") > 200)
-      .filter(cos($"bonus") > 0.9)
-      .filter(cosh($"bonus") > 200)
-      .filter(tan($"bonus") < -0.08)
-      .filter(tanh($"bonus") === 1)
-      .filter(cot($"bonus") < -11)
-      .filter(asin($"bonus") > 0.1)
-      .filter(acos($"bonus") > 1.4)
-      .filter(atan($"bonus") > 1.4)
-      .filter(atan2($"bonus", $"bonus") > 0.7)
+    val df16 = sql(
+      """
+        |SELECT * FROM h2.test.employee
+        |WHERE sin(bonus) < -0.08
+        |AND sinh(bonus) > 200
+        |AND cos(bonus) > 0.9
+        |AND cosh(bonus) > 200
+        |AND tan(bonus) < -0.08
+        |AND tanh(bonus) = 1
+        |AND cot(bonus) < -11
+        |AND asin(bonus / salary) > 0.13
+        |AND acos(bonus / salary) < 1.47
+        |AND atan(bonus) > 1.4
+        |AND atan2(bonus, bonus) > 0.7
+        |""".stripMargin)
     checkFiltersRemoved(df16)

Review Comment:
   @wayneguow Let's fix this issue as soon as possible.
   
   



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 and enhance the test coverage of behavior changes of `asin` and `acos` complying Standard SQL [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on code in PR #47414:
URL: https://github.com/apache/spark/pull/47414#discussion_r1686324246


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala:
##########
@@ -1275,11 +1275,32 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel
       "BONUS IS NOT NULL, SIN(BONUS) < -0.08, SINH(BONUS) > 200.0, COS(BONUS) > 0.9, " +
       "COSH(BONUS) > 200.0, TAN(BONUS) < -0.08, TANH(BONUS) = 1.0, COT(BONUS) < -11.0, " +
       "ASIN(BONUS) > 0.1, ACOS(BONUS) > 1.4, ATAN(BONUS) > 1.4, (ATAN2(BONUS, BONUS)) > 0.7],")
-    checkAnswer(df16, Seq(Row(1, "cathy", 9000, 1200, false),
-      Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true)))
 
-    // H2 does not support log2, asinh, acosh, atanh, cbrt
+    // When arguments for asin and acos are invalid (< -1 || > 1) in H2
+    val e = intercept[SparkException] {

Review Comment:
   Updated it.



-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2238854778

   After a discussion with @LuciferYang . I will add a new test case with valid input and assert the old test case. 


-- 
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


Re: [PR] [SPARK-48943][TESTS] Upgrade `h2` to 2.3.230 [spark]

Posted by "wayneguow (via GitHub)" <gi...@apache.org>.
wayneguow commented on PR #47414:
URL: https://github.com/apache/spark/pull/47414#issuecomment-2239638988

   Also cc @dongjoon-hyun 


-- 
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