GBase 8c V3.0.0数据类型——HLL函数和操作符(操作符)

  • Post author:
  • Post category:其他


  1. =

描述:比较hll或hll_hashval的值是否相等。

返回值类型:bool

示例:

–hll

gbase=#

select (hll_empty() || hll_hash_integer(1)) = (hll_empty() || hll_hash_integer(1));

?column?

———-

t

(1 row)

–hll_hashval

gbase=# select hll_hash_integer(1) = hll_hash_integer(1);

?column?

———-

t

(1 row)

  1. <> or !=

描述:比较hll或hll_hashval是否不相等。

返回值类型:bool

示例:

–hll

gbase=#

select (hll_empty() || hll_hash_integer(1)) <> (hll_empty() || hll_hash_integer(2));

?column?

———-

t

(1 row)

–hll_hashval

gbase=#

select hll_hash_integer(1) <> hll_hash_integer(2);

?column?

———-

t

(1 row)

  1. ||

描述:可代表hll_add、hll_union、hll_add_rev三个函数的功能。

返回值类型:hll

示例:

–hll_add

gbase=#

select hll_empty() || hll_hash_integer(1);

?column?

—————————————————————————-

\x484c4c08000002002b0900000000000000f03f3e2921ff133fbaed3e2921ff133fbaed00

(1 row)

–hl_add_rev

gbase=#

select hll_hash_integer(1) || hll_empty();

?column?

—————————————————————————-

\x484c4c08000002002b0900000000000000f03f3e2921ff133fbaed3e2921ff133fbaed00

(1 row)

–hll_union

gbase=#

select (hll_empty() || hll_hash_integer(1)) || (hll_empty() || hll_hash_integer(2));

?column?

——————————————————————————————–

\x484c4c10002000002b090000000000000000400000000000000000b3ccc49320cca1ae3e2921ff133fbaed00

(1 row)

  1. #

描述:计算出hll的Dintinct值, 同hll_cardinality函数。

返回值类型:int

示例:

gbase=#

select #(hll_empty() || hll_hash_integer(1));

?column?

———-

1

(1 row)



版权声明:本文为futianxia061112原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。