1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
-- ----------------------------------------------------------------
-- Misc Tests on hash_any Function
-- ----------------------------------------------------------------
SELECT hll_set_output_version(1);
hll_set_output_version
------------------------
1
(1 row)
-- ---------------- Check hash and hash_any function results match
SELECT hll_hash_boolean(FALSE) = hll_hash_any(FALSE);
?column?
----------
t
(1 row)
SELECT hll_hash_boolean(TRUE) = hll_hash_any(TRUE);
?column?
----------
t
(1 row)
SELECT hll_hash_smallint(0::smallint) = hll_hash_any(0::smallint);
?column?
----------
t
(1 row)
SELECT hll_hash_smallint(100::smallint) = hll_hash_any(100::smallint);
?column?
----------
t
(1 row)
SELECT hll_hash_smallint(-100::smallint) = hll_hash_any(-100::smallint);
?column?
----------
t
(1 row)
SELECT hll_hash_integer(0) = hll_hash_any(0);
?column?
----------
t
(1 row)
SELECT hll_hash_integer(100) = hll_hash_any(100);
?column?
----------
t
(1 row)
SELECT hll_hash_integer(-100) = hll_hash_any(-100);
?column?
----------
t
(1 row)
SELECT hll_hash_bigint(0) = hll_hash_any(0::bigint);
?column?
----------
t
(1 row)
SELECT hll_hash_bigint(100) = hll_hash_any(100::bigint);
?column?
----------
t
(1 row)
SELECT hll_hash_bigint(-100) = hll_hash_any(-100::bigint);
?column?
----------
t
(1 row)
SELECT hll_hash_bytea(E'\\x') = hll_hash_any(E'\\x'::bytea);
?column?
----------
t
(1 row)
SELECT hll_hash_bytea(E'\\x41') = hll_hash_any(E'\\x41'::bytea);
?column?
----------
t
(1 row)
SELECT hll_hash_bytea(E'\\x42') = hll_hash_any(E'\\x42'::bytea);
?column?
----------
t
(1 row)
SELECT hll_hash_bytea(E'\\x4142') = hll_hash_any(E'\\x4142'::bytea);
?column?
----------
t
(1 row)
SELECT hll_hash_text('') = hll_hash_any(''::text);
?column?
----------
t
(1 row)
SELECT hll_hash_text('A') = hll_hash_any('A'::text);
?column?
----------
t
(1 row)
SELECT hll_hash_text('B') = hll_hash_any('B'::text);
?column?
----------
t
(1 row)
SELECT hll_hash_text('AB') = hll_hash_any('AB'::text);
?column?
----------
t
(1 row)
-- ---------------- Check several types not handled by default hash functions
-- ---------------- macaddr
SELECT hll_hash_any('08:00:2b:01:02:03'::macaddr);
hll_hash_any
----------------------
-4883882473551067169
(1 row)
SELECT hll_hash_any('08002b010203'::macaddr);
hll_hash_any
----------------------
-4883882473551067169
(1 row)
SELECT hll_hash_any('01-23-45-67-89-ab'::macaddr);
hll_hash_any
---------------------
3974616115244794976
(1 row)
SELECT hll_hash_any('012345-6789ab'::macaddr);
hll_hash_any
---------------------
3974616115244794976
(1 row)
-- ---------------- interval
SELECT hll_hash_any('1 year 2 months 3 days 4 hours 5 minutes 6seconds'::interval);
hll_hash_any
---------------------
1647734813508782007
(1 row)
SELECT hll_hash_any('P1Y2M3DT4H5M6S'::interval);
hll_hash_any
---------------------
1647734813508782007
(1 row)
SELECT hll_hash_any('1997-06 20 12:00:00'::interval);
hll_hash_any
---------------------
3706410791461549552
(1 row)
SELECT hll_hash_any('P1997-06-20T12:00:00'::interval);
hll_hash_any
---------------------
3706410791461549552
(1 row)
|