citusdata / citusdata/citus

Re-partitioning does not support joins between different data types

Open
#2,106 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

After #1974, we no longer support joins between different data types. (Note that we used to create too many tasks to execute such queries, which seems not feasible in production systems.)

As of Citus 7.4:
```SQL
CREATE TABLE t_int (a int);
CREATE TABLE t_bigint (a bigint);

SELECT create_distributed_table('t_int', 'a');
SELECT create_distributed_table('t_bigint', 'a');

SET client_min_messages TO DEBUG1;
SELECT count(*) FROM t_int JOIN t_bigint USING(a);
DEBUG: dual partition column types do not match
DEBUG: dual partition column types do not match
ERROR: cannot perform distributed planning on this query
DETAIL: Cartesian products are currently unsupported
```

As we've very briefly chatted with @marcocitus two things needed:

* While doing the repartitioning, the projection columns should be casted (to the broader type). In the above example, cast `int` to `bigint`
* Use the hash function of the type that we've casted in the previous step

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.