diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/PgRegressBuilder.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/PgRegressBuilder.java index 5d30ee64431a7..c7a7dd9e16718 100644 --- a/java/yb-pgsql/src/test/java/org/yb/pgsql/PgRegressBuilder.java +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/PgRegressBuilder.java @@ -12,12 +12,6 @@ // package org.yb.pgsql; -import org.apache.commons.io.FileUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.yb.client.TestUtils; -import org.yb.util.SystemUtil; - import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -30,6 +24,12 @@ import java.util.Map; import java.util.TreeMap; +import org.apache.commons.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yb.client.TestUtils; +import org.yb.util.SystemUtil; + /** * Build a ProcessBuilder for pg_regress. Also, set up the output directory. */ @@ -99,6 +99,10 @@ public PgRegressBuilder setDirs(File inputDir, File outputDir) throws RuntimeExc // TODO(dmitry): Workaround for #1721, remove after fix. try { for (File f : (new File(outputDir, "sql")).listFiles()) { + if (f.isDirectory()) { + LOG.info("Skipping " + f.getAbsolutePath() + " because it is a directory"); + continue; + } if (!f.setWritable(true)) { throw new IOException("Couldn't set write permissions for " + f.getAbsolutePath()); } diff --git a/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressThirdPartyExtensionsHll.java b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressThirdPartyExtensionsHll.java new file mode 100644 index 0000000000000..e644969b77aca --- /dev/null +++ b/java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressThirdPartyExtensionsHll.java @@ -0,0 +1,36 @@ +// Copyright (c) YugaByte, Inc. +// +// Licensed 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. +// +package org.yb.pgsql; + +import java.io.File; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.yb.client.TestUtils; +import org.yb.util.YBTestRunnerNonTsanOnly; + +@RunWith(value=YBTestRunnerNonTsanOnly.class) +public class TestPgRegressThirdPartyExtensionsHll extends BasePgSQLTest { + @Override + public int getTestMethodTimeoutSec() { + return 1800; + } + + @Test + public void schedule() throws Exception { + File regress_schedule = new File( + TestUtils.getBuildRootDir(), + "postgres_build/third-party-extensions/postgresql-hll"); + runPgRegressTest(regress_schedule, "yb_schedule"); + } +} diff --git a/python/yb/build_postgres.py b/python/yb/build_postgres.py index a1eabc2d5877a..612cbbf28db21 100755 --- a/python/yb/build_postgres.py +++ b/python/yb/build_postgres.py @@ -354,7 +354,6 @@ def set_env_vars(self, step: str) -> None: '-Wimplicit-function-declaration', '-Wno-error=unused-function', '-DHAVE__BUILTIN_CONSTANT_P=1', - '-std=c11', '-Werror=implicit-function-declaration', '-Werror=int-conversion', ] diff --git a/python/yb/yb_dist_tests.py b/python/yb/yb_dist_tests.py index 4c15783a8717f..dff7f68eacad2 100644 --- a/python/yb/yb_dist_tests.py +++ b/python/yb/yb_dist_tests.py @@ -324,6 +324,7 @@ def set_global_conf_from_dict(global_conf_dict: Dict[str, str]) -> GlobalTestCon f'{POSTGRES_BUILD_SUBDIR}/contrib', f'{POSTGRES_BUILD_SUBDIR}/src/test/regress', f'{POSTGRES_BUILD_SUBDIR}/src/test/isolation', + f'{POSTGRES_BUILD_SUBDIR}/third-party-extensions', # Used by TestYsqlUpgrade. f'{POSTGRES_BUILD_SUBDIR}/src/include/catalog/pg_yb_migration.dat', diff --git a/src/postgres/third-party-extensions/Makefile b/src/postgres/third-party-extensions/Makefile index 291087d588f8f..d155a48108ace 100644 --- a/src/postgres/third-party-extensions/Makefile +++ b/src/postgres/third-party-extensions/Makefile @@ -1,4 +1,4 @@ -DIRS = pg_hint_plan orafce hypopg +DIRS = pg_hint_plan orafce hypopg postgresql-hll BUILDDIRS = $(DIRS:%=build-%) INSTALLDIRS = $(DIRS:%=install-%) CLEANDIRS = $(DIRS:%=clean-%) diff --git a/src/postgres/third-party-extensions/postgresql-hll/expected/hash.out b/src/postgres/third-party-extensions/postgresql-hll/expected/hash.out index 3201ad1299b10..1fa6f4638c13d 100644 --- a/src/postgres/third-party-extensions/postgresql-hll/expected/hash.out +++ b/src/postgres/third-party-extensions/postgresql-hll/expected/hash.out @@ -2,77 +2,77 @@ -- Misc Tests on Hash Function -- ---------------------------------------------------------------- SELECT hll_set_output_version(1); - hll_set_output_version + hll_set_output_version ------------------------ 1 (1 row) -- ---------------- boolean SELECT hll_hash_boolean(FALSE); - hll_hash_boolean + hll_hash_boolean --------------------- 5048724184180415669 (1 row) SELECT hll_hash_boolean(TRUE); - hll_hash_boolean + hll_hash_boolean --------------------- 8849112093580131862 (1 row) -- ---------------- smallint SELECT hll_hash_smallint(0::smallint); - hll_hash_smallint + hll_hash_smallint --------------------- 3478107235931676136 (1 row) SELECT hll_hash_smallint(100::smallint); - hll_hash_smallint + hll_hash_smallint --------------------- 4631120266694327276 (1 row) SELECT hll_hash_smallint(-100::smallint); - hll_hash_smallint + hll_hash_smallint --------------------- 5357168029120347761 (1 row) -- ---------------- integer SELECT hll_hash_integer(0); - hll_hash_integer + hll_hash_integer ---------------------- -3485513579396041028 (1 row) SELECT hll_hash_integer(100); - hll_hash_integer + hll_hash_integer ---------------------- -5003248654201747171 (1 row) SELECT hll_hash_integer(-100); - hll_hash_integer + hll_hash_integer ---------------------- -2771615523823720964 (1 row) -- ---------------- bigint SELECT hll_hash_bigint(0); - hll_hash_bigint + hll_hash_bigint --------------------- 2945182322382062539 (1 row) SELECT hll_hash_bigint(100); - hll_hash_bigint + hll_hash_bigint --------------------- 8349353095166695771 (1 row) SELECT hll_hash_bigint(-100); - hll_hash_bigint + hll_hash_bigint --------------------- -886862857196634693 (1 row) @@ -80,25 +80,25 @@ SELECT hll_hash_bigint(-100); -- ---------------- bytea -- Check some small values. SELECT hll_hash_bytea(E'\\x'); - hll_hash_bytea + hll_hash_bytea ---------------- 0 (1 row) SELECT hll_hash_bytea(E'\\x41'); - hll_hash_bytea + hll_hash_bytea -------------------- 243126998722523514 (1 row) SELECT hll_hash_bytea(E'\\x42'); - hll_hash_bytea + hll_hash_bytea ---------------------- -4837624800923759386 (1 row) SELECT hll_hash_bytea(E'\\x4142'); - hll_hash_bytea + hll_hash_bytea --------------------- 5365230931951287672 (1 row) @@ -106,25 +106,25 @@ SELECT hll_hash_bytea(E'\\x4142'); -- ---------------- text -- Check some small values. SELECT hll_hash_text(''); - hll_hash_text + hll_hash_text --------------- 0 (1 row) SELECT hll_hash_text('A'); - hll_hash_text + hll_hash_text -------------------- 243126998722523514 (1 row) SELECT hll_hash_text('B'); - hll_hash_text + hll_hash_text ---------------------- -4837624800923759386 (1 row) SELECT hll_hash_text('AB'); - hll_hash_text + hll_hash_text --------------------- 5365230931951287672 (1 row) @@ -132,21 +132,21 @@ SELECT hll_hash_text('AB'); -- ---------------- seed stuff -- Seed 0 ok. SELECT hll_hash_bigint(0, 0); - hll_hash_bigint + hll_hash_bigint --------------------- 2945182322382062539 (1 row) -- Positive seed ok. SELECT hll_hash_bigint(0, 1); - hll_hash_bigint + hll_hash_bigint --------------------- 8297479994805284640 (1 row) -- Max positive seed ok. SELECT hll_hash_bigint(0, 2147483647); - hll_hash_bigint + hll_hash_bigint ---------------------- -4042198036618575253 (1 row) @@ -154,7 +154,7 @@ SELECT hll_hash_bigint(0, 2147483647); -- WARNING: negative seed values not compatible SELECT hll_hash_bigint(0, -1); WARNING: negative seed values not compatible - hll_hash_bigint + hll_hash_bigint ---------------------- -8352849679461500862 (1 row) @@ -162,7 +162,7 @@ WARNING: negative seed values not compatible -- WARNING: negative seed values not compatible SELECT hll_hash_bigint(0, -2); WARNING: negative seed values not compatible - hll_hash_bigint + hll_hash_bigint ---------------------- -8080898605520838299 (1 row) @@ -170,7 +170,7 @@ WARNING: negative seed values not compatible -- WARNING: negative seed values not compatible SELECT hll_hash_bigint(0, -2147483648); WARNING: negative seed values not compatible - hll_hash_bigint + hll_hash_bigint --------------------- 8620050269462747046 (1 row) @@ -183,134 +183,134 @@ LINE 1: SELECT hll_hash_boolean(0, -1); HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT hll_hash_smallint(0::smallint, -1); WARNING: negative seed values not compatible - hll_hash_smallint + hll_hash_smallint --------------------- 1411828310742905942 (1 row) SELECT hll_hash_integer(0, -1); WARNING: negative seed values not compatible - hll_hash_integer + hll_hash_integer --------------------- 7867003898269499267 (1 row) SELECT hll_hash_bigint(0, -1); WARNING: negative seed values not compatible - hll_hash_bigint + hll_hash_bigint ---------------------- -8352849679461500862 (1 row) SELECT hll_hash_bytea(E'\\x', -1); WARNING: negative seed values not compatible - hll_hash_bytea + hll_hash_bytea --------------------- 7706185961851046380 (1 row) SELECT hll_hash_text('AB', -1); WARNING: negative seed values not compatible - hll_hash_text + hll_hash_text ---------------------- -6228783906452318195 (1 row) -- ---------------- Matches SELECT hll_hash_boolean(FALSE, 0), hll_hash_bytea(E'\\x00', 0); - hll_hash_boolean | hll_hash_bytea + hll_hash_boolean | hll_hash_bytea ---------------------+--------------------- 5048724184180415669 | 5048724184180415669 (1 row) SELECT hll_hash_boolean(TRUE, 0), hll_hash_bytea(E'\\x01', 0); - hll_hash_boolean | hll_hash_bytea + hll_hash_boolean | hll_hash_bytea ---------------------+--------------------- 8849112093580131862 | 8849112093580131862 (1 row) SELECT hll_hash_smallint(0::smallint, 0), hll_hash_bytea(E'\\x0000', 0); - hll_hash_smallint | hll_hash_bytea + hll_hash_smallint | hll_hash_bytea ---------------------+--------------------- 3478107235931676136 | 3478107235931676136 (1 row) SELECT hll_hash_integer(0, 0), hll_hash_bytea(E'\\x00000000', 0); - hll_hash_integer | hll_hash_bytea + hll_hash_integer | hll_hash_bytea ----------------------+---------------------- -3485513579396041028 | -3485513579396041028 (1 row) SELECT hll_hash_bigint(0, 0), hll_hash_bytea(E'\\x0000000000000000', 0); - hll_hash_bigint | hll_hash_bytea + hll_hash_bigint | hll_hash_bytea ---------------------+--------------------- 2945182322382062539 | 2945182322382062539 (1 row) SELECT hll_hash_bytea(E'\\x4142', 0), hll_hash_text('AB', 0); - hll_hash_bytea | hll_hash_text + hll_hash_bytea | hll_hash_text ---------------------+--------------------- 5365230931951287672 | 5365230931951287672 (1 row) -- ---------------- Default seed = 0 SELECT hll_hash_boolean(TRUE) = hll_hash_boolean(TRUE, 0); - ?column? + ?column? ---------- t (1 row) SELECT hll_hash_smallint(100::smallint) = hll_hash_smallint(100::smallint, 0); - ?column? + ?column? ---------- t (1 row) SELECT hll_hash_integer(100) = hll_hash_integer(100, 0); - ?column? + ?column? ---------- t (1 row) SELECT hll_hash_bigint(100) = hll_hash_bigint(100, 0); - ?column? + ?column? ---------- t (1 row) SELECT hll_hash_bytea(E'\\x42') = hll_hash_bytea(E'\\x42', 0); - ?column? + ?column? ---------- t (1 row) SELECT hll_hash_text('AB') = hll_hash_text('AB', 0); - ?column? + ?column? ---------- t (1 row) -- ---------------- Explicit casts work for already hashed numbers. SELECT hll_empty() || 42::hll_hashval; - ?column? + ?column? -------------------------- \x128b7f000000000000002a (1 row) SELECT hll_empty() || CAST(42 AS hll_hashval); - ?column? + ?column? -------------------------- \x128b7f000000000000002a (1 row) SELECT hll_empty() || 42::bigint::hll_hashval; - ?column? + ?column? -------------------------- \x128b7f000000000000002a (1 row) SELECT hll_empty() || CAST(42 AS bigint)::hll_hashval; - ?column? + ?column? -------------------------- \x128b7f000000000000002a (1 row) @@ -320,9 +320,9 @@ SELECT hll_empty() || 42; ERROR: operator does not exist: hll || integer LINE 1: SELECT hll_empty() || 42; ^ -HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. SELECT hll_empty() || 42::bigint; ERROR: operator does not exist: hll || bigint LINE 1: SELECT hll_empty() || 42::bigint; ^ -HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. diff --git a/src/postgres/third-party-extensions/postgresql-hll/sql/setup.sql b/src/postgres/third-party-extensions/postgresql-hll/sql/setup.sql index 062ab5599127d..1b8551464912a 100644 --- a/src/postgres/third-party-extensions/postgresql-hll/sql/setup.sql +++ b/src/postgres/third-party-extensions/postgresql-hll/sql/setup.sql @@ -5,3 +5,4 @@ ALTER EXTENSION hll UPDATE TO '2.13'; ALTER EXTENSION hll UPDATE TO '2.14'; ALTER EXTENSION hll UPDATE TO '2.15'; ALTER EXTENSION hll UPDATE TO '2.16'; +ALTER EXTENSION hll UPDATE TO '2.17'; diff --git a/src/postgres/third-party-extensions/postgresql-hll/yb_schedule b/src/postgres/third-party-extensions/postgresql-hll/yb_schedule new file mode 100644 index 0000000000000..cbffe34aeee6e --- /dev/null +++ b/src/postgres/third-party-extensions/postgresql-hll/yb_schedule @@ -0,0 +1,43 @@ +# third-party-extensions/postgresql-hll/yb_schedule +# +#################################################################################################### +# HLL Extension Testsuites +# The following changes were made from the upstream repo: +# - `CREATE EXTENSION hll` added to the top of the first test (add_agg) +# +#################################################################################################### +test: setup +test: add_agg +test: agg_oob +test: auto_sparse +test: card_op +test: cast_shape +test: copy_binary +test: cumulative_add_cardinality_correction +test: cumulative_add_comprehensive_promotion +test: cumulative_add_sparse_edge +test: cumulative_add_sparse_random +test: cumulative_add_sparse_step +test: cumulative_union_comprehensive +test: cumulative_union_explicit_explicit +test: cumulative_union_explicit_promotion +test: cumulative_union_probabilistic_probabilistic +test: cumulative_union_sparse_full_representation +test: cumulative_union_sparse_promotion +test: cumulative_union_sparse_sparse +test: disable_hashagg +test: equal +test: explicit_thresh +test: hash +test: hash_any +test: meta_func +test: murmur_bigint +test: murmur_bytea +test: nosparse +test: notequal +test: scalar_oob +test: storedproc +test: transaction +test: typmod +test: typmod_insert +test: union_op