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 2019/12/09 14:52:26 UTC

[GitHub] [spark] maropu commented on issue #26811: [SPARK-29600][SQL] array_contains built in function is not backward compatible in 3.0

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org