Pivotal Knowledge Base

Follow

Greenplum Error: "No Equality Operator for Typid 705(cdbmutate.c:1187)"

Environment

 Product  Version
 Pivotal Greenplum  4.3.x
 OS  All Supported OS

Symptom

Sometimes, when we create a table, we see the following error:

testDB=# create table test_error as select '1' as id distributed by (id);
ERROR: no equality operator for typid 705 (cdbmutate.c:1179)

Analysis

So Firstly, let's look at what type 705 is:

testDB=# select 705::regtype ;
regtype
---------
unknown
ERROR: no equality operator for typid 705 (cdbmutate.c:1179)

We can see that the type name is 'unknown.' This is the key point for finding the cause.

Cause

In our example, column ID is an unknown type, and meanwhile, it is also the distribution key of the table. We know data is distributed across segments based on the HASH algorithm, which uses equality operator to compare the value of the column. As column ID is an unknown type, the equality operator fails to work and then an error is given. So the solution is to define a type to the column.

Resolution

Manually define the type of the column ID when creating the table: 

testDB=# create table test_error as select '1'::varchar(20) as id distributed by (id);
SELECT 1

Comments

Powered by Zendesk