mihailom-db commented on PR #46474:
URL: https://github.com/apache/spark/pull/46474#issuecomment-2117149071

   @stefankandic SQL Standard does not support for casting to collated strings. 
I agree with the message thing. The standard only allows for CAST(1 AS STRING) 
COLLATE UNICODE, so that is what we were trying to achieve with this 
restriction on cast expression. The problem is that we have Spark Connect which 
can call col.cast(StringType(collation_name)) or col.cast("STRING COLLATE 
UNICODE") and we do not have an easy way of differentiating  StringType() from 
type created like StringType(UTF8_BINARY). In order to preserve meaning of cast 
to STRING as default, I would need to add this flag. Another solution is to 
always treat user defined casts as implicit priority. @srielau what do you 
think of this type of behaviour for user defined casts?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to