Phillip Cloud

Results 993 comments of Phillip Cloud

It seems that even when casting both sides of `||` duckdb says the column type is `int32`: ``` >>> duckdb.sql("select cast([1] as int32[]) || cast(null as int32[]) as hmmmm") ┌───────┐...

That's the behavior I would expect from both, modulo the incorrect output type of `||`.

Well, even `||` is inconsistent: ``` >>> duckdb.sql("select a || a from (select cast(null as int32[]) as a)") ┌──────────┐ │ (a || a) │ │ int32[] │ ├──────────┤ │ []...

There's also this strange behavior where giving `null` a type changes the behavior of the function entirely: ```>>> import duckdb >>> duckdb.sql("select list_concat(cast(null as int32[]), cast(null as int32[])) typed, list_concat(null,...

What I really want is a list concat function that always propagates nulls, regardless of whether the value is a literal. Is that possible?

It's possible by doing something like: 1. construct a list of lists 2. return null if any are null 3. concatenate the non-null lists This seems like it would be...

FWIW, prior to 1.1.3, `list_concat` seemed to behave as I wanted it to.

https://github.com/duckdb/duckdb/pull/14443 seems to have made significant changes to `list_concat`'s code.

@Mytherin Thanks! > In that example the type is NULL, which is converted to int32 when converting the result as DuckDB does not allow the NULL type to appear in...

Yep, I think I just forgot about postgres's weirdness combined with the desire for compatibility with it. Sorry to keep relitigating the past!