maropu commented on issue #26811: [SPARK-29600][SQL] array_contains built in 
function is not backward compatible in 3.0
URL: https://github.com/apache/spark/pull/26811#issuecomment-563273973
 
 
   I think this kind of implicit type casts can easily cause unexpected output 
in complicated queries... Even in pgsql, an array contain operator `@>` throws 
an exception for the query;
   ```
   postgres=# select ARRAY[1,2,3] @> '3';
   ERROR:  malformed array literal: "3"
   LINE 1: select ARRAY[1,2,3] @> '3';
                                  ^
   DETAIL:  Array value must start with "{" or dimension information.
   
   postgres=# select ARRAY[1,2,3] @> ARRAY['3'];
   ERROR:  operator does not exist: integer[] @> text[]
   LINE 1: select ARRAY[1,2,3] @> ARRAY['3'];
                               ^
   HINT:  No operator matches the given name and argument types. You might need 
to add explicit type casts.
   ```
   If users want to process this kind of queries, using explicit casts looks 
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.
 
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