Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on April 20, 2022 3:57PM
Likes: 0
Replies: 3
I'm trying to join tables based on ID but I'm getting " ERROR: operator does not exist: uuid = text Hint: No operator matches the given name and argument types. You might need to add explicit type casts." But both of the columns I'm trying to match are of type string except that one of them is named ID and the other is not. Can someone help, please?
Operating system used: Windows
Hi @jvijayakumar2
,
The error `ERROR: operator does not exist: uuid = text Hint: No operator matches the given name and argument types. You might need to add explicit type casts` means a string/text datatype operator is attempting to be applied to a uuid datatype.
Example:
Consider the following tables in Postgres:
mike=# \d t; Table "public.t" Column | Type | Collation | Nullable | Default --------+---------------+-----------+----------+--------- id | uuid | | | [...] mike=# \d t2; Table "public.t2" Column | Type | Collation | Nullable | Default --------+---------------+-----------+----------+--------- id | text | | | [...]
Note:
If I use a join visual recipe to join these datasets using `id` as the join condition AND I use the `In-database (SQL)` Recipe engine I will receive the following error:
ERROR: operator does not exist: uuid = text Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
This is because we are attempting to compare two different datatypes (text and uuid) inside of Postgres which is not allowed.
You can work around the issue by doing one of the following:
Note: I understand you mentioned both columns are of type string (I’m assuming this is what you see when looking at the data in the Explore tab of DSS) however since the operation is by default being performed in the underlying storage (i.e. `In-database (SQL)`) it's the datatypes in the underlying storage which come into play.
Thank you,
Mike
Great tip this : "use Pre-join computed columns section of the join recipe to cast the id column", that will help bringing some efficiency in my flows. Thanx @MikeG
Thanks @MikeG
! Using "Pre-join computed columns section" works!