Open rekby opened 4 months ago
It is similar to https://github.com/ydb-platform/ydb/issues/2957
PG equality operator is resolved correctly. The optimizer tries to use EquiJoin which can only handle equal types atm. The quick fix would be to not use EquiJoin if its LHS & RHS types aren't the same.
Here is the list of PG's = operators, which compare different types:
532, 533: int2 -> int4
1862, 1868: int2 -> int8
15, 416: int4 -> int8
254, 260: name -> text
353, : xid -> int4
1120, 1130: float4 -> float8
2347, 2373: date -> timestamp
2360, 2386: date -> timestamptz
2536, 2542: timestamp -> timestamptz
The first id is lhs -> rhs conversion, the second is that of rhs -> lhs conversion. There is no xid -> int4 cast in pg_cast.dat, this case will be fixed later.
Run with ydb-local https://github.com/ydb-platform/ydb/wiki/Local-run-postgres-tests
Result:
Expected result: