cloud-fan commented on issue #27965: [SPARK-31205][SQL] support string literal 
as the second argument of date_add/date_sub functions
URL: https://github.com/apache/spark/pull/27965#issuecomment-601657783
 
 
   @yaooqinn the reason why almost all the mainstream databases accept string 
literals as SQL function arguments is because it's convenient and common. Some 
BI tools even generate SQL queries with string literals in function arguments 
regardless of the required type.
   
   Spark is mostly compatible with this use case because our type coercion can 
implicitly cast string to other types. This is bad as it can lead to runtime 
null values for invalid string values, and we are trying to improve it under 
the ANSI mode.
   
   #26412 breaks this use case. I'm OK to add back string type support 
completely, but I do agree the previous behavior was very confusing. This PR 
proposes a temporary workaround to support valid string literals only, and I 
believe we will have a holistic solution of ANSI type coercion in the next 
release, which handles string literals and invalid string values.

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