findepi opened a new issue, #12291:
URL: https://github.com/apache/datafusion/issues/12291
### Describe the bug
`Int64` and `timestamp with time zone` are not coercible:
```
> SELECT 2 x UNION ALL SELECT now() x;
type_coercion
caused by
Error during planning: Incompatible inputs for Union: Previous inputs were
of type Int64, but got incompatible type Timestamp(Nanosecond, Some("+00:00"))
on column 'x'
```
yet, the arrays of these types are
```
> SELECT make_array(2) x UNION ALL SELECT make_array(now()) x;
+-----------------------+
| x |
+-----------------------+
| [2] |
| [1725282161929740000] |
+-----------------------+
```
```
> SELECT make_array(now()) x UNION ALL SELECT make_array(2) x;
+----------------------------------+
| x |
+----------------------------------+
| [1970-01-01T00:00:00.000000002Z] |
| [2024-09-02T13:03:02.257080Z] |
+----------------------------------+
```
### To Reproduce
```
SELECT make_array(2) x UNION ALL SELECT make_array(now()) x;
```
### Expected behavior
Failure, because array element types cannot be coerced.
### Additional context
_No response_
--
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]