jayzhan211 commented on code in PR #10268:
URL: https://github.com/apache/datafusion/pull/10268#discussion_r1589198958


##########
datafusion/sqllogictest/test_files/coalesce.slt:
##########
@@ -209,28 +209,20 @@ select
 [3, 4] List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 
0, dict_is_ordered: false, metadata: {} })
 
 # TODO: after switch signature of array to the same with coalesce, this query 
should be fixed
-query ?T
+query error
 select
   coalesce(array[1, 2], array[arrow_cast(3, 'Int32'), arrow_cast(4, 'Int32')]),
   arrow_typeof(coalesce(array[1, 2], array[arrow_cast(3, 'Int32'), 
arrow_cast(4, 'Int32')]));
-----
-[1, 2] List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 
0, dict_is_ordered: false, metadata: {} })
 
 statement ok
 create table test1 as values (arrow_cast('foo', 'Dictionary(Int32, Utf8)')), 
(null);
 
 # Dictionary and String are not coercible
-query ?
+query error

Review Comment:
   In Postgres, dictionary type (composite type including struct) is not 
implicitly cast to another numeric type, so is DuckdDB.
   
   For example,
   ```
   postgres=# select array[row(1, 'a'), 'b'];
   ERROR:  input of anonymous composite types is not implemented
   LINE 1: select array[row(1, 'a'), 'b'];
                                     ^
   postgres=# select array[row(1, 'a')::TEXT, 'b'];
       array    
   -------------
    {"(1,a)",b}
   (1 row)
   ```
   
   But, given it is already used heavily and implicitly casting between these 
types is not a big issue, I agree we can keep it unchanged.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to