数据仓库服务 GAUSSDB(DWS)-执行业务报错could not determine which collation to use for string hashing:问题现象

时间:2024-05-07 20:29:47

问题现象

执行SELECT查询时报错could not determine which collation to use for string hashing。

1
2
3
4
5
6
CREATE TABLE t(a text collate "C", b text collate case_insensitive);
INSERT INTO t VALUES('Hello','world');
——计算ifnull(a,b)的值的哈希值
SELECT hashtext(ifnull(a,b)) FROM t;
ERROR:  dn_6005_6006: could not determine which collation to use for string hashing.
HINT:  Use the COLLATE clause to set the collation explicitly.

hashtext函数用于计算适当数据类型的值的哈希值。此处仅用作示例说明出现collate冲突时应该如何解决。

support.huaweicloud.com/trouble-dws/dws_09_0128.html