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 2021/09/26 04:59:39 UTC

[GitHub] [spark] Peng-Lei opened a new pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Peng-Lei opened a new pull request #34107:
URL: https://github.com/apache/spark/pull/34107


   ### What changes were proposed in this pull request?
   Handle incorrect parsing of negative ANSI typed interval literals
   [SPARK-36851](https://issues.apache.org/jira/browse/SPARK-36851)
   
   
   ### Why are the changes needed?
   Incorrect result:
   ```
   spark-sql> select interval -'1' year;
   1-0
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Add ut testcase
   


-- 
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] gengliangwang commented on pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #34107:
URL: https://github.com/apache/spark/pull/34107#issuecomment-927244412


   I will cut RC5 after merging this one.


-- 
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] gengliangwang closed pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
gengliangwang closed pull request #34107:
URL: https://github.com/apache/spark/pull/34107


   


-- 
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] Peng-Lei commented on a change in pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #34107:
URL: https://github.com/apache/spark/pull/34107#discussion_r716180691



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -4223,6 +4223,17 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
     checkAnswer(sql("""SELECT from_json(r'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
     checkAnswer(sql("""SELECT from_json(R'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
   }
+
+  test("SPARK-36851: Incorrect parsing of negative ANSI typed interval literals") {
+    val df1 = sql("select interval -'1' year")

Review comment:
       done




-- 
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 pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #34107:
URL: https://github.com/apache/spark/pull/34107#issuecomment-927501248


   good catch!


-- 
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] Peng-Lei commented on pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on pull request #34107:
URL: https://github.com/apache/spark/pull/34107#issuecomment-927232500


   @MaxGekk Could you take a look ? Is this fix okay ? Thank you.


-- 
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] Peng-Lei commented on a change in pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #34107:
URL: https://github.com/apache/spark/pull/34107#discussion_r716152608



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -4223,6 +4223,17 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
     checkAnswer(sql("""SELECT from_json(r'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
     checkAnswer(sql("""SELECT from_json(R'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
   }
+
+  test("SPARK-36851: Incorrect parsing of negative ANSI typed interval literals") {
+    val df1 = sql("select interval -'1' year")

Review comment:
       OK




-- 
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] AmplabJenkins commented on pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34107:
URL: https://github.com/apache/spark/pull/34107#issuecomment-927233406


   Can one of the admins verify this patch?


-- 
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] gengliangwang commented on a change in pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #34107:
URL: https://github.com/apache/spark/pull/34107#discussion_r716152185



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -4223,6 +4223,17 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
     checkAnswer(sql("""SELECT from_json(r'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
     checkAnswer(sql("""SELECT from_json(R'{"a": "\\"}', 'a string')"""), Row(Row("\\")))
   }
+
+  test("SPARK-36851: Incorrect parsing of negative ANSI typed interval literals") {
+    val df1 = sql("select interval -'1' year")

Review comment:
       Let's move the test cases into `interval.sql`.
   Also, we should add tests for negative day time intervals as well.




-- 
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] gengliangwang commented on pull request #34107: [SPARK-36851][SQL] Incorrect parsing of negative ANSI typed interval literals

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #34107:
URL: https://github.com/apache/spark/pull/34107#issuecomment-927281783


   Thanks, merging to master/3.2


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