Greenplum中null是不可比较的,因此也没有类似Hive中的<=>,所谓完全相等比较符。但是,Greenplum中可以创建自定义操作符,实现也很简单:
create or replace function fn_exactly_equal(left_o anyelement, right_o anyelement) returns boolean as
$$
select left_o is null and right_o is null or (left_o is not null and right_o is not null and left_o = right_o)
$$
language sql;
create operator <=> (procedure = fn_exactly_equal, leftarg = anyelement, rightarg = anyelement, commutator = <=>);