maropu commented on a change in pull request #27965: 
[SPARK-29774][SQL][followup] support string literal as the second argument of 
date_add/date_sub functions
URL: https://github.com/apache/spark/pull/27965#discussion_r395530639
 
 

 ##########
 File path: docs/sql-migration-guide.md
 ##########
 @@ -113,7 +113,7 @@ license: |
 
 ### UDFs and Built-in Functions
 
-  - Since Spark 3.0, the `date_add` and `date_sub` functions only accepts int, 
smallint, tinyint as the 2nd argument, fractional and string types are not 
valid anymore, e.g. `date_add(cast('1964-05-23' as date), '12.34')` will cause 
`AnalysisException`. In Spark version 2.4 and earlier, if the 2nd argument is 
fractional or string value, it will be coerced to int value, and the result 
will be a date value of `1964-06-04`.
+  - Since Spark 3.0, the `date_add` and `date_sub` functions only accepts int, 
smallint, tinyint as the 2nd argument, fractional and string types (excluding 
string literals) are not valid anymore, e.g. `date_add(cast('1964-05-23' as 
date), '12.34')` will cause `AnalysisException`. In Spark version 2.4 and 
earlier, if the 2nd argument is fractional or string value, it will be coerced 
to int value, and the result will be a date value of `1964-06-04`.
 
 Review comment:
   In the current behaviour of this PR, `e.g. date_add(cast('1964-05-23' as 
date), '12.34') will cause AnalysisException` seems to be wrong.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to