I have 2 tables in postgres, which are present in the separate schemas under same database.
While executing the SQL using the join between these 2 tables, getting the error as
table1 and table2 are not colocated
When checked the citus_shards table, both the tables are on same node, but the colocation id are different for both the tables.
citus.enable_repartition_joins is also set to true
Can someone please help?
-
Can someone please help?Pranav– Pranav2024年12月02日 08:28:50 +00:00Commented Dec 2, 2024 at 8:28
1 Answer 1
Colocation of the two tables table1 and table2 is a condition on the distribution of the outer join between these two tables. Therefore, when you try to run an outer join between table1 and table2, you are seeing that error.
To overcome that error, the tables should be colocated. This basically means that shards of the distributed table should match one to one, i.e. each shard of table1 should overlap with one and only one shard from table2. Different partition (distribution) column types between table1 and table2 is the most common reason of resulting in non-colocated tables.
So, you should make sure that table1 and table2 have the same partition column type.