Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big endian support for PG 16 #1894

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ DATA_built = $(age_sql)
REGRESS = scan \
graphid \
agtype \
agtype_hash_cmp \
catalog \
cypher \
expr \
Expand Down
163 changes: 0 additions & 163 deletions regress/expected/agtype.out
Original file line number Diff line number Diff line change
Expand Up @@ -3577,169 +3577,6 @@ SELECT agtype_string_match_contains('"abcdefghijklmnopqrstuvwxyz"', '"hijl"');
false
(1 row)

--Agtype Hash Comparison Function
SELECT agtype_hash_cmp(NULL);
agtype_hash_cmp
-----------------
0
(1 row)

SELECT agtype_hash_cmp('1'::agtype);
agtype_hash_cmp
-----------------
-123017199
(1 row)

SELECT agtype_hash_cmp('1.0'::agtype);
agtype_hash_cmp
-----------------
614780178
(1 row)

SELECT agtype_hash_cmp('"1"'::agtype);
agtype_hash_cmp
-----------------
-888576106
(1 row)

SELECT agtype_hash_cmp('[1]'::agtype);
agtype_hash_cmp
-----------------
434414509
(1 row)

SELECT agtype_hash_cmp('[1, 1]'::agtype);
agtype_hash_cmp
-----------------
-1551022880
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
-3900769
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
1756986519
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
-47741579
(1 row)

SELECT agtype_hash_cmp('[[1]]'::agtype);
agtype_hash_cmp
-----------------
878744030
(1 row)

SELECT agtype_hash_cmp('[[1, 1]]'::agtype);
agtype_hash_cmp
-----------------
-1254522284
(1 row)

SELECT agtype_hash_cmp('[[1], 1]'::agtype);
agtype_hash_cmp
-----------------
-1005036
(1 row)

SELECT agtype_hash_cmp('[1543872]'::agtype);
agtype_hash_cmp
-----------------
-1925093371
(1 row)

SELECT agtype_hash_cmp('[1, "abcde", 2.0]'::agtype);
agtype_hash_cmp
-----------------
-1128310748
(1 row)

SELECT agtype_hash_cmp(agtype_in('null'));
agtype_hash_cmp
-----------------
-505290271
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null]'));
agtype_hash_cmp
-----------------
505290241
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null]'));
agtype_hash_cmp
-----------------
3
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null]'));
agtype_hash_cmp
-----------------
2021160967
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null, null]'));
agtype_hash_cmp
-----------------
15
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null, null, null]'));
agtype_hash_cmp
-----------------
-505290721
(1 row)

SELECT agtype_hash_cmp('{"id":1, "label":"test", "properties":{"id":100}}'::agtype);
agtype_hash_cmp
-----------------
1116453668
(1 row)

SELECT agtype_hash_cmp('{"id":1, "label":"test", "properties":{"id":100}}::vertex'::agtype);
agtype_hash_cmp
-----------------
1848106598
(1 row)

SELECT agtype_hash_cmp('{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}'::agtype);
agtype_hash_cmp
-----------------
1064722414
(1 row)

SELECT agtype_hash_cmp('{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge'::agtype);
agtype_hash_cmp
-----------------
-1790838958
(1 row)

SELECT agtype_hash_cmp('
[{"id":1, "label":"test", "properties":{"id":100}}::vertex,
{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge,
{"id":5, "label":"vlabel", "properties":{}}::vertex]'::agtype);
agtype_hash_cmp
-----------------
-231467898
(1 row)

SELECT agtype_hash_cmp('
[{"id":1, "label":"test", "properties":{"id":100}}::vertex,
{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge,
{"id":5, "label":"vlabel", "properties":{}}::vertex]::path'::agtype);
agtype_hash_cmp
-----------------
843330291
(1 row)

--Agtype BTree Comparison Function
SELECT agtype_btree_cmp('1'::agtype, '1'::agtype);
agtype_btree_cmp
Expand Down
187 changes: 187 additions & 0 deletions regress/expected/agtype_hash_cmp.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
--
-- AGTYPE data type regression tests
--
SET search_path TO ag_catalog;
-- Agtype Hash Comparison Function
-- Result value varies depending on architecture endianness.
-- Little endian output is in agtype_hash_cmp.out; big endian in agtype_hash_cmp_1.out.
SELECT agtype_hash_cmp(NULL);
agtype_hash_cmp
-----------------
0
(1 row)

SELECT agtype_hash_cmp('1'::agtype);
agtype_hash_cmp
-----------------
-123017199
(1 row)

SELECT agtype_hash_cmp('1.0'::agtype);
agtype_hash_cmp
-----------------
614780178
(1 row)

SELECT agtype_hash_cmp('"1"'::agtype);
agtype_hash_cmp
-----------------
-888576106
(1 row)

SELECT agtype_hash_cmp('[1]'::agtype);
agtype_hash_cmp
-----------------
434414509
(1 row)

SELECT agtype_hash_cmp('[1, 1]'::agtype);
agtype_hash_cmp
-----------------
-1551022880
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
-3900769
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
1756986519
(1 row)

SELECT agtype_hash_cmp('[1, 1, 1, 1, 1]'::agtype);
agtype_hash_cmp
-----------------
-47741579
(1 row)

SELECT agtype_hash_cmp('[[1]]'::agtype);
agtype_hash_cmp
-----------------
878744030
(1 row)

SELECT agtype_hash_cmp('[[1, 1]]'::agtype);
agtype_hash_cmp
-----------------
-1254522284
(1 row)

SELECT agtype_hash_cmp('[[1], 1]'::agtype);
agtype_hash_cmp
-----------------
-1005036
(1 row)

SELECT agtype_hash_cmp('[1543872]'::agtype);
agtype_hash_cmp
-----------------
-1925093371
(1 row)

SELECT agtype_hash_cmp('[1, "abcde", 2.0]'::agtype);
agtype_hash_cmp
-----------------
-1128310748
(1 row)

SELECT agtype_hash_cmp(agtype_in('null'));
agtype_hash_cmp
-----------------
-505290271
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null]'));
agtype_hash_cmp
-----------------
505290241
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null]'));
agtype_hash_cmp
-----------------
3
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null]'));
agtype_hash_cmp
-----------------
2021160967
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null, null]'));
agtype_hash_cmp
-----------------
15
(1 row)

SELECT agtype_hash_cmp(agtype_in('[null, null, null, null, null]'));
agtype_hash_cmp
-----------------
-505290721
(1 row)

SELECT agtype_hash_cmp('{"id":1, "label":"test", "properties":{"id":100}}'::agtype);
agtype_hash_cmp
-----------------
1116453668
(1 row)

SELECT agtype_hash_cmp('{"id":1, "label":"test", "properties":{"id":100}}::vertex'::agtype);
agtype_hash_cmp
-----------------
1848106598
(1 row)

SELECT agtype_hash_cmp('{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}'::agtype);
agtype_hash_cmp
-----------------
1064722414
(1 row)

SELECT agtype_hash_cmp('{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge'::agtype);
agtype_hash_cmp
-----------------
-1790838958
(1 row)

SELECT agtype_hash_cmp('
[{"id":1, "label":"test", "properties":{"id":100}}::vertex,
{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge,
{"id":5, "label":"vlabel", "properties":{}}::vertex]'::agtype);
agtype_hash_cmp
-----------------
-231467898
(1 row)

SELECT agtype_hash_cmp('
[{"id":1, "label":"test", "properties":{"id":100}}::vertex,
{"id":2, "start_id":1, "end_id": 3, "label":"elabel", "properties":{}}::edge,
{"id":5, "label":"vlabel", "properties":{}}::vertex]::path'::agtype);
agtype_hash_cmp
-----------------
843330291
(1 row)

Loading
Loading