diff --git a/.github/workflows/pxf-ci.yml b/.github/workflows/pxf-ci.yml index 6109bd777..9bf690bd8 100644 --- a/.github/workflows/pxf-ci.yml +++ b/.github/workflows/pxf-ci.yml @@ -40,7 +40,7 @@ env: JAVA_HOME: "/usr/lib/jvm/java-11-openjdk" GO_VERSION: "1.25" GPHOME: "/usr/local/cloudberry-db" - CLOUDBERRY_VERSION: "REL_2_STABLE" + CLOUDBERRY_VERSION: "main" PXF_HOME: "/usr/local/pxf" jobs: diff --git a/automation/src/main/resources/testcontainers/pxf-cbdb/script/build_pxf.sh b/automation/src/main/resources/testcontainers/pxf-cbdb/script/build_pxf.sh index 350cc91f1..5833234c0 100755 --- a/automation/src/main/resources/testcontainers/pxf-cbdb/script/build_pxf.sh +++ b/automation/src/main/resources/testcontainers/pxf-cbdb/script/build_pxf.sh @@ -19,6 +19,7 @@ # # -------------------------------------------------------------------- # Build and install PXF — works on both Ubuntu and Rocky/RHEL +set -euo pipefail # Auto-detect Java 11 path if [ -d /usr/lib/jvm/java-11-openjdk-amd64 ]; then @@ -45,8 +46,13 @@ sudo chmod -R a+rwX "$PXF_HOME" # Build and Install PXF cd /home/gpadmin/workspace/cloudberry-pxf -make -C external-table install -make -C fdw install +# external-table and fdw are native extensions; the automation harness copies +# the host repo (including any binaries the host already built) into this +# container, so a plain `make install` would silently reuse a .so linked +# against the host's glibc instead of rebuilding for this container's glibc. +# Force a clean rebuild here. +make -C external-table clean install +make -C fdw clean install make -C server install-server make -C server install-jdbc-drivers diff --git a/ci/docker/pxf-cbdb-dev/common/script/build_cloudberrry.sh b/ci/docker/pxf-cbdb-dev/common/script/build_cloudberrry.sh index 854048339..b229473c4 100755 --- a/ci/docker/pxf-cbdb-dev/common/script/build_cloudberrry.sh +++ b/ci/docker/pxf-cbdb-dev/common/script/build_cloudberrry.sh @@ -19,6 +19,7 @@ # # -------------------------------------------------------------------- # Build Cloudberry from source — works on both Ubuntu and Rocky/RHEL +set -euo pipefail # Install sudo & git if command -v apt-get >/dev/null 2>&1; then @@ -182,8 +183,27 @@ cd ~/workspace/cloudberry --with-includes=/usr/include/xercesc # Build and install Cloudberry and its contrib modules +# generated-headers recreates the lwlocknames.h/catalog/utils header +# symlinks that "make install" copies but doesn't itself recreate; a prior +# "make distclean" or a from-scratch checkout leaves them missing, which +# fails install-include-recurse. -B is required: make's dependency +# tracking only looks at the source file's mtime, so if the symlink +# itself was deleted but its source is unchanged, a plain +# `make generated-headers` reports "Nothing to be done" without +# recreating it. +make -B -C ~/workspace/cloudberry/src/backend generated-headers make -j$(nproc) -C ~/workspace/cloudberry make -j$(nproc) -C ~/workspace/cloudberry/contrib +# src/include/parser/gram.h -> src/backend/parser/gram.h is *not* covered +# by any "generated-headers"-style Make target in this tree; it's expected +# to persist across builds and is only ever created here, once, out of +# band. A from-scratch checkout (or anything that runs distclean) has no +# such symlink, which fails "make install"'s header-copy loop with +# "cannot stat './parser/gram.h'" (a dangling symlink still matches a +# glob, so install() tries and fails to stat() through it). Real CI never +# hits this because it installs from a pre-built .deb instead of building +# from source here. +ln -sf ../../backend/parser/gram.h ~/workspace/cloudberry/src/include/parser/gram.h make install -C ~/workspace/cloudberry make install -C ~/workspace/cloudberry/contrib diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c index 986da2818..c8bececb8 100644 --- a/external-table/src/gpdbwritableformatter.c +++ b/external-table/src/gpdbwritableformatter.c @@ -45,6 +45,7 @@ #include "utils/syscache.h" #include "utils/lsyscache.h" +#include #include #include "access/external.h" diff --git a/external-table/src/pxfuriparser.c b/external-table/src/pxfuriparser.c index 47fce006c..24860c035 100644 --- a/external-table/src/pxfuriparser.c +++ b/external-table/src/pxfuriparser.c @@ -21,6 +21,18 @@ #include "pxfutils.h" #include "utils/formatting.h" +/* + * PostgreSQL 16 split the generic Value node into distinct Integer/Float/ + * String/etc. node types; makeString()/strVal() now operate on String * + * instead of Value *. Cloudberry versions built on pre-16 Postgres bases + * (e.g. PG14) still use the old Value type, so alias to whichever exists. + */ +#if PG_VERSION_NUM >= 160000 +typedef String PxfStringNode; +#else +typedef Value PxfStringNode; +#endif + static const char *PTC_SEP = "://"; static const char *OPTION_SEP = "&"; static const int EMPTY_VALUE_LEN = 2; @@ -291,7 +303,7 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri) { OptionData *data = (OptionData *) lfirst(option); - Value *key = makeString(asc_toupper(data->key, strlen(data->key))); + PxfStringNode *key = makeString(asc_toupper(data->key, strlen(data->key))); if (!list_member(previousKeys, key)) previousKeys = lappend(previousKeys, key); @@ -308,7 +320,7 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri) initStringInfo(&duplicates); foreach(key, duplicateKeys) { - char *keyname = strVal((Value *) lfirst(key)); + char *keyname = strVal((PxfStringNode *) lfirst(key)); if (!first) appendStringInfoString(&duplicates, ", "); diff --git a/external-table/test/pxfprotocol_test.c b/external-table/test/pxfprotocol_test.c index f19e6aebd..95b5ac52c 100644 --- a/external-table/test/pxfprotocol_test.c +++ b/external-table/test/pxfprotocol_test.c @@ -47,7 +47,7 @@ test_pxfprotocol_validate_urls(void **state) PG_FUNCTION_ARGS = palloc0(sizeof(FunctionCallInfoData)); fcinfo->context = palloc0(sizeof(ExtProtocolValidatorData)); fcinfo->context->type = T_ExtProtocolValidatorData; - Value *v = makeString(uri_no_profile); + PxfStringNode *v = makeString(uri_no_profile); List *list = list_make1(v); ((ExtProtocolValidatorData *) fcinfo->context)->url_list = list; diff --git a/fdw/pxf_option.c b/fdw/pxf_option.c index 13ccfe92a..fedf61dff 100644 --- a/fdw/pxf_option.c +++ b/fdw/pxf_option.c @@ -21,6 +21,18 @@ #include "foreign/foreign.h" #include "mb/pg_wchar.h" +/* + * PostgreSQL 16 split the generic Value node into distinct Integer/Float/ + * String/etc. node types; makeString() now returns String * instead of + * Value *. Cloudberry versions built on pre-16 Postgres bases (e.g. PG14) + * still use the old Value type, so alias to whichever exists. + */ +#if PG_VERSION_NUM >= 160000 +typedef String PxfStringNode; +#else +typedef Value PxfStringNode; +#endif + #define FDW_OPTION_WIRE_FORMAT_TEXT "text" #define FDW_OPTION_WIRE_FORMAT_CSV "csv" @@ -470,7 +482,7 @@ PxfGetOptions(Oid foreigntableid) copy_options = lappend(copy_options, def); else { - Value *val = makeString(def->defname); + PxfStringNode *val = makeString(def->defname); /* * if we have already seen this option before disregard the new