jayzhan211 commented on issue #12843:
URL: https://github.com/apache/datafusion/issues/12843#issuecomment-2406247191

   ```
   D create table t(s1 struct(a int, b varchar), s2 struct(a float, b varchar));
   D insert into t values (row(1, 'r'), row(2.2, 'b'));
   D select [s1, s2] from t;
   ┌──────────────────────────────────────────┐
   │         main.list_value(s1, s2)          │
   │       struct(a float, b varchar)[]       │
   ├──────────────────────────────────────────┤
   │ [{'a': 1.0, 'b': r}, {'a': 2.2, 'b': b}] │
   └──────────────────────────────────────────┘
   D select coalesce(s1, s2) from t;
   ┌────────────────────────────┐
   │      COALESCE(s1, s2)      │
   │ struct(a float, b varchar) │
   ├────────────────────────────┤
   │ {'a': 1.0, 'b': r}         │
   └────────────────────────────┘
   D select typeof(s1) from t;
   ┌──────────────────────────────┐
   │          typeof(s1)          │
   │           varchar            │
   ├──────────────────────────────┤
   │ STRUCT(a INTEGER, b VARCHAR) │
   └──────────────────────────────┘
   ```
   
   Coercion rule is so inconsistent, array and coalesce converts int to float, 
but values doesn't


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