Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/pxf-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can create a branch matrix to test both these branches until 2.X is EOL in the future.

PXF_HOME: "/usr/local/pxf"

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
20 changes: 20 additions & 0 deletions ci/docker/pxf-cbdb-dev/common/script/build_cloudberrry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions external-table/src/gpdbwritableformatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "utils/syscache.h"
#include "utils/lsyscache.h"

#include <arpa/inet.h>
#include <unistd.h>
#include "access/external.h"

Expand Down
16 changes: 14 additions & 2 deletions external-table/src/pxfuriparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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, ", ");
Expand Down
2 changes: 1 addition & 1 deletion external-table/test/pxfprotocol_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 13 additions & 1 deletion fdw/pxf_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
Loading