You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by dj...@apache.org on 2025/12/18 08:21:05 UTC

(cloudberry-pxf) branch merge-with-upstream updated (9a262885 -> a43e9e2b)

This is an automated email from the ASF dual-hosted git repository.

djwang pushed a change to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git


    from 9a262885 docs - Updating references of ADL and Azure Data Lake to ABFSS and Azure Data Lake Storage Gen2 (#1128)
     new 68c54cdb Address PR feedback
     new 7df14917 Changes for compiling PXF with GPDB 6.x
     new a81df0b9 Handle fucntion call for 6.x and 7.x
     new 18056b1f Temporary add GPDB header file to Install directory Manually
     new d826a137 Fix compilation for PXF on GP7
     new 50f2341a Added post instructions in GP7 spec
     new cb599545 Code Refactor
     new ae79dd65 Fix code for GP7 and GP6 API diff
     new 794570c2 Fix compilation for GP7
     new dcffb4d2 Fix Tests for GP7
     new 6fa21e7c updated ProjectionInfo related code for GP7 and code refactor
     new 82d659f9 Update Catalog query  to get Foreign Tables
     new 78152830 Added Python dependencies for Tinc Tests
     new b099e609 Fixing Tinc tests
     new 240a95c2 Fixing Table/DB encoding comparison for GP7
     new db6cdfce fix projection calculation for GP7
     new b42eb709 Resolving conflicts
     new 22810f6d Applying master changes for pxfheaders.c and test.yml to the branch to avoid conflict
     new 9b8a8a6b Address PR Feedback
     new 733ab552 Add support for Cloudberry Database
     new 2b70d309 fix: refactor projection header logic for PostgreSQL compatibility
     new 4cf46962 Bump Spring Boot's built-in Tomcat to 9.0.72
     new 24a69b64 Add basic community files
     new 635c1493 Update README.md (#1)
     new 39c1cd8c Update asf.yaml and README.md
     new 64875eb6 added Maven, Java 8 and pip install for GPDB7 docker images (#860)
     new 5410b7b7 install Java 8 JDK in gp7 centos7 docker image (#862)
     new 1f5c4bad removed jsoup dependency and unused class from the automation code (#863)
     new a2fe875b Add JsonProtocolHandler to use HdfsFileFragmenter for multi-line JSON (#858)
     new 613bdcb2 docs - update jdbc driver version number (#865)
     new 4974d1fd docs - misc updates/additions to the orc write docs (#864)
     new e021d6ff docs - command block formatting fix (#866)
     new 45efced0 ci: allow existing artifacts to remain if there is no pivnet product (#868)
     new 26c0920e added specs for gpdb7-rhel8-test-pxf docker image (#867)
     new 42dddc46 Relax the requirement that C string length matches Java string length (#870)
     new 8839ece6 Fix stack overflow in add_projection_desc_httpheader_pg12
     new a43e9e2b Modify operator precedence.

The 37 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .asf.yaml                                          |  74 +++++
 .github/ISSUE_TEMPLATE/bug-report.yml              |  63 +++++
 .github/ISSUE_TEMPLATE/config.yml                  |  14 +
 .github/pull_request_template.md                   |  20 ++
 CODE-OF-CONDUCT.md                                 | 149 ++++++----
 CONTRIBUTING.md                                    |  91 +++---
 Makefile                                           | 117 ++++----
 NOTICE                                             |  12 +
 README.md                                          | 226 ++++++++-------
 SECURITY.md                                        | 189 +++++--------
 automation/pom.xml                                 |   6 -
 .../general/alter/csv/expected/query01.ans         |   6 +
 .../features/general/alter/csv/sql/query01.sql     |   6 +
 .../parquet/expected/query01.ans                   |   7 +
 .../pxfwritable_export/parquet/sql/query01.sql     |   6 +
 .../without_column_projection/expected/query01.ans |   3 +
 .../without_column_projection/sql/query01.sql      |   3 +
 .../pxf/automation/features/orc/OrcReadTest.java   |   6 +
 .../features/orc/read/null_in_string/__init__.py}  |   0
 .../orc/read/null_in_string/expected/query01.ans   |   0
 .../features/orc/read/null_in_string/runTest.py    |  11 +
 .../orc/read/null_in_string/sql/query01.sql        |   0
 cli/cmd/cluster.go                                 |   5 +
 concourse/docker/pxf-dev-base/README.md            |  19 +-
 concourse/docker/pxf-dev-base/cloudbuild.yaml      |  33 ++-
 .../docker/pxf-dev-base/gpdb7/centos7/Dockerfile   |  17 +-
 .../docker/pxf-dev-base/gpdb7/rhel8/Dockerfile     |  25 +-
 .../pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile      |  18 +-
 concourse/docker/rpmrebuild/rhel/Dockerfile        |  16 ++
 concourse/pipelines/cloudbuild_pipeline.yml        | 148 +++++++++-
 .../pipelines/templates/dev_build_pipeline-tpl.yml | 173 +++++++++++-
 concourse/scripts/build.bash                       |  19 +-
 concourse/scripts/get_product_files.bash           |  30 +-
 concourse/scripts/initialize_gpdb.bash             |   1 +
 concourse/scripts/pxf_common.bash                  |   5 +
 concourse/scripts/test.bash                        |  72 +++++
 concourse/tasks/build.yml                          |   2 +
 concourse/tasks/test.yml                           |   5 +-
 docs/content/jdbc_cfg.html.md.erb                  |   2 +-
 external-table/src/gpdbwritableformatter.c         |  99 +++++--
 external-table/src/libchurl.c                      |  10 +-
 external-table/src/pxfdelimited_formatter.c        |   2 +-
 external-table/src/pxffilters.c                    |   4 +-
 external-table/src/pxfheaders.c                    | 305 ++++++++++++++++++---
 external-table/src/pxfuriparser.c                  |   6 +
 external-table/src/pxfutils.c                      |   7 +-
 package/{pxf-gp7.spec => pxf-cbdb1.spec}           |  20 +-
 package/pxf-gp7.spec                               |   2 +
 server/build.gradle                                |   4 +
 .../pxf/plugins/json/JsonProtocolHandler.java      |  13 +-
 .../pxf/plugins/json/JsonProtocolHandlerTest.java  |  17 --
 .../pxf/plugins/s3/S3ProtocolHandler.java          |   6 +-
 .../pxf/plugins/s3/S3ProtocolHandlerTest.java      |  42 +--
 .../src/main/resources/pxf-profiles-default.xml    |   2 +-
 server/pxf-service/src/scripts/pxf-post-gpupgrade  |   6 +-
 server/pxf-service/src/scripts/pxf-pre-gpupgrade   |   6 +-
 version                                            |   2 +-
 57 files changed, 1545 insertions(+), 607 deletions(-)
 create mode 100644 .asf.yaml
 create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml
 create mode 100644 .github/ISSUE_TEMPLATE/config.yml
 create mode 100644 .github/pull_request_template.md
 copy automation/{src/test/resources/data/text/empty => tincrepo/main/pxf/features/orc/read/null_in_string/__init__.py} (100%)
 copy automation/{sqlrepo => tincrepo/main/pxf}/features/orc/read/null_in_string/expected/query01.ans (100%)
 create mode 100644 automation/tincrepo/main/pxf/features/orc/read/null_in_string/runTest.py
 copy automation/{sqlrepo => tincrepo/main/pxf}/features/orc/read/null_in_string/sql/query01.sql (100%)
 create mode 100644 concourse/docker/rpmrebuild/rhel/Dockerfile
 copy package/{pxf-gp7.spec => pxf-cbdb1.spec} (82%)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 01/37: Address PR feedback

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 68c54cdbddbd698e5bed57e558792cffea604666
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Tue Sep 6 13:55:29 2022 -0700

    Address PR feedback
---
 Makefile                                   | 61 +++++++++------------------
 external-table/src/gpdbwritableformatter.c | 68 ++++++++++++++++++++++++------
 external-table/src/pxfuriparser.h          |  2 +-
 3 files changed, 75 insertions(+), 56 deletions(-)

diff --git a/Makefile b/Makefile
index 24ad16a7..907977ea 100644
--- a/Makefile
+++ b/Makefile
@@ -13,28 +13,8 @@ ifndef PGXS
 endif
 include $(PGXS)
 
-# variables that control whether the FDW extension will be built and packaged,
-# if left empty there is no skipping, otherwise a value should contain a reason for skipping
-ifeq ($(shell test $(GP_MAJORVERSION) -lt 6; echo $$?),0)
-	SKIP_FDW_BUILD_REASON := "GPDB version $(GP_MAJORVERSION) is less than 6."
-endif
-ifeq ($(shell test $(GP_MAJORVERSION) -lt 7; echo $$?),0)
-	SKIP_FDW_PACKAGE_REASON := "GPDB version $(GP_MAJORVERSION) is less than 7."
-endif
-
-ifeq ($(BLD_ARCH),)
-	GP_BUILD_ARCH := $(PORTNAME)-$(subst _,-,$(host_cpu))
-else
-	GP_BUILD_ARCH := $(subst _,-,$(BLD_ARCH))
-endif
-
-export SKIP_FDW_BUILD_REASON
-export SKIP_FDW_PACKAGE_REASON
-export GP_MAJORVERSION
-export GP_BUILD_ARCH
-
-PXF_PACKAGE_NAME := pxf-gpdb$(GP_MAJORVERSION)-$(PXF_VERSION)-$(GP_BUILD_ARCH)
-export PXF_PACKAGE_NAME
+SOURCE_EXTENSION_DIR = external-table
+TARGET_EXTENSION_DIR = gpextable
 
 LICENSE ?= ASL 2.0
 VENDOR ?= Open Source
@@ -53,21 +33,24 @@ external-table cli server:
 	make -C $@
 
 fdw:
-ifeq ($(SKIP_FDW_BUILD_REASON),)
-	@echo "===> Compiling [$@] module <==="
+ifneq ($(FDW_SUPPORT),)
 	make -C fdw
-else
-	@echo "Skipping building FDW extension because $(SKIP_FDW_BUILD_REASON)"
 endif
 
+cli:
+	make -C cli/go/src/pxf-cli
+
+server:
+	make -C server
+
 clean:
 	rm -rf build
-	set -e ;\
-	for module in $${PXF_MODULES[@]}; do \
-		echo "===> Cleaning [$${module}] module <===" ;\
-		make -C $${module} clean-all ;\
-	done ;\
-	echo "===> PXF cleaning is complete <==="
+	make -C $(SOURCE_EXTENSION_DIR) clean-all
+	make -C cli/go/src/pxf-cli clean
+	make -C server clean
+ifneq ($(FDW_SUPPORT),)
+	make -C fdw clean
+endif
 
 test:
 ifeq ($(SKIP_FDW_BUILD_REASON),)
@@ -82,16 +65,12 @@ it:
 	make -C automation TEST=$(TEST)
 
 install:
-ifneq ($(SKIP_FDW_BUILD_REASON),)
-	@echo "Skipping installing FDW extension because $(SKIP_FDW_BUILD_REASON)"
-	$(eval PXF_MODULES := $(filter-out fdw,$(PXF_MODULES)))
+	make -C $(SOURCE_EXTENSION_DIR) install
+	make -C cli/go/src/pxf-cli install
+	make -C server install
+ifneq ($(FDW_SUPPORT),)
+	make -C fdw install
 endif
-	set -e ;\
-	for module in $${PXF_MODULES[@]}; do \
-		echo "===> Installing [$${module}] module <===" ;\
-		make -C $${module} install ;\
-	done ;\
-	echo "===> PXF installation is complete <==="
 
 install-server:
 	make -C server install-server
diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c
index 9682c129..9885c3f0 100644
--- a/external-table/src/gpdbwritableformatter.c
+++ b/external-table/src/gpdbwritableformatter.c
@@ -343,13 +343,17 @@ boolArrayToByteArray(bool *data, int len, int validlen, int *outlen, TupleDesc t
 	*outlen = getNullByteArraySize(validlen);
 	result = palloc0(*outlen * sizeof(bits8));
 
+
 	for (i = 0, j = 0, k = 7; i < len; i++)
 	{
 		/* Ignore dropped attributes. */
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
-		if (attr->attisdropped)
-			continue;
+		if (attr->attisdropped) continue;
 
 		result[j] |= (data[i] ? 1 : 0) << k--;
 		if (k < 0)
@@ -392,7 +396,11 @@ byteArrayToBoolArray(bits8 *data, int data_len, int len, bool **booldata, int bo
 	for (i = 0, j = 0, k = 7; i < boollen; i++)
 	{
 		/* Ignore dropped attributes. */
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		if (attr->attisdropped)
 		{
@@ -432,11 +440,14 @@ verifyExternalTableDefinition(int16 ncolumns_remote, AttrNumber nvalidcolumns, A
 	/* Extract Column Type and check against External Table definition */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		/* Ignore dropped attributes. */
-		if (attr->attisdropped)
-			continue;
+		if (attr->attisdropped) continue;
 
 		input_type = 0;
 		defined_type = attr->atttypid;
@@ -501,7 +512,11 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	nvalidcolumns = 0;
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		if (!attr->attisdropped)
 			nvalidcolumns++;
@@ -530,7 +545,11 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 		/* setup the text/binary input function */
 		for (i = 0; i < ncolumns; i++)
 		{
-			Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+            #if PG_VERSION_NUM > 90400
+                Form_pg_attribute attr = &tupdesc->attrs[i];
+            #else
+                Form_pg_attribute attr = tupdesc->attrs[i];
+            #endif
 
 			Oid			type = attr->atttypid;
 			bool		isvarlena;
@@ -588,7 +607,11 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	 */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped) continue;
@@ -674,7 +697,11 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Write col type for columns that have not been dropped */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		/* Ignore dropped attributes. */
 		if (!attr->attisdropped)
@@ -691,7 +718,11 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Column Value */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 
 		/* Ignore dropped attributes and null values. */
 		if (!attr->attisdropped && !myData->nulls[i])
@@ -758,7 +789,12 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	/* Get the number of valid columns, excluding dropped columns */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+        #if PG_VERSION_NUM > 90400
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
+
 		if (!attr->attisdropped)
 			nvalidcolumns++;
 	}
@@ -784,7 +820,11 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 
 		for (i = 0; i < ncolumns; i++)
 		{
-			Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+			#if PG_VERSION_NUM > 90400
+				Form_pg_attribute attr = &tupdesc->attrs[i];
+			#else
+				Form_pg_attribute attr = tupdesc->attrs[i];
+			#endif
 
 			Oid type = attr->atttypid;
 
diff --git a/external-table/src/pxfuriparser.h b/external-table/src/pxfuriparser.h
index f52de266..b007ea80 100644
--- a/external-table/src/pxfuriparser.h
+++ b/external-table/src/pxfuriparser.h
@@ -24,7 +24,7 @@
 #include "nodes/pg_list.h"
 #include "fmgr.h"
 #include "utils/builtins.h"
-#if PG_VERSION_NUM >= 120000
+#if PG_VERSION_NUM >= 90600
 #include "lib/stringinfo.h"
 #include "nodes/value.h"
 #endif


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 06/37: Added post instructions in GP7 spec

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 50f2341a018a93561e9623cace83b6f822bda902
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 15 10:38:39 2022 -0700

    Added post instructions in GP7 spec
---
 package/pxf-gp7.spec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/pxf-gp7.spec b/package/pxf-gp7.spec
index fa9c0ba1..4b22e786 100644
--- a/package/pxf-gp7.spec
+++ b/package/pxf-gp7.spec
@@ -39,6 +39,8 @@ sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/gpextable/'|g" "${RPM
 sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/gpextable/pxf'|g" "${RPM_INSTALL_PREFIX}/gpextable/pxf.control"
 sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/fdw/'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
 sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/fdw/pxf_fdw'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
+sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/gpextable/'|g" "${RPM_INSTALL_PREFIX}/gpextable/pxf.control"
+sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/gpextable/pxf'|g" "${RPM_INSTALL_PREFIX}/gpextable/pxf.control"
 
 %files
 %{prefix}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 09/37: Fix compilation for GP7

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 794570c2830e3b8a72049fcc01b55200e4e8b3e9
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Mon Sep 19 15:01:00 2022 -0700

    Fix compilation for GP7
---
 external-table/src/pxfheaders.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index a1969299..bfd0fa44 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -512,7 +512,7 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	// pi_varNumbers is not available anymore in the postgters code
 	// https://doxygen.postgresql.org/structProjectionInfo.html
 	//int				*varNumbers = projInfo->pi_varNumbers;
-#if PG_VERSION_NUM < 120000
+#if PG_VERSION_NUM < 120000 // This will work for 6.x and lower versions of GPDB
     int				*varNumbers = projInfo->pi_varNumbers;
     List *targetList = projInfo->pi_targetlist;
 #else
@@ -576,14 +576,18 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	}
 
 	number = numTargetList +
-#if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
-		// FIXME: Commenting this out for compilation success
-		// pi_numSimpleVars is not available anymore in the postgters 12 code
-		// https://doxygen.postgresql.org/structProjectionInfo.html
-		projInfo->pi_numSimpleVars +
-#else
-		numSimpleVars +
+#if PG_VERSION_NUM < 120000
+
+    #if PG_VERSION_NUM >= 90400
+            // FIXME: Commenting this out for compilation success
+            // pi_numSimpleVars is not available anymore in the postgters 12 code
+            // https://doxygen.postgresql.org/structProjectionInfo.html
+            projInfo->pi_numSimpleVars +
+    #else
+            numSimpleVars +
+    #endif
 #endif
+
 		list_length(qualsAttributes);
 	if (number == 0)
 		return;
@@ -594,10 +598,16 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	pg_ltoa(number, long_number);
 	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
-#if PG_VERSION_NUM >=90400
-	/* FIXME: commenting out to get compile to work */
-	//for (i = 0; i < projInfo->pi_numSimpleVars; i++)
-	for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+
+#if PG_VERSION_NUM >= 90400
+
+    #if PG_VERSION_NUM >= 120000
+        for (i = 0; i < sizeof(targetList) ; i++)
+    #else
+        /* FIXME: commenting out to get compile to work */
+        //for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+        for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+    #endif
 #else
 	for (i = 0; varNumbers && i < numSimpleVars; i++)
 	{


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 30/37: docs - update jdbc driver version number (#865)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 613bdcb2ba3d2bd5a38139197aa3179ea13a01f1
Author: Lisa Owen <lo...@pivotal.io>
AuthorDate: Wed Sep 14 13:02:40 2022 -0600

    docs - update jdbc driver version number (#865)
---
 docs/content/jdbc_cfg.html.md.erb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/content/jdbc_cfg.html.md.erb b/docs/content/jdbc_cfg.html.md.erb
index f8f65da7..1d572b56 100644
--- a/docs/content/jdbc_cfg.html.md.erb
+++ b/docs/content/jdbc_cfg.html.md.erb
@@ -19,7 +19,7 @@ In previous releases of Greenplum Database, you may have specified the JDBC driv
 
 ## <a id="cfg_jar"></a>JDBC Driver JAR Registration
 
-PXF is bundled with the `postgresql-42.4.3.jar` JAR file. If you require a different JDBC driver, ensure that you install the JDBC driver JAR file for the external SQL database in the `$PXF_BASE/lib` directory on each Greenplum host. Be sure to install JDBC driver JAR files that are compatible with your JRE version. See [Registering PXF Library Dependencies](reg_jar_depend.html) for additional information.
+PXF is bundled with the `postgresql-42.4.1.jar` JAR file. If you require a different JDBC driver, ensure that you install the JDBC driver JAR file for the external SQL database in the `$PXF_BASE/lib` directory on each Greenplum host. Be sure to install JDBC driver JAR files that are compatible with your JRE version. See [Registering PXF Library Dependencies](reg_jar_depend.html) for additional information.
 
 ## <a id="cfg_server"></a>JDBC Server Configuration
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 29/37: Add JsonProtocolHandler to use HdfsFileFragmenter for multi-line JSON (#858)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit a2fe875bbc5813c899c26ce7ce9339431fc9caff
Author: Ashuka Xue <ax...@vmware.com>
AuthorDate: Wed Sep 7 12:40:15 2022 -0700

    Add JsonProtocolHandler to use HdfsFileFragmenter for multi-line JSON (#858)
    
    This commit fixes an issue that could occur with multi-line JSON files.
    
    Previously, it was possible for a fragment to improperly parse a JSON object if the split started in the middle of a string, causing wrong results. This commit now uses the HdfsFileFragmenter for multi-line JSON files.
---
 .../pxf/plugins/json/JsonProtocolHandler.java      | 13 ++-----
 .../pxf/plugins/json/JsonProtocolHandlerTest.java  | 17 ---------
 .../pxf/plugins/s3/S3ProtocolHandler.java          |  6 +++-
 .../pxf/plugins/s3/S3ProtocolHandlerTest.java      | 42 +++-------------------
 .../src/main/resources/pxf-profiles-default.xml    |  2 +-
 5 files changed, 13 insertions(+), 67 deletions(-)

diff --git a/server/pxf-json/src/main/java/org/greenplum/pxf/plugins/json/JsonProtocolHandler.java b/server/pxf-json/src/main/java/org/greenplum/pxf/plugins/json/JsonProtocolHandler.java
index 0bf61661..9673212e 100644
--- a/server/pxf-json/src/main/java/org/greenplum/pxf/plugins/json/JsonProtocolHandler.java
+++ b/server/pxf-json/src/main/java/org/greenplum/pxf/plugins/json/JsonProtocolHandler.java
@@ -18,7 +18,7 @@ public class JsonProtocolHandler implements ProtocolHandler {
     @Override
     public String getFragmenterClassName(RequestContext context) {
         String fragmenter = context.getFragmenter(); // default to fragmenter defined by the profile
-        if (splitByFile(context)) {
+        if (useMultilineJson(context)) {
             fragmenter = HCFS_FILE_FRAGMENTER;
         }
         LOG.debug("Determined to use {} fragmenter", fragmenter);
@@ -35,14 +35,7 @@ public class JsonProtocolHandler implements ProtocolHandler {
         return context.getResolver();
     }
 
-    /**
-     * Determine if the HdfsFileFragmenter should be used instead of the default fragmenter.
-     * This determination is dictated by the SPLIT_BY_FILE parameter which is provided in the LOCATION uri.
-     *
-     * @param context the request context
-     * @return true if the HdfsFileFragmenter should be used, false otherwise
-     */
-    public boolean splitByFile(RequestContext context) {
-        return context.getOption("split_by_file", false);
+    public boolean useMultilineJson(RequestContext context) {
+        return isNotEmpty(context.getOption("identifier"));
     }
 }
diff --git a/server/pxf-json/src/test/java/org/greenplum/pxf/plugins/json/JsonProtocolHandlerTest.java b/server/pxf-json/src/test/java/org/greenplum/pxf/plugins/json/JsonProtocolHandlerTest.java
index 9717fc67..b90ab9c4 100644
--- a/server/pxf-json/src/test/java/org/greenplum/pxf/plugins/json/JsonProtocolHandlerTest.java
+++ b/server/pxf-json/src/test/java/org/greenplum/pxf/plugins/json/JsonProtocolHandlerTest.java
@@ -50,23 +50,6 @@ public class JsonProtocolHandlerTest {
     @Test
     public void testWithIdentifier() {
         context.addOption("IDENTIFIER", "c1");
-        assertEquals(DEFAULT_FRAGMENTER, handler.getFragmenterClassName(context));
-        assertEquals(DEFAULT_ACCESSOR, handler.getAccessorClassName(context));
-        assertEquals(DEFAULT_RESOLVER, handler.getResolverClassName(context));
-    }
-
-    @Test
-    public void testWithIdentifierUseFileFragmenter() {
-        context.addOption("IDENTIFIER", "c1");
-        context.addOption("SPLIT_BY_FILE", "true");
-        assertEquals(FILE_FRAGMENTER, handler.getFragmenterClassName(context));
-        assertEquals(DEFAULT_ACCESSOR, handler.getAccessorClassName(context));
-        assertEquals(DEFAULT_RESOLVER, handler.getResolverClassName(context));
-    }
-
-    @Test
-    public void testUseFileFragmenter() {
-        context.addOption("SPLIT_BY_FILE", "true");
         assertEquals(FILE_FRAGMENTER, handler.getFragmenterClassName(context));
         assertEquals(DEFAULT_ACCESSOR, handler.getAccessorClassName(context));
         assertEquals(DEFAULT_RESOLVER, handler.getResolverClassName(context));
diff --git a/server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandler.java b/server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandler.java
index bcd6f67c..62617cb1 100644
--- a/server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandler.java
+++ b/server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandler.java
@@ -55,7 +55,7 @@ public class S3ProtocolHandler implements ProtocolHandler {
     @Override
     public String getFragmenterClassName(RequestContext context) {
         String fragmenter = context.getFragmenter(); // default to fragmenter defined by the profile
-        if (useS3Select(context) || useFileReadForJson(context)) {
+        if (useS3Select(context) || useMultilineJson(context)) {
             fragmenter = HCFS_FILE_FRAGMENTER;
         }
 
@@ -129,6 +129,10 @@ public class S3ProtocolHandler implements ProtocolHandler {
         }
     }
 
+    public boolean useMultilineJson(RequestContext context) {
+        return isNotEmpty(context.getOption("identifier"));
+    }
+
     /**
      * Determine if the HdfsFileFragmenter should be used for JSON filetypes.
      * This determination is dictated by the SPLIT_BY_FILE parameter which is provided in the LOCATION uri.
diff --git a/server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandlerTest.java b/server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandlerTest.java
index 3c844a4e..4456afa3 100644
--- a/server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandlerTest.java
+++ b/server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandlerTest.java
@@ -60,6 +60,8 @@ public class S3ProtocolHandlerTest {
     private static final String[] EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER};
     private static final String[] EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER};
 
+    private static final String[] EXPECTED_FRAGMENTER_MULTILINE = {FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER};
+
     private S3ProtocolHandler handler;
     private RequestContext context;
 
@@ -422,19 +424,7 @@ public class S3ProtocolHandlerTest {
         context.setOutputFormat(OutputFormat.TEXT);
         verifyAccessors(context, EXPECTED_ACCESSOR_TEXT_OFF);
         verifyResolvers(context, EXPECTED_RESOLVER_TEXT_OFF);
-        verifyFragmenters(context, EXPECTED_FRAGMENTER_TEXT_OFF);
-    }
-
-    @Test
-    public void testTextSplitByFileAndSelectOff() {
-        context.addOption("S3_SELECT", "off");
-        context.addOption("SPLIT_BY_FILE", "true");
-        context.setOutputFormat(OutputFormat.TEXT);
-        verifyAccessors(context, EXPECTED_ACCESSOR_TEXT_OFF);
-        verifyResolvers(context, EXPECTED_RESOLVER_TEXT_OFF);
-        String[] EXPECTED_FRAGMENTERS = EXPECTED_FRAGMENTER_TEXT_OFF.clone();
-        EXPECTED_FRAGMENTERS[3] = FILE_FRAGMENTER; // index 3 is json
-        verifyFragmenters(context, EXPECTED_FRAGMENTERS);
+        verifyFragmenters(context, EXPECTED_FRAGMENTER_MULTILINE);
     }
 
     @Test
@@ -448,18 +438,6 @@ public class S3ProtocolHandlerTest {
         verifyFragmenters(context, EXPECTED_FRAGMENTER_TEXT_ON);
     }
 
-    @Test
-    public void testSplitByFileAndSelectOn() {
-        // s3 options should override multiline json fragmenter option
-        context.addOption("S3_SELECT", "on");
-        context.addOption("SPLIT_BY_FILE", "true");
-        context.setOutputFormat(OutputFormat.TEXT);
-        verifyAccessors(context, EXPECTED_ACCESSOR_TEXT_ON);
-        verifyResolvers(context, EXPECTED_RESOLVER_TEXT_ON);
-        String[] EXPECTED_FRAGMENTERS = EXPECTED_FRAGMENTER_TEXT_ON.clone();
-        EXPECTED_FRAGMENTERS[3] = FILE_FRAGMENTER; // index 3 is json
-        verifyFragmenters(context, EXPECTED_FRAGMENTERS);
-    }
     @Test
     public void testTextIdentifierAndSelectAuto() {
         // s3 options should override multiline json fragmenter option
@@ -468,19 +446,7 @@ public class S3ProtocolHandlerTest {
         context.setOutputFormat(OutputFormat.TEXT);
         verifyAccessors(context, EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT);
         verifyResolvers(context, EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT);
-        verifyFragmenters(context, EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT);
-    }
-
-    @Test
-    public void testTextSplitByFileAndSelectAuto() {
-        context.addOption("S3_SELECT", "auto");
-        context.addOption("SPLIT_BY_FILE", "true");
-        context.setOutputFormat(OutputFormat.TEXT);
-        verifyAccessors(context, EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT);
-        verifyResolvers(context, EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT);
-        String[] EXPECTED_FRAGMENTERS = EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT.clone();
-        EXPECTED_FRAGMENTERS[3] = FILE_FRAGMENTER; // index 3 is json
-        verifyFragmenters(context, EXPECTED_FRAGMENTERS);
+        verifyFragmenters(context, EXPECTED_FRAGMENTER_MULTILINE);
     }
 
     private void verifyFragmenters(RequestContext context, String[] expected) {
diff --git a/server/pxf-service/src/main/resources/pxf-profiles-default.xml b/server/pxf-service/src/main/resources/pxf-profiles-default.xml
index 7f80649e..423c2b62 100644
--- a/server/pxf-service/src/main/resources/pxf-profiles-default.xml
+++ b/server/pxf-service/src/main/resources/pxf-profiles-default.xml
@@ -836,7 +836,7 @@ under the License.
             <resolver>org.greenplum.pxf.plugins.json.JsonResolver</resolver>
         </plugins>
         <handler>org.greenplum.pxf.plugins.json.JsonProtocolHandler</handler>
-        <protocol>abfss</protocol>
+        <protocol>adl</protocol>
     </profile>
     <profile>
         <name>wasbs:json</name>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 20/37: Add support for Cloudberry Database

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 733ab55205b6043f07c8550cc23d9aaaa4547433
Author: kongfanshen <ko...@hashdata.cn>
AuthorDate: Fri Oct 14 11:27:47 2022 +0800

    Add support for Cloudberry Database
    
    This project is dedicated to supporting PXF in Cloudberry Database. In
    this PR, we updated the build and test files to make it support
    CloudberryDB 1.0+. You can see more details in the commit.
    
    Authored-by: Kongfanshen <ko...@hashdata.cn>
    Co-authored-by: Hao Wu <gf...@gmail.com>
---
 Makefile                                          | 56 +++++++++-------
 cli/cmd/cluster.go                                |  5 ++
 external-table/src/libchurl.c                     | 10 +--
 external-table/src/pxffilters.c                   |  4 +-
 external-table/src/pxfheaders.c                   |  9 +++
 package/pxf-cbdb1.spec                            | 79 +++++++++++++++++++++++
 server/pxf-service/src/scripts/pxf-post-gpupgrade |  6 +-
 server/pxf-service/src/scripts/pxf-pre-gpupgrade  |  6 +-
 version                                           |  2 +-
 9 files changed, 133 insertions(+), 44 deletions(-)

diff --git a/Makefile b/Makefile
index 907977ea..30b9d3f7 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,8 @@ export PXF_MODULES
 PXF_VERSION ?= $(shell cat version)
 export PXF_VERSION
 
-PG_CONFIG ?= pg_config
-PGXS := $(shell $(PG_CONFIG) --pgxs)
-ifndef PGXS
-	$(error Make sure the Greenplum installation binaries are in your PATH. i.e. export PATH=<path to your Greenplum installation>/bin:$$PATH)
-endif
-include $(PGXS)
+FDW_SUPPORT = $(shell $(PG_CONFIG) --version | egrep "PostgreSQL 1[2-5]")
+FDW_SUPPORT =
 
 SOURCE_EXTENSION_DIR = external-table
 TARGET_EXTENSION_DIR = gpextable
@@ -82,12 +78,13 @@ ifneq ($(SKIP_FDW_PACKAGE_REASON),)
 	$(eval PXF_MODULES := $(filter-out fdw,$(PXF_MODULES)))
 endif
 	set -e ;\
-	mkdir -p build/stage/$${PXF_PACKAGE_NAME}/pxf ;\
-	for module in $${PXF_MODULES[@]}; do \
-		echo "===> Staging [$${module}] module <===" ;\
-		make -C $${module} stage ;\
-		cp -a "$${module}"/build/stage/* "build/stage/$${PXF_PACKAGE_NAME}/pxf" ;\
-	done ;\
+	GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version) ;\
+	GP_BUILD_ARCH=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/build_arch) ;\
+	PXF_PACKAGE_NAME=pxf-cbdb$${GP_MAJOR_VERSION}-$${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
+	mkdir -p build/stage/$${PXF_PACKAGE_NAME} ;\
+	cp -a $(SOURCE_EXTENSION_DIR)/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
+	cp -a cli/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
+	cp -a server/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
 	echo $$(git rev-parse --verify HEAD) > build/stage/$${PXF_PACKAGE_NAME}/pxf/commit.sha ;\
 	cp package/install_binary build/stage/$${PXF_PACKAGE_NAME}/install_component ;\
 	echo "===> PXF staging is complete <==="
@@ -98,8 +95,18 @@ tar: stage
 	tar -czf build/dist/$(PXF_PACKAGE_NAME).tar.gz -C build/stage $(PXF_PACKAGE_NAME)
 	echo "===> PXF TAR file with binaries creation is complete <==="
 
-rpm: stage
-	rm -rf build/rpmbuild
+gppkg-rpm: rpm
+	rm -rf gppkg
+	mkdir -p gppkg/deps
+	GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version)
+	cat package/gppkg_spec.yml.in | sed "s,#arch,`arch`," | sed "s,#os,$(TEST_OS)," | sed "s,#gppkgver,1.0," | sed "s,#gpver,1," > gppkg/gppkg_spec.yml
+	find build/rpmbuild/RPMS -name pxf-cbdb$(GP_MAJOR_VERSION)-*.rpm -exec cp {} gppkg/ \;
+	source $(GPHOME)/greenplum_path.sh && gppkg --build gppkg
+
+rpm:
+	make -C $(SOURCE_EXTENSION_DIR) stage
+	make -C cli/go/src/pxf-cli stage
+	make -C server stage
 	set -e ;\
 	PXF_MAIN_VERSION=$${PXF_VERSION//-SNAPSHOT/} ;\
 	if [[ $${PXF_VERSION} == *"-SNAPSHOT" ]]; then PXF_RELEASE=SNAPSHOT; else PXF_RELEASE=1; fi ;\
@@ -112,14 +119,14 @@ rpm: stage
 	--define "pxf_release $${PXF_RELEASE}" \
 	--define "license ${LICENSE}" \
 	--define "vendor ${VENDOR}" \
-	-bb $${PWD}/build/rpmbuild/SPECS/pxf-gp$${GP_MAJORVERSION}.spec ;\
-	echo "===> PXF RPM package creation is complete <==="
+	-bb $${PWD}/build/rpmbuild/SPECS/pxf-cbdb$${GP_MAJOR_VERSION}.spec
 
 rpm-tar: rpm
 	rm -rf build/{stagerpm,distrpm}
 	mkdir -p build/{stagerpm,distrpm}
 	set -e ;\
-	PXF_RPM_FILE=$$(find build/rpmbuild/RPMS -name pxf-gp$${GP_MAJORVERSION}-*.rpm) ;\
+	GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version) ;\
+	PXF_RPM_FILE=$$(find build/rpmbuild/RPMS -name pxf-cbdb$${GP_MAJOR_VERSION}-*.rpm) ;\
 	PXF_RPM_BASE_NAME=$$(basename $${PXF_RPM_FILE%*.rpm}) ;\
 	PXF_PACKAGE_NAME=$${PXF_RPM_BASE_NAME%.*} ;\
 	mkdir -p build/stagerpm/$${PXF_PACKAGE_NAME} ;\
@@ -133,21 +140,24 @@ deb: stage
 	set -e ;\
 	PXF_MAIN_VERSION=$${PXF_VERSION//-SNAPSHOT/} ;\
 	if [[ $${PXF_VERSION} == *"-SNAPSHOT" ]]; then PXF_RELEASE=SNAPSHOT; else PXF_RELEASE=1; fi ;\
-	mkdir -p build/debbuild/usr/local/pxf-gp$${GP_MAJORVERSION} ;\
-	cp -a build/stage/$${PXF_PACKAGE_NAME}/pxf/* build/debbuild/usr/local/pxf-gp$${GP_MAJORVERSION} ;\
+	rm -rf build/debbuild ;\
+	mkdir -p build/debbuild/usr/local/pxf-cbdb$${GP_MAJOR_VERSION}/$(TARGET_EXTENSION_DIR) ;\
+	cp -a $(SOURCE_EXTENSION_DIR)/build/stage/* build/debbuild/usr/local/pxf-cbdb$${GP_MAJOR_VERSION}/$(TARGET_EXTENSION_DIR) ;\
+	cp -a cli/build/stage/pxf/* build/debbuild/usr/local/pxf-cbdb$${GP_MAJOR_VERSION} ;\
+	cp -a server/build/stage/pxf/* build/debbuild/usr/local/pxf-cbdb$${GP_MAJOR_VERSION} ;\
+	echo $$(git rev-parse --verify HEAD) > build/debbuild/usr/local/pxf-cbdb$${GP_MAJOR_VERSION}/commit.sha ;\
 	mkdir build/debbuild/DEBIAN ;\
 	cp -a package/DEBIAN/* build/debbuild/DEBIAN/ ;\
 	sed -i -e "s/%VERSION%/$${PXF_MAIN_VERSION}-$${PXF_RELEASE}/" -e "s/%MAINTAINER%/${VENDOR}/" build/debbuild/DEBIAN/control ;\
 	dpkg-deb --build build/debbuild ;\
-	mv build/debbuild.deb build/pxf-gp$${GP_MAJORVERSION}-$${PXF_MAIN_VERSION}-$${PXF_RELEASE}-ubuntu18.04-amd64.deb ;\
-	echo "===> PXF DEB package creation is complete <==="
-
+	mv build/debbuild.deb build/pxf-cbdb$${GP_MAJOR_VERSION}-$${PXF_MAIN_VERSION}-$${PXF_RELEASE}-ubuntu18.04-amd64.deb
 
 deb-tar: deb
 	rm -rf build/{stagedeb,distdeb}
 	mkdir -p build/{stagedeb,distdeb}
 	set -e ;\
-	PXF_DEB_FILE=$$(find build/ -name pxf-gp$${GP_MAJORVERSION}*.deb) ;\
+	GP_MAJOR_VERSION=$$(cat $(SOURCE_EXTENSION_DIR)/build/metadata/gp_major_version) ;\
+	PXF_DEB_FILE=$$(find build/ -name pxf-cbdb$${GP_MAJOR_VERSION}*.deb) ;\
 	PXF_PACKAGE_NAME=$$(dpkg-deb --field $${PXF_DEB_FILE} Package)-$$(dpkg-deb --field $${PXF_DEB_FILE} Version)-ubuntu18.04 ;\
 	mkdir -p build/stagedeb/$${PXF_PACKAGE_NAME} ;\
 	cp $${PXF_DEB_FILE} build/stagedeb/$${PXF_PACKAGE_NAME} ;\
diff --git a/cli/cmd/cluster.go b/cli/cmd/cluster.go
index bb56384d..68a7b301 100644
--- a/cli/cmd/cluster.go
+++ b/cli/cmd/cluster.go
@@ -10,6 +10,7 @@ import (
 	"github.com/greenplum-db/gp-common-go-libs/dbconn"
 	"github.com/greenplum-db/gp-common-go-libs/gplog"
 	"github.com/spf13/cobra"
+	"github.com/blang/semver"
 )
 
 // ClusterData is exported for testing
@@ -141,6 +142,10 @@ func doSetup() (*ClusterData, error) {
 			"Please make sure that your Greenplum database is running and you are on the coordinator node.", err.Error()))
 		return nil, err
 	}
+
+	//set the fake version for cbdb.
+	connection.Version = dbconn.GPDBVersion{VersionString: "7.1.0", SemVer: semver.MustParse("7.1.0")}
+
 	segConfigs, err := cluster.GetSegmentConfiguration(connection, true)
 	if err != nil {
 		gplog.Error(fmt.Sprintf("ERROR: Could not retrieve segment information from GPDB.\n%s\n" + err.Error()))
diff --git a/external-table/src/libchurl.c b/external-table/src/libchurl.c
index 40e03480..06a9906a 100644
--- a/external-table/src/libchurl.c
+++ b/external-table/src/libchurl.c
@@ -22,7 +22,8 @@
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/guc.h"
-#include "utils/jsonapi.h"
+#include "common/jsonapi.h"
+#include "utils/jsonfuncs.h"
 
 /* include libcurl without typecheck.
  * This allows wrapping curl_easy_setopt to be wrapped
@@ -92,13 +93,6 @@ typedef struct
 	struct curl_slist *headers;
 } churl_settings;
 
-/* the null action object used for pure validation */
-static JsonSemAction nullSemAction =
-{
-	NULL, NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL
-};
-
 churl_context *churl_new_context(void);
 static void		create_curl_handle(churl_context *context);
 static void		set_curl_option(churl_context *context, CURLoption option, const void *data);
diff --git a/external-table/src/pxffilters.c b/external-table/src/pxffilters.c
index ec24164a..3ef0f062 100644
--- a/external-table/src/pxffilters.c
+++ b/external-table/src/pxffilters.c
@@ -176,7 +176,7 @@ dbop_pxfop_map pxf_supported_opr_op_expr[] =
 	{85 /* boolne */ , PXFOP_NE},
 
 	/* bpchar */
-	{BPCharEqualOperator /* bpchareq */ , PXFOP_EQ},
+	{BpcharEqualOperator /* bpchareq */ , PXFOP_EQ},
 	{1058 /* bpcharlt */ , PXFOP_LT},
 	{1060 /* bpchargt */ , PXFOP_GT},
 	{1059 /* bpcharle */ , PXFOP_LE},
@@ -238,7 +238,7 @@ dbop_pxfop_array_map pxf_supported_opr_scalar_array_op_expr[] =
 	{1120 /* float48eq */ , PXFOP_IN, true},
 
 	/* bpchar */
-	{BPCharEqualOperator /* bpchareq */ , PXFOP_IN, true},
+	{BpcharEqualOperator /* bpchareq */ , PXFOP_IN, true},
 };
 
 
diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index da7887b1..0c991eb7 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -1176,4 +1176,13 @@ parseCopyFormatString(Relation rel, char *fmtstr, char fmttype)
 			        errmsg("external table internal parse error at end of line")));
 }
 
+/*
+ * This function is copied from fileam.c in the 6X_STABLE branch.
+ * In version 6, this function is no longer required to be copied.
+ */
+static List *
+appendCopyEncodingOption(List *copyFmtOpts, int encoding)
+{
+	return lappend(copyFmtOpts, makeDefElem("encoding", (Node *)makeString((char *)pg_encoding_to_char(encoding))));
+}
 #endif
diff --git a/package/pxf-cbdb1.spec b/package/pxf-cbdb1.spec
new file mode 100644
index 00000000..f2812e34
--- /dev/null
+++ b/package/pxf-cbdb1.spec
@@ -0,0 +1,79 @@
+# Disable repacking of jars, since it takes forever
+%define __jar_repack %{nil}
+
+# Disable build-id in rpm
+%define _build_id_links none
+# Disable automatic dependency processing both for requirements and provides
+AutoReqProv: no
+
+Name: pxf-cbdb1
+Version: %{pxf_version}
+Release: 1%{?dist}
+Summary: Cloudberry PXF framework for external data access
+License: %{license}
+URL: http://www.hashdata.cn
+Vendor: %{vendor}
+
+Prefix: /usr/local/%{name}
+
+# .so file makes sense only when installing on Cloudberry node, so inherit Cloudberry's dependencies implicitly
+# Java server can be installed on a new node, only bash is needed for management scripts
+## cbdb has added this requirement, pxf may installed under GPHOME,
+# this requirement will cause installation fail.
+# Requires: bash
+
+%description
+PXF is an extensible framework that allows a distributed database like Cloudberry to query external data files,
+whose metadata is not managed by the database. PXF includes built-in connectors for accessing data that exists
+inside HDFS files, Hive tables, HBase tables, databases that support JDBC, data stores (S3, GCS) and more.
+
+%prep
+# If the pxf_version macro is not defined, it gets interpreted as a literal string, need %% to escape it
+if [ %{pxf_version} = '%%{pxf_version}' ] ; then
+  echo "The macro (variable) pxf_version must be supplied as rpmbuild ... --define='pxf_version [VERSION]'"
+  exit 1
+fi
+
+%install
+%__mkdir -p %{buildroot}/%{prefix}
+%__cp -R %{_sourcedir}/* %{buildroot}/%{prefix}
+
+%post
+sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/fdw/'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
+sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/fdw/pxf_fdw'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
+
+%files
+%{prefix}
+
+# If a file is not marked as a config file, or if a file has not been altered
+# since installation, then it will be silently replaced by the version from the
+# RPM.
+
+# If a config file has been edited on disk, but is not actually different from
+# the file in the RPM then the edited version will be silently left in place.
+
+# When a config file has been edited and is different from the file in
+# the RPM, then the behavior is the following:
+# - %config(noreplace): The edited version will be left in place, and the new
+#                       version will be installed with an .rpmnew suffix.
+# - %config: The new file will be installed, and the the old edited version
+#            will be renamed with an .rpmsave suffix.
+
+# Configuration directories/files
+%config(noreplace) %{prefix}/conf/pxf-application.properties
+%config(noreplace) %{prefix}/conf/pxf-env.sh
+%config(noreplace) %{prefix}/conf/pxf-log4j2.xml
+%config(noreplace) %{prefix}/conf/pxf-profiles.xml
+
+%pre
+# cleanup files and directories created by 'pxf init' command
+# only applies for old installations (pre 6.0.0)
+%__rm -f "${RPM_INSTALL_PREFIX}/conf/pxf-private.classpath"
+%__rm -rf "${RPM_INSTALL_PREFIX}/pxf-service"
+
+%posttrans
+# PXF v5 RPM installation removes the run directory during the %preun step.
+# The lack of run directory prevents PXF v6+ from starting up.
+# %posttrans of the new package is the only step that runs after the %preun
+# of the old package
+%{__install} -d -m 700 "${RPM_INSTALL_PREFIX}/run"
diff --git a/server/pxf-service/src/scripts/pxf-post-gpupgrade b/server/pxf-service/src/scripts/pxf-post-gpupgrade
index c1ca7552..e9f52419 100755
--- a/server/pxf-service/src/scripts/pxf-post-gpupgrade
+++ b/server/pxf-service/src/scripts/pxf-post-gpupgrade
@@ -57,11 +57,7 @@ if [[ "${pxf_gpdb_major_version}" != "${gp_version%%.*}" ]]; then
     exit 1
 fi
 
-if [[ "${gp_version}" = 5* ]]; then
-    master_data_dir_query="SELECT fselocation FROM pg_catalog.pg_filespace_entry WHERE fsedbid = 1 AND fsefsoid = (SELECT oid FROM pg_catalog.pg_filespace WHERE fsname = 'pg_system')"
-else
-    master_data_dir_query="SELECT datadir FROM pg_catalog.gp_segment_configuration WHERE dbid = 1"
-fi
+master_data_dir_query="SELECT datadir FROM pg_catalog.gp_segment_configuration WHERE dbid = 1"
 export MASTER_DATA_DIRECTORY="${MASTER_DATA_DIRECTORY:-$(psql --no-align --tuples-only --command "${master_data_dir_query}")}"
 echo "GPDB master data directory is '${MASTER_DATA_DIRECTORY}'" >>"${log_file}"
 
diff --git a/server/pxf-service/src/scripts/pxf-pre-gpupgrade b/server/pxf-service/src/scripts/pxf-pre-gpupgrade
index e9aa2b88..24c352d6 100755
--- a/server/pxf-service/src/scripts/pxf-pre-gpupgrade
+++ b/server/pxf-service/src/scripts/pxf-pre-gpupgrade
@@ -57,11 +57,7 @@ if [[ "${pxf_gpdb_major_version}" != "${gp_version%%.*}" ]]; then
     exit 1
 fi
 
-if [[ "${gp_version}" = 5* ]]; then
-    master_data_dir_query="SELECT fselocation FROM pg_catalog.pg_filespace_entry WHERE fsedbid = 1 AND fsefsoid = (SELECT oid FROM pg_catalog.pg_filespace WHERE fsname = 'pg_system')"
-else
-    master_data_dir_query="SELECT datadir FROM pg_catalog.gp_segment_configuration WHERE dbid = 1"
-fi
+master_data_dir_query="SELECT datadir FROM pg_catalog.gp_segment_configuration WHERE dbid = 1"
 export MASTER_DATA_DIRECTORY="${MASTER_DATA_DIRECTORY:-$(psql --no-align --tuples-only --command "${master_data_dir_query}")}"
 echo "GPDB master data directory is '${MASTER_DATA_DIRECTORY}'" >>"${log_file}"
 
diff --git a/version b/version
index 57d73f9f..3eefcb9d 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-6.10.1-SNAPSHOT
+1.0.0


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 25/37: Update asf.yaml and README.md

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 39c1cd8cba7bc36a792ca78417ab8e87b5b558a3
Author: Dianjin Wang <wa...@gmail.com>
AuthorDate: Wed Nov 6 10:24:57 2024 +0800

    Update asf.yaml and README.md
---
 .asf.yaml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 README.md | 39 ++++++++++++++++-----------------
 2 files changed, 93 insertions(+), 20 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
new file mode 100644
index 00000000..4c647111
--- /dev/null
+++ b/.asf.yaml
@@ -0,0 +1,74 @@
+#
+# 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.
+#
+
+github:
+  description: Platform Extension Framework (PXF) for Apache Cloudberry (Incubating)
+  homepage: https://cloudberry.apache.org
+  labels:
+    - mpp
+    - big-data
+    - data-warehouse
+    - data-analysis
+    - olap
+    - distributed-database
+    - database
+    - postgres
+    - postgresql
+    - greenplum
+    - cloudberry
+    - ai
+    - pxf
+  features:
+    # Enable wiki for documentation
+    wiki: false
+    # Enable issues management
+    issues: true
+    # Enable projects for project management boards
+    projects: false
+  enabled_merge_buttons:
+    # enable squash button:
+    squash: true
+    # disable merge button:
+    merge: false
+    # enable rebase button:
+    rebase: true
+  protected_branches:
+    main:
+      required_status_checks:
+        # strict means "Require branches to be up to date before merging".
+        strict: true
+        # contexts are the names of checks that must pass.
+      required_pull_request_reviews:
+        dismiss_stale_reviews: false
+        required_approving_review_count: 1
+      # squash or rebase must be allowed in the repo for this setting to be set to true.
+      required_linear_history: true
+
+      required_signatures: false
+
+      # requires all conversations to be resolved before merging is possible
+      required_conversation_resolution: true
+  del_branch_on_merge: true
+  dependabot_alerts: true
+  dependabot_updates: false
+  protected_tags:
+    - "[0-9]*.*"
+notifications:
+  commits: commits@cloudberry.apache.org
+  issues: commits@cloudberry.apache.org
+  pullrequests: commits@cloudberry.apache.org
+  pullrequests_bot_dependabot: private@cloudberry.apache.org
diff --git a/README.md b/README.md
index 0f664531..5ba55036 100755
--- a/README.md
+++ b/README.md
@@ -1,34 +1,33 @@
-# Platform Extension Framework (PXF) for Cloudberry Database
+# Platform Extension Framework (PXF) for Apache Cloudberry (Incubating)
 
 [![Slack](https://img.shields.io/badge/Join_Slack-6a32c9)](https://communityinviter.com/apps/cloudberrydb/welcome)
 [![Twitter Follow](https://img.shields.io/twitter/follow/cloudberrydb)](https://twitter.com/cloudberrydb)
-[![Website](https://img.shields.io/badge/Visit%20Website-eebc46)](https://cloudberrydb.org)
-[![GitHub Discussions](https://img.shields.io/github/discussions/cloudberrydb/cloudberrydb)](https://github.com/orgs/cloudberrydb/discussions)
+[![Website](https://img.shields.io/badge/Visit%20Website-eebc46)](https://cloudberry.apache.org)
 
 ---
 
 ## Introduction
 
-PXF is an extensible framework that allows a distributed database like Greenplum and Cloudberry Database to query external data files, whose metadata is not managed by the database.
+PXF is an extensible framework that allows a distributed database like Greenplum and Apache Cloudberry to query external data files, whose metadata is not managed by the database.
 PXF includes built-in connectors for accessing data that exists inside HDFS files, Hive tables, HBase tables, JDBC-accessible databases and more.
 Users can also create their own connectors to other data storage or processing engines.
 
-This project is forked from [greenplum/pxf](https://github.com/greenplum-db/pxf-archive) and customized for Cloudberry Database.
+This project is forked from [greenplum/pxf](https://github.com/greenplum-db/pxf-archive) and customized for Apache Cloudberry.
 
 ## Repository Contents
 
-* `external-table/` : Contains the CloudberryDB extension implementing an External Table protocol handler
-* `fdw/` : Contains the CloudberryDB extension implementing a Foreign Data Wrapper (FDW) for PXF
+* `external-table/` : Contains the Cloudberry extension implementing an External Table protocol handler
+* `fdw/` : Contains the Cloudberry extension implementing a Foreign Data Wrapper (FDW) for PXF
 * `server/` : Contains the server side code of PXF along with the PXF Service and all the Plugins
 * `cli/` : Contains command line interface code for PXF
 * `automation/` : Contains the automation and integration tests for PXF against the various datasources
 * `singlecluster/` : Hadoop testing environment to exercise the pxf automation tests
 * `regression/` : Contains the end-to-end (integration) tests for PXF against the various datasources, utilizing the PostgreSQL testing framework `pg_regress`
-* `downloads/` : An empty directory that serves as a staging location for CloudberryDB RPMs for the development Docker image
+* `downloads/` : An empty directory that serves as a staging location for Cloudberry RPMs for the development Docker image
 
 ## PXF Development
 
-Below are the steps to build and install PXF along with its dependencies including CloudberryDB and Hadoop.
+Below are the steps to build and install PXF along with its dependencies including Cloudberry and Hadoop.
 
 > [!Note]
 > To start, ensure you have a `~/workspace` directory and have cloned the `pxf` and its prerequisites (shown below) under it.
@@ -38,7 +37,7 @@ Below are the steps to build and install PXF along with its dependencies includi
 mkdir -p ~/workspace
 cd ~/workspace
 
-git clone https://github.com/cloudberrydb/pxf.git
+git clone https://github.com/apache/cloudberry-pxf.git
 ```
 
 ### Install Dependencies
@@ -46,11 +45,11 @@ git clone https://github.com/cloudberrydb/pxf.git
 To build PXF, you must have:
 
 1. GCC compiler, `make` system, `unzip` package, `maven` for running integration tests
-2. Installed Cloudberry Database
+2. Installed Cloudberry
 
-    Either download and install CloudberryDB RPM or build CloudberryDB from the source by following instructions in the [CloudberryDB](https://github.com/cloudberrydb/cloudberrydb).
+    Either download and install Cloudberry RPM or build Cloudberry from the source by following instructions in the [Cloudberry](https://github.com/apache/cloudberry).
 
-    Assuming you have installed CloudberryDB into `/usr/local/cloudberrydb` directory, run its environment script:
+    Assuming you have installed Cloudberry into `/usr/local/cloudberrydb` directory, run its environment script:
     ```
     source /usr/local/cloudberrydb/greenplum_path.sh
     ```
@@ -131,7 +130,7 @@ If `${HOME}/pxf-base` does not exist, `pxf prepare` will create the directory fo
 
 ### Re-installing PXF after making changes
 
-Note: Local development with PXF requires a running CloudberryDB cluster.
+Note: Local development with PXF requires a running Cloudberry cluster.
 
 Once the desired changes have been made, there are 2 options to re-install PXF:
 
@@ -170,13 +169,13 @@ cp ${PXF_HOME}/templates/*-site.xml ${PXF_BASE}/servers/default
 ### Development With Docker
 
 > [!Note]
-> Since the docker container will house all Single cluster Hadoop, CloudberryDB and PXF, we recommend that you have at least 4 cpus and 6GB memory allocated to Docker. These settings are available under docker preferences.
+> Since the docker container will house all Single cluster Hadoop, Cloudberry and PXF, we recommend that you have at least 4 cpus and 6GB memory allocated to Docker. These settings are available under docker preferences.
 
-The quick and easy is to download the CloudberryDB RPM from GitHub and move it into the `/downloads` folder. Then run `./dev/start.bash` to get a docker image with a running CloudberryDB, Hadoop cluster and an installed PXF.
+The quick and easy is to download the Cloudberry RPM from GitHub and move it into the `/downloads` folder. Then run `./dev/start.bash` to get a docker image with a running Cloudberry, Hadoop cluster and an installed PXF.
 
-#### Setup CloudberryDB in the Docker image
+#### Setup Cloudberry in the Docker image
 
-Configure, build and install CloudberryDB. This will be needed only when you use the container for the first time with CloudberryDB source.
+Configure, build and install Cloudberry. This will be needed only when you use the container for the first time with Cloudberry source.
 
 ```bash
 ~/workspace/pxf/dev/build_gpdb.bash
@@ -185,7 +184,7 @@ sudo chown gpadmin:gpadmin /usr/local/cloudberry-db-devel
 ~/workspace/pxf/dev/install_gpdb.bash
 ```
 
-For subsequent minor changes to CloudberryDB source you can simply do the following:
+For subsequent minor changes to Cloudberry source you can simply do the following:
 ```bash
 ~/workspace/pxf/dev/install_gpdb.bash
 ```
@@ -195,7 +194,7 @@ Run all the instructions below and run GROUP=smoke (in one script):
 ~/workspace/pxf/dev/smoke_shortcut.sh
 ```
 
-Create CloudberryDB Cluster
+Create Cloudberry Cluster
 ```bash
 source /usr/local/cloudberrydb-db-devel/greenplum_path.sh
 make -C ~/workspace/cbdb create-demo-cluster


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 19/37: Address PR Feedback

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 9b8a8a6b0e674fc0a211707f7393aa54347502e4
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Fri Nov 18 08:56:44 2022 -0800

    Address PR Feedback
---
 concourse/docker/rpmrebuild/rhel/Dockerfile |  2 --
 external-table/src/gpdbwritableformatter.c  | 41 +++++++++++++----------------
 external-table/src/pxfheaders.c             |  2 +-
 external-table/src/pxfuriparser.c           |  2 +-
 4 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/concourse/docker/rpmrebuild/rhel/Dockerfile b/concourse/docker/rpmrebuild/rhel/Dockerfile
index 05b9364f..54b3392d 100644
--- a/concourse/docker/rpmrebuild/rhel/Dockerfile
+++ b/concourse/docker/rpmrebuild/rhel/Dockerfile
@@ -14,5 +14,3 @@ RUN rpmbuild --rebuild rpmrebuild-*.src.rpm \
     && rpm -i /root/rpmbuild/RPMS/noarch/rpmrebuild-*.el8.noarch.rpm \
     && rm rpmrebuild-*.src.rpm \
     && rm -rf /root/rpmbuild
-
-RUN yum install libcgroup-tools
diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c
index fc08cd24..d18b7e44 100644
--- a/external-table/src/gpdbwritableformatter.c
+++ b/external-table/src/gpdbwritableformatter.c
@@ -101,7 +101,7 @@ typedef struct
 /* for backward compatibility */
 #define GPDBWRITABLE_PREV_VERSION 1
 
-#define FORMATTER_ENCODING_ERR_MSG "pxfwritable_%1$s formatter can only %1$s UTF8 formatted data. Define the external table with ENCODING UTF8"
+#define FORMATTER_ENCODING_ERR_MSG "gpdbwritable formatter can only %s UTF8 formatted data. Define the external table with ENCODING UTF8"
 
 /* Bit flag */
 #define GPDBWRITABLE_BITFLAG_ISNULL 1	/* Column is null */
@@ -501,7 +501,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	nvalidcolumns = 0;
 	for (i = 0; i < ncolumns; i++)
 	{
-        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
+            Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		if (!attr->attisdropped)
 			nvalidcolumns++;
@@ -518,22 +518,19 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
         if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
         {
                  ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                            errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
+                            errmsg(FORMATTER_ENCODING_ERR_MSG, "export")));
         }
 #else
         Relation rel = FORMATTER_GET_RELATION(fcinfo);
-        if(rel != NULL)
-        {
-            ExtTableEntry *exttbl = GetExtTableEntry(rel->rd_id);
-            if (exttbl->encoding != PG_UTF8) {
-                ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                        errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
-            }
+        if(rel == NULL) {
+            ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                            errmsg(FORMATTER_ENCODING_ERR_MSG, "export")));
         }
-        // TODO: If for some reason the Relation is null here, then shall we throw an error anyways ??
-        else{
+
+        ExtTableEntry *exttbl = GetExtTableEntry(rel->rd_id);
+        if (exttbl->encoding != PG_UTF8) {
             ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                    errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
+                    errmsg(FORMATTER_ENCODING_ERR_MSG, "export")));
         }
 #endif
 
@@ -794,22 +791,20 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
             if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
             {
                      ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                                errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
+                                errmsg(FORMATTER_ENCODING_ERR_MSG, "import")));
             }
 #else
-        Relation rel = FORMATTER_GET_RELATION(fcinfo);
-        if(rel != NULL) {
+            Relation rel = FORMATTER_GET_RELATION(fcinfo);
+            if(rel == NULL) {
+                ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                                    errmsg(FORMATTER_ENCODING_ERR_MSG, "import")));
+            }
+
             ExtTableEntry *exttbl = GetExtTableEntry(rel->rd_id);
             if (exttbl->encoding != PG_UTF8) {
                 ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                        errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
+                        errmsg(FORMATTER_ENCODING_ERR_MSG, "import")));
             }
-        }
-        // TODO: If for some reason the Relation is null here, then shall we throw an error anyways ??
-        else{
-            ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-                    errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
-        }
 #endif
 
 		myData = palloc(sizeof(format_t));
diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 251add4e..da7887b1 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -735,7 +735,7 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
   pg_ltoa(number, long_number);
   churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
-    for (i = 0;varNumbers && i < numSimpleVars ; i++)
+    for (i = 0; i < numSimpleVars ; i++)
   {
     attrs_used =
       bms_add_member(attrs_used,
diff --git a/external-table/src/pxfuriparser.c b/external-table/src/pxfuriparser.c
index e251e0c9..eeee64d6 100644
--- a/external-table/src/pxfuriparser.c
+++ b/external-table/src/pxfuriparser.c
@@ -291,7 +291,7 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri)
 	{
 		OptionData *data = (OptionData *) lfirst(option);
 
-// For GP 5.x latest ( 5.29.8) the server_version_num is 80323.
+// For GP 5.x latest (5.29.8) the server_version_num is 80323.
 // For 6.x or later str_toupper doesn't work as it has different signature ( one extra parameter) so the asc_toupper will work for 6.x or 7.x
 #if PG_VERSION_NUM <= 80323
 		Value	   *key = makeString(str_toupper(data->key, strlen(data->key)));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 26/37: added Maven, Java 8 and pip install for GPDB7 docker images (#860)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 64875eb6652861811704f06b37dc9f8cbb223395
Author: Alexander Denissov <de...@users.noreply.github.com>
AuthorDate: Tue Sep 6 12:05:11 2022 -0700

    added Maven, Java 8 and pip install for GPDB7 docker images (#860)
---
 concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile | 17 +++++++++++++----
 .../docker/pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile   | 18 ++++++++++++++----
 2 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile b/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
index 9256d4ab..628f0d97 100644
--- a/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
+++ b/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
@@ -22,9 +22,19 @@ RUN useradd -s /sbin/nologin -d /opt/minio minio \
     && chmod +x /opt/minio/bin/minio \
     && chown -R minio:minio /opt/minio
 
+ARG MAVEN_VERSION=3.6.3
+ARG USER_HOME_DIR="/root"
+ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
+
 # install dependencies that are missing on the base images
-RUN ln -s /usr/share/apache-maven-*/bin/mvn /usr/bin/mvn \
-    && yum install -y rpm-build jq sudo java-1.8.0-openjdk-devel java-11-openjdk-devel && yum clean all
+RUN curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
+    && mkdir -p /usr/share/maven \
+    && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
+    && rm -f /tmp/apache-maven.tar.gz \
+    && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
+    && yum install -y rpm-build python-devel jq sudo java-1.8.0-openjdk java-11-openjdk-devel && yum clean all \
+    && cd /tmp && /usr/bin/pip install --upgrade pip==20.3.3 \
+    && /usr/bin/pip install paramiko --no-cache-dir
 
 # create user gpadmin since GPDB cannot run under root
 RUN ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa \
@@ -63,8 +73,7 @@ RUN ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa \
     && echo >> ~gpadmin/.pxfrc 'export PXF_HOME=/usr/local/pxf-gp7' \
     && echo >> ~gpadmin/.pxfrc 'export PXF_CONF=/home/gpadmin/pxf' \
     && echo >> ~gpadmin/.pxfrc 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk' \
-    && echo >> ~gpadmin/.pxfrc 'export PG_CONFIG=${GPHOME}/bin/pg_config' \
-    && echo >> ~gpadmin/.pxfrc 'export PATH=${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$PATH' \
+    && echo >> ~gpadmin/.pxfrc 'export PATH=${GPHOME}/bin:${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$JAVA_HOME/bin:$PATH' \
     && ln -s ~gpadmin/.pxfrc ~root \
     && echo >> ~gpadmin/.bashrc 'source ~/.pxfrc' \
     && chown -R gpadmin:gpadmin ~gpadmin
diff --git a/concourse/docker/pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile b/concourse/docker/pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile
index 93c512d3..31cec79a 100644
--- a/concourse/docker/pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile
+++ b/concourse/docker/pxf-dev-base/gpdb7/ubuntu18.04/Dockerfile
@@ -14,12 +14,21 @@ RUN mkdir -p /tmp/pxf_src/ && cd /tmp \
     && rm -rf /usr/local/go && tar -C /usr/local -xzf go.tgz && rm go.tgz
 
 # install dependencies that are missing on the base images
+# install a specific version of perl for tinc
+
+ARG MAVEN_VERSION=3.6.3
+ARG USER_HOME_DIR="/root"
+ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
+
 RUN apt-get update -y \
     && DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev curl sudo jq openjdk-8-jdk openjdk-11-jdk \
     && apt-get clean \
     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
-    && mkdir -p /usr/share/apache-maven-*/ref \
-    && ln -s /usr/share/apache-maven-*/bin/mvn /usr/bin/mvn
+    && mkdir -p /usr/share/maven /usr/share/maven/ref \
+    && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
+    && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
+    && rm -f /tmp/apache-maven.tar.gz \
+    && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
 
 # create user gpadmin since GPDB cannot run under root
 RUN locale-gen en_US.UTF-8 \
@@ -42,6 +51,8 @@ RUN locale-gen en_US.UTF-8 \
     && echo "gpadmin:password" | chpasswd 2> /dev/null \
     && { ssh-keyscan localhost; ssh-keyscan 0.0.0.0; } >> /home/gpadmin/.ssh/known_hosts \
     && chown -R gpadmin:gpadmin /home/gpadmin \
+    # install dependencies as gpadmin
+    && su gpadmin -c "pip install paramiko --no-cache-dir" \
     # configure gpadmin limits
     && echo >> /etc/security/limits.d/gpadmin-limits.conf 'gpadmin soft core unlimited' \
     && echo >> /etc/security/limits.d/gpadmin-limits.conf 'gpadmin soft nproc 131072' \
@@ -57,8 +68,7 @@ RUN locale-gen en_US.UTF-8 \
     && echo >> ~gpadmin/.pxfrc 'export PXF_HOME=/usr/local/pxf-gp7' \
     && echo >> ~gpadmin/.pxfrc 'export PXF_CONF=/home/gpadmin/pxf' \
     && echo >> ~gpadmin/.pxfrc 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64' \
-    && echo >> ~gpadmin/.pxfrc 'export PG_CONFIG=${GPHOME}/bin/pg_config' \
-    && echo >> ~gpadmin/.pxfrc 'export PATH=${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$PATH' \
+    && echo >> ~gpadmin/.pxfrc 'export PATH=${GPHOME}/bin:${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$JAVA_HOME/bin:$PATH' \
     && ln -s ~gpadmin/.pxfrc ~root \
     && echo >> ~gpadmin/.bashrc 'source ~/.pxfrc' \
     && echo >> ~gpadmin/.bash_profile '[[ -f ~/.bashrc ]] && . ~/.bashrc' \


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 18/37: Applying master changes for pxfheaders.c and test.yml to the branch to avoid conflict

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 22810f6d1549a11606ff62da105cd8b2aa0677b4
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Oct 20 15:19:00 2022 -0700

    Applying master changes for pxfheaders.c and test.yml to the branch to avoid conflict
---
 external-table/src/pxfheaders.c | 223 +++++++++++++++++++---------------------
 1 file changed, 104 insertions(+), 119 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 2845ca45..251add4e 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -116,15 +116,15 @@ build_http_headers(PxfInputData *input)
 
 		churl_headers_append(headers, "X-GP-FORMAT", format);
 
-		/* Parse fmtOptString here */
-		if (fmttype_is_text(exttbl->fmtcode) || fmttype_is_csv(exttbl->fmtcode))
-		{
+    /* Parse fmtOptString here */
+    if (fmttype_is_text(exttbl->fmtcode) || fmttype_is_csv(exttbl->fmtcode))
+    {
 #if PG_VERSION_NUM >= 120000
-			copyFmtOpts = exttbl->options;
+      copyFmtOpts = exttbl->options;
 #else
-			copyFmtOpts = parseCopyFormatString(rel, exttbl->fmtopts, exttbl->fmtcode);
+      copyFmtOpts = parseCopyFormatString(rel, exttbl->fmtopts, exttbl->fmtcode);
 #endif
-		}
+    }
 
 		/* pass external table's encoding to copy's options */
 		copyFmtOpts = appendCopyEncodingOptionToList(copyFmtOpts, exttbl->encoding);
@@ -508,14 +508,13 @@ int getNumSimpleVars(ProjectionInfo *projInfo)
 #if PG_VERSION_NUM < 120000
 static void
 add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
-							   ProjectionInfo *projInfo,
-							   List *qualsAttributes,
-							   Relation rel)
+                 ProjectionInfo *projInfo,
+                 List *qualsAttributes,
+                 Relation rel)
 {
 	int			   i;
 	int			   dropped_count;
 	int			   number;
-	int			   numTargetList;
 #if PG_VERSION_NUM < 90400
 	int			   numSimpleVars;
 #endif
@@ -528,7 +527,8 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 
 	// STEP 0: initialize variables
 	initStringInfo(&formatter);
-	numTargetList = 0;
+	attrs_used = NULL;
+	number = 0;
 
 #if PG_VERSION_NUM >= 90400
 	/*
@@ -576,21 +576,6 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 	}
 #endif
 
-	number = numTargetList +
-#if PG_VERSION_NUM >= 90400
-		projInfo->pi_numSimpleVars +
-#else
-		numSimpleVars +
-#endif
-		list_length(qualsAttributes);
-	if (number == 0)
-		return;
-
-	attrs_used = NULL;
-
-	/* Convert the number of projection columns to a string */
-	pg_ltoa(number, long_number);
-	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
 #if PG_VERSION_NUM >= 90400
 	for (i = 0; i < projInfo->pi_numSimpleVars; i++)
@@ -668,35 +653,35 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 #if PG_VERSION_NUM >= 120000
 static void
 add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
-							   ProjectionInfo *projInfo,
-							   List *qualsAttributes,
-							   Relation rel)
+                 ProjectionInfo *projInfo,
+                 List *qualsAttributes,
+                 Relation rel)
 {
-	int			   i;
-	int			   dropped_count;
-	int			   number;
-	int			   numTargetList;
-	char			long_number[sizeof(int32) * 8];
+  int        i;
+  int        dropped_count;
+  int        number;
+  int        numTargetList;
+  char      long_number[sizeof(int32) * 8];
     // In versions < 120000, projInfo->pi_varNumbers contains atttribute numbers of SimpleVars
     // Since,this pi_varNumbers doesn't exist in PG12 and above, we can add the attribute numbers by
     // iterating on the Simple vars.
-	int				varNumbers[sizeof(int32) * 8];
-	Bitmapset		*attrs_used;
-	StringInfoData	formatter;
-	TupleDesc		tupdesc;
-	initStringInfo(&formatter);
-	numTargetList = 0;
-
-	 List *targetList = (List *) projInfo->pi_state.expr;
+  int       varNumbers[sizeof(int32) * 8];
+  Bitmapset   *attrs_used;
+  StringInfoData  formatter;
+  TupleDesc   tupdesc;
+  initStringInfo(&formatter);
+  numTargetList = 0;
+
+   List *targetList = (List *) projInfo->pi_state.expr;
      int  numSimpleVars = 0;
 
-	int numNonSimpleVars = 0;
+  int numNonSimpleVars = 0;
 
     // TODO Re-evaluate this logic and may be we don't need numNonSimpleVars
-	 for (int i = 0; i < projInfo->pi_state.steps_len; i++)
+   for (int i = 0; i < projInfo->pi_state.steps_len; i++)
      {
          ExprEvalStep *step = &projInfo->pi_state.steps[i];
-         ExprEvalOp	opcode = ExecEvalStepOp(&projInfo->pi_state, step);
+         ExprEvalOp opcode = ExecEvalStepOp(&projInfo->pi_state, step);
              if ( opcode == EEOP_ASSIGN_INNER_VAR ||
                      opcode == EEOP_ASSIGN_OUTER_VAR ||
                      opcode == EEOP_ASSIGN_SCAN_VAR)
@@ -706,94 +691,94 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
                      numNonSimpleVars++;
      }
 
-	/*
-	 * Non-simpleVars are added to the targetlist
-	 * we use expression_tree_walker to access attrno information
-	 * we do it through a helper function add_attnums_from_targetList
-	 */
-	if (targetList)
-	{
+  /*
+   * Non-simpleVars are added to the targetlist
+   * we use expression_tree_walker to access attrno information
+   * we do it through a helper function add_attnums_from_targetList
+   */
+  if (targetList)
+  {
 
-		List     *l = lappend_int(NIL, 0);
-		ListCell *lc1;
+    List     *l = lappend_int(NIL, 0);
+    ListCell *lc1;
 
-		foreach(lc1, targetList)
-		{
-			ExprState *gstate = (ExprState *) lfirst(lc1);
+    foreach(lc1, targetList)
+    {
+      ExprState *gstate = (ExprState *) lfirst(lc1);
             add_attnums_from_targetList( (Node *) gstate, l);
-		}
+    }
 
         int i=0;
-		foreach(lc1, l)
-		{
-			int attno = lfirst_int(lc1);
-			if (attno > InvalidAttrNumber)
-			{
-				add_projection_index_header(headers,
-											formatter, attno - 1, long_number);
-				numTargetList++;
+    foreach(lc1, l)
+    {
+      int attno = lfirst_int(lc1);
+      if (attno > InvalidAttrNumber)
+      {
+        add_projection_index_header(headers,
+                      formatter, attno - 1, long_number);
+        numTargetList++;
                 varNumbers[i] = attno;
                 i++;
-			}
-		}
+      }
+    }
 
-		list_free(l);
-	}
+    list_free(l);
+  }
 
-	number = numTargetList + numSimpleVars + list_length(qualsAttributes);
-	if (number == 0)
-		return;
+  number = numTargetList + numSimpleVars + list_length(qualsAttributes);
+  if (number == 0)
+    return;
 
-	attrs_used = NULL;
+  attrs_used = NULL;
 
-	/* Convert the number of projection columns to a string */
-	pg_ltoa(number, long_number);
-	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
+  /* Convert the number of projection columns to a string */
+  pg_ltoa(number, long_number);
+  churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
     for (i = 0;varNumbers && i < numSimpleVars ; i++)
-	{
-		attrs_used =
-			bms_add_member(attrs_used,
+  {
+    attrs_used =
+      bms_add_member(attrs_used,
                            varNumbers[i] - FirstLowInvalidHeapAttributeNumber);
-	}
-
-	ListCell *attribute = NULL;
-
-	/*
-	 * AttrNumbers coming from quals
-	 */
-	foreach(attribute, qualsAttributes)
-	{
-		AttrNumber attrNumber = (AttrNumber) lfirst_int(attribute);
-		attrs_used =
-			bms_add_member(attrs_used,
-						 attrNumber + 1 - FirstLowInvalidHeapAttributeNumber);
-	}
-
-	tupdesc = RelationGetDescr(rel);
-	dropped_count = 0;
-
-	for (i = 1; i <= tupdesc->natts; i++)
-	{
-		/* Ignore dropped attributes. */
-		if (tupdesc->attrs[i - 1].attisdropped)
-		{
-			/* keep a counter of the number of dropped attributes */
-			dropped_count++;
-			continue;
-		}
-
-		if (bms_is_member(i - FirstLowInvalidHeapAttributeNumber, attrs_used))
-		{
-			/* Shift the column index by the running dropped_count */
-			add_projection_index_header(headers, formatter,
-										i - 1 - dropped_count, long_number);
-		}
-	}
-
-	list_free(qualsAttributes);
-	pfree(formatter.data);
-	bms_free(attrs_used);
+  }
+
+  ListCell *attribute = NULL;
+
+  /*
+   * AttrNumbers coming from quals
+   */
+  foreach(attribute, qualsAttributes)
+  {
+    AttrNumber attrNumber = (AttrNumber) lfirst_int(attribute);
+    attrs_used =
+      bms_add_member(attrs_used,
+             attrNumber + 1 - FirstLowInvalidHeapAttributeNumber);
+  }
+
+  tupdesc = RelationGetDescr(rel);
+  dropped_count = 0;
+
+  for (i = 1; i <= tupdesc->natts; i++)
+  {
+    /* Ignore dropped attributes. */
+    if (tupdesc->attrs[i - 1].attisdropped)
+    {
+      /* keep a counter of the number of dropped attributes */
+      dropped_count++;
+      continue;
+    }
+
+    if (bms_is_member(i - FirstLowInvalidHeapAttributeNumber, attrs_used))
+    {
+      /* Shift the column index by the running dropped_count */
+      add_projection_index_header(headers, formatter,
+                    i - 1 - dropped_count, long_number);
+    }
+  }
+
+  list_free(qualsAttributes);
+  pfree(formatter.data);
+  bms_free(attrs_used);
 }
 #endif
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 21/37: fix: refactor projection header logic for PostgreSQL compatibility

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 2b70d309e6d7174fe04ace05069981f510f26ef6
Author: liuxiaoyu <li...@hashdata.cn>
AuthorDate: Tue Oct 7 18:49:55 2025 +0800

    fix: refactor projection header logic for PostgreSQL compatibility
    
    - Restore original projection counting logic in pxfheaders.c
    - Remove premature number calculation and header setting
    - Fix attribute collection flow for different PG versions
    - Clean up code formatting and comments
    - Update Makefile configuration
    - Minor formatting fix in pxfdelimited_formatter.c
---
 Makefile                                    |  8 ++++----
 external-table/src/pxfdelimited_formatter.c |  2 +-
 external-table/src/pxfheaders.c             | 30 ++++++++++++++---------------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index 30b9d3f7..1014689f 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ifneq ($(FDW_SUPPORT),)
 endif
 
 cli:
-	make -C cli/go/src/pxf-cli
+	make -C cli
 
 server:
 	make -C server
@@ -42,7 +42,7 @@ server:
 clean:
 	rm -rf build
 	make -C $(SOURCE_EXTENSION_DIR) clean-all
-	make -C cli/go/src/pxf-cli clean
+	make -C cli clean
 	make -C server clean
 ifneq ($(FDW_SUPPORT),)
 	make -C fdw clean
@@ -62,7 +62,7 @@ it:
 
 install:
 	make -C $(SOURCE_EXTENSION_DIR) install
-	make -C cli/go/src/pxf-cli install
+	make -C cli install
 	make -C server install
 ifneq ($(FDW_SUPPORT),)
 	make -C fdw install
@@ -105,7 +105,7 @@ gppkg-rpm: rpm
 
 rpm:
 	make -C $(SOURCE_EXTENSION_DIR) stage
-	make -C cli/go/src/pxf-cli stage
+	make -C cli stage
 	make -C server stage
 	set -e ;\
 	PXF_MAIN_VERSION=$${PXF_VERSION//-SNAPSHOT/} ;\
diff --git a/external-table/src/pxfdelimited_formatter.c b/external-table/src/pxfdelimited_formatter.c
index ecf9f52b..6617c547 100644
--- a/external-table/src/pxfdelimited_formatter.c
+++ b/external-table/src/pxfdelimited_formatter.c
@@ -234,7 +234,7 @@ new_pxfdelimited_state(FunctionCallInfo fcinfo)
 	fmt_state->nColumns = nColumns;
 
 	fmt_state->external_encoding = FORMATTER_GET_EXTENCODING(fcinfo);
-	fmt_state->enc_conversion_proc = ((FormatterData*) fcinfo->context)->fmt_conversion_proc;
+	fmt_state->enc_conversion_proc = ((FormatterData*) fcinfo->context)->fmt_conv_funcs;
 
 	fmt_state->saw_delim = false;
 	fmt_state->saw_eol = false;
diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 0c991eb7..583384a3 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -522,10 +522,8 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 	int				*varNumbers = projInfo->pi_varNumbers;
 	Bitmapset		*attrs_used;
 	StringInfoData	formatter;
-	List		   *targetList;   // targetList from the query plan
-	TupleDesc	   tupdesc;
+	TupleDesc		tupdesc;
 
-	// STEP 0: initialize variables
 	initStringInfo(&formatter);
 	attrs_used = NULL;
 	number = 0;
@@ -544,9 +542,10 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 	if (!varNumbers)
 	{
 		/*
-		 * we use expression_tree_walker to access attrno information
-		 * we do it through a helper function add_attnums_from_targetList
+		 * When there are not just simple Vars we need to
+		 * walk the tree to get attnums
 		 */
+#endif
 		List     *l = lappend_int(NIL, 0);
 		ListCell *lc1;
 
@@ -563,7 +562,7 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 			{
 				attrs_used =
 					bms_add_member(attrs_used,
-								 attno - FirstLowInvalidHeapAttributeNumber);
+									attno - FirstLowInvalidHeapAttributeNumber);
 			}
 		}
 
@@ -588,8 +587,11 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 						 varNumbers[i] - FirstLowInvalidHeapAttributeNumber);
 	}
 
-	// STEP 3: collect attribute numbers from qualifiers (WHERE conditions)
 	ListCell *attribute = NULL;
+
+	/*
+	 * AttrNumbers coming from quals
+	 */
 	foreach(attribute, qualsAttributes)
 	{
 		AttrNumber attrNumber = (AttrNumber) lfirst_int(attribute);
@@ -598,10 +600,8 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 						 attrNumber + 1 - FirstLowInvalidHeapAttributeNumber);
 	}
 
-	// STEP 4: for attributes in the relation that are not dropped, add projection headers for those selected in steps 0 - 3 above
 	tupdesc = RelationGetDescr(rel);
-	droppedCount = 0;
-	headerCount = 0;
+	dropped_count = 0;
 
 	for (i = 1; i <= tupdesc->natts; i++)
 	{
@@ -609,7 +609,7 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 		if (tupdesc->attrs[i - 1]->attisdropped)
 		{
 			/* keep a counter of the number of dropped attributes */
-			droppedCount++;
+			dropped_count++;
 			continue;
 		}
 
@@ -617,15 +617,15 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 		{
 			/* Shift the column index by the running dropped_count */
 			add_projection_index_header(headers, formatter,
-										i - 1 - droppedCount, long_number);
-			headerCount++;
+										i - 1 - dropped_count, long_number);
+			number++;
 		}
 	}
 
-	if (headerCount != 0)
+	if (number != 0)
 	{
 		/* Convert the number of projection columns to a string */
-		pg_ltoa(headerCount, long_number);
+		pg_ltoa(number, long_number);
 		churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 	}
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 13/37: Added Python dependencies for Tinc Tests

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 7815283028d7dfa980e39aedbf79bc9308c83f98
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 22 16:09:50 2022 -0700

    Added Python dependencies for Tinc Tests
---
 .../pxf/automation/components/common/DbSystemObject.java       |  1 +
 concourse/scripts/pxf_common.bash                              |  7 +++++++
 concourse/scripts/test.bash                                    | 10 ++++++++++
 concourse/tasks/test.yml                                       |  2 ++
 4 files changed, 20 insertions(+)

diff --git a/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java b/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
index c389ea5b..e07e2456 100755
--- a/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
+++ b/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
@@ -358,6 +358,7 @@ public abstract class DbSystemObject extends BaseSystemObject implements IDbFunc
 		if (table != null) {
 			tableName = table.getName();
 		}
+		// TODO : Conflict with Alex's PR need to remove later.
 		return metaData.getTables(null, null, "%" + tableName, new String[] { "TABLE", "FOREIGN TABLE" });
 	}
 
diff --git a/concourse/scripts/pxf_common.bash b/concourse/scripts/pxf_common.bash
index 2f5118be..c313a32c 100755
--- a/concourse/scripts/pxf_common.bash
+++ b/concourse/scripts/pxf_common.bash
@@ -53,6 +53,13 @@ function inflate_dependencies() {
 		tarballs+=(regression-tools/regression-tools.tar.gz)
 	fi
 
+  # TODO : Conflict with Alex's PR need to remove later.
+  # when running automation against GP7, we need python2 dependencies shipped with gp6 to make Tinc work
+  # if required, these libraries will be fetched by a CI pipeline under gp6-python-libs directory
+  if [[ -f gp6-python-libs/gp6-python-libs.tar.gz ]]; then
+    tarballs+=(gp6-python-libs/gp6-python-libs.tar.gz)
+  fi
+
 	(( ${#tarballs[@]} == 0 )) && return
 	for t in "${tarballs[@]}"; do
 		tar -xzf "${t}" -C ~gpadmin
diff --git a/concourse/scripts/test.bash b/concourse/scripts/test.bash
index 206e323f..b2e724ed 100755
--- a/concourse/scripts/test.bash
+++ b/concourse/scripts/test.bash
@@ -203,6 +203,16 @@ fi
 
 	inflate_dependencies
 
+  # TODO : Conflict with Alex's PR need to remove later.
+  # To run Tinc against GP7 we need to modify PYTHONPATH in $GPHOME/greenplum_path.sh since Tinc calls that script
+  # we will set PYTHONPATH to point to the set of python libs compiled with Python2 for GP6
+  if [[ ${GP_VER} == 7 ]]; then
+    local gp6_python_libs=~gpadmin/python
+    echo "export PYTHONPATH=${gp6_python_libs}" >> /usr/local/greenplum-db/greenplum_path.sh
+  fi
+
+
+
 	ln -s "${PWD}/pxf_src" ~gpadmin/pxf_src
 
 	# Run tests
diff --git a/concourse/tasks/test.yml b/concourse/tasks/test.yml
index 695470af..6f89f8c9 100644
--- a/concourse/tasks/test.yml
+++ b/concourse/tasks/test.yml
@@ -15,6 +15,8 @@ inputs:
   optional: true
 - name: pxf_gp7_headerfile
   optional: true
+- name: gp6-python-libs # TODO : Conflict with Alex's PR need to remove later.
+  optional: true
 
 params:
   ACCESS_KEY_ID:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 07/37: Code Refactor

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit cb5995454a509ee88feead17c291544cf1ea66ff
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 15 15:28:40 2022 -0700

    Code Refactor
---
 external-table/src/gpdbwritableformatter.c | 81 ++++++++++--------------------
 1 file changed, 26 insertions(+), 55 deletions(-)

diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c
index a76a836d..79dd35eb 100644
--- a/external-table/src/gpdbwritableformatter.c
+++ b/external-table/src/gpdbwritableformatter.c
@@ -54,6 +54,7 @@ PG_FUNCTION_INFO_V1(gpdbwritableformatter_export);
 PG_FUNCTION_INFO_V1(gpdbwritableformatter_import);
 Datum		gpdbwritableformatter_import(PG_FUNCTION_ARGS);
 Datum		gpdbwritableformatter_export(PG_FUNCTION_ARGS);
+static Form_pg_attribute getAttributeFromTupleDesc(TupleDesc, int);
 
 static const int ERR_COL_OFFSET = 9;
 static const int FIRST_LINE_NUM = 1;
@@ -347,11 +348,7 @@ boolArrayToByteArray(bool *data, int len, int validlen, int *outlen, TupleDesc t
 	for (i = 0, j = 0, k = 7; i < len; i++)
 	{
 		/* Ignore dropped attributes. */
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		if (attr->attisdropped) continue;
 
@@ -396,11 +393,7 @@ byteArrayToBoolArray(bits8 *data, int data_len, int len, bool **booldata, int bo
 	for (i = 0, j = 0, k = 7; i < boollen; i++)
 	{
 		/* Ignore dropped attributes. */
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		if (attr->attisdropped)
 		{
@@ -440,11 +433,7 @@ verifyExternalTableDefinition(int16 ncolumns_remote, AttrNumber nvalidcolumns, A
 	/* Extract Column Type and check against External Table definition */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped) continue;
@@ -512,11 +501,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	nvalidcolumns = 0;
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		if (!attr->attisdropped)
 			nvalidcolumns++;
@@ -545,11 +530,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 		/* setup the text/binary input function */
 		for (i = 0; i < ncolumns; i++)
 		{
-            #if PG_VERSION_NUM >= 120000
-                Form_pg_attribute attr = &tupdesc->attrs[i];
-            #else
-                Form_pg_attribute attr = tupdesc->attrs[i];
-            #endif
+            Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 			Oid			type = attr->atttypid;
 			bool		isvarlena;
@@ -607,11 +588,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	 */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped) continue;
@@ -697,11 +674,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Write col type for columns that have not been dropped */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		/* Ignore dropped attributes. */
 		if (!attr->attisdropped)
@@ -718,11 +691,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Column Value */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		/* Ignore dropped attributes and null values. */
 		if (!attr->attisdropped && !myData->nulls[i])
@@ -789,11 +758,7 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	/* Get the number of valid columns, excluding dropped columns */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
-        #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
-        #endif
+        Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 		if (!attr->attisdropped)
 			nvalidcolumns++;
@@ -820,11 +785,7 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 
 		for (i = 0; i < ncolumns; i++)
 		{
-			#if PG_VERSION_NUM >= 120000
-				Form_pg_attribute attr = &tupdesc->attrs[i];
-			#else
-				Form_pg_attribute attr = tupdesc->attrs[i];
-			#endif
+			Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc,i);
 
 			Oid type = attr->atttypid;
 
@@ -942,11 +903,7 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	/* extract column value */
 	for (i = 0; i < ncolumns; i++)
 	{
-		#if PG_VERSION_NUM >= 120000
-			Form_pg_attribute attr = &tupdesc->attrs[i];
-		#else
-			Form_pg_attribute attr = tupdesc->attrs[i];
-		#endif
+		Form_pg_attribute attr = getAttributeFromTupleDesc(tupdesc, i);
 
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped)
@@ -1051,3 +1008,17 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	FORMATTER_SET_TUPLE(fcinfo, tuple);
 	FORMATTER_RETURN_TUPLE(tuple);
 }
+
+static inline Form_pg_attribute
+getAttributeFromTupleDesc(TupleDesc tupdesc, int index)
+{
+    Form_pg_attribute attr;
+    #if PG_VERSION_NUM >= 120000
+         attr = &tupdesc->attrs[index];
+    #else
+         attr = tupdesc->attrs[index];
+    #endif
+
+    return attr;
+
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 16/37: fix projection calculation for GP7

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit db6cdfce6c6a5f1beacbbd81868878789e6222ce
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Mon Oct 10 15:21:37 2022 -0700

    fix projection calculation for GP7
---
 external-table/src/pxfheaders.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index a9bd3661..2845ca45 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -677,33 +677,35 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
 	int			   number;
 	int			   numTargetList;
 	char			long_number[sizeof(int32) * 8];
-	//int				*varNumbers = projInfo->pi_varNumbers;
+    // In versions < 120000, projInfo->pi_varNumbers contains atttribute numbers of SimpleVars
+    // Since,this pi_varNumbers doesn't exist in PG12 and above, we can add the attribute numbers by
+    // iterating on the Simple vars.
+	int				varNumbers[sizeof(int32) * 8];
 	Bitmapset		*attrs_used;
 	StringInfoData	formatter;
 	TupleDesc		tupdesc;
-    ExprEvalStep step;
 	initStringInfo(&formatter);
 	numTargetList = 0;
 
 	 List *targetList = (List *) projInfo->pi_state.expr;
      int  numSimpleVars = 0;
 
-#if PG_VERSION_NUM >= 90400
-
 	int numNonSimpleVars = 0;
 
+    // TODO Re-evaluate this logic and may be we don't need numNonSimpleVars
 	 for (int i = 0; i < projInfo->pi_state.steps_len; i++)
      {
-             step = projInfo->pi_state.steps[i];
-             if (step.opcode == EEOP_ASSIGN_INNER_VAR ||
-                     step.opcode == EEOP_ASSIGN_OUTER_VAR ||
-                     step.opcode == EEOP_ASSIGN_SCAN_VAR)
+         ExprEvalStep *step = &projInfo->pi_state.steps[i];
+         ExprEvalOp	opcode = ExecEvalStepOp(&projInfo->pi_state, step);
+             if ( opcode == EEOP_ASSIGN_INNER_VAR ||
+                     opcode == EEOP_ASSIGN_OUTER_VAR ||
+                     opcode == EEOP_ASSIGN_SCAN_VAR)
                      numSimpleVars++;
-             else if (step.opcode == EEOP_ASSIGN_TMP_MAKE_RO ||
-                              step.opcode == EEOP_ASSIGN_TMP)
+             else if (opcode == EEOP_ASSIGN_TMP_MAKE_RO ||
+                        opcode == EEOP_ASSIGN_TMP)
                      numNonSimpleVars++;
      }
-      int * varNumbers = &numNonSimpleVars;
+
 	/*
 	 * Non-simpleVars are added to the targetlist
 	 * we use expression_tree_walker to access attrno information
@@ -711,15 +713,7 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
 	 */
 	if (targetList)
 	{
-#else
 
-	if (numNonSimpleVars > 0)
-	{
-		/*
-		 * When there are not just simple Vars we need to
-		 * walk the tree to get attnums
-		 */
-#endif
 		List     *l = lappend_int(NIL, 0);
 		ListCell *lc1;
 
@@ -729,6 +723,7 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
             add_attnums_from_targetList( (Node *) gstate, l);
 		}
 
+        int i=0;
 		foreach(lc1, l)
 		{
 			int attno = lfirst_int(lc1);
@@ -737,6 +732,8 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
 				add_projection_index_header(headers,
 											formatter, attno - 1, long_number);
 				numTargetList++;
+                varNumbers[i] = attno;
+                i++;
 			}
 		}
 
@@ -753,11 +750,11 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
 	pg_ltoa(number, long_number);
 	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
-    for (i = 0; varNumbers && i < numSimpleVars ; i++)
+    for (i = 0;varNumbers && i < numSimpleVars ; i++)
 	{
 		attrs_used =
 			bms_add_member(attrs_used,
-						 varNumbers[i] - FirstLowInvalidHeapAttributeNumber);
+                           varNumbers[i] - FirstLowInvalidHeapAttributeNumber);
 	}
 
 	ListCell *attribute = NULL;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 34/37: added specs for gpdb7-rhel8-test-pxf docker image (#867)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 26c0920e3513c12a2caeb1255c5ae9a54a7d9fbe
Author: Alexander Denissov <de...@users.noreply.github.com>
AuthorDate: Thu Sep 15 17:00:27 2022 -0700

    added specs for gpdb7-rhel8-test-pxf docker image (#867)
---
 concourse/docker/pxf-dev-base/README.md            |  19 ++-
 concourse/docker/pxf-dev-base/cloudbuild.yaml      |  33 ++++-
 .../docker/pxf-dev-base/gpdb7/rhel8/Dockerfile     |  25 ++--
 concourse/pipelines/cloudbuild_pipeline.yml        | 148 +++++++++++++++++++--
 4 files changed, 197 insertions(+), 28 deletions(-)

diff --git a/concourse/docker/pxf-dev-base/README.md b/concourse/docker/pxf-dev-base/README.md
index 69418887..b905fb1c 100644
--- a/concourse/docker/pxf-dev-base/README.md
+++ b/concourse/docker/pxf-dev-base/README.md
@@ -132,7 +132,9 @@ following command to build the image:
 
 ### Docker gpdb7-rocky8-test-pxf-image image
 
-Build this image for Greenplum 7 running on Rocky 8. Run the following
+TODO: ===> remove this if Greenplum 7 will not be supported on Centos7 <===
+
+Build this image for Greenplum 7 running on CentOS 7. Run the following
 command to build the image:
 
     pushd ~/workspace/pxf/concourse/docker/pxf-dev-base/
@@ -145,6 +147,21 @@ command to build the image:
       .
     popd
 
+### Docker gpdb7-rhel8-test-pxf-image image
+
+Build this image for Greenplum 7 running on Rhel 8. Run the following
+command to build the image:
+
+    pushd ~/workspace/pxf/concourse/docker/pxf-dev-base/
+    docker build \
+      --build-arg=BASE_IMAGE=gcr.io/data-gpdb-private-images/gpdb7-rhel8-test:latest \
+      --build-arg=GINKGO_VERSION=${GINKGO_VERSION} \
+      --tag=gpdb7-rhel8-test-pxf \
+      -f ~/workspace/pxf/concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile \
+      .
+    popd
+
+### Docker gpdb7-ubuntu18.04-test-pxf-image image
 
 ### Docker gpdb7-rocky9-test-pxf-image image
 
diff --git a/concourse/docker/pxf-dev-base/cloudbuild.yaml b/concourse/docker/pxf-dev-base/cloudbuild.yaml
index 1b999d0c..d7fd8d10 100644
--- a/concourse/docker/pxf-dev-base/cloudbuild.yaml
+++ b/concourse/docker/pxf-dev-base/cloudbuild.yaml
@@ -224,7 +224,33 @@ steps:
   - apache-maven-binaries
   - gpdb7-rocky8-test-pxf-image-cache
 
-  # Greenplum 7 Rocky 9 Image
+# Greenplum 7 Rhel 8 Image
+- name: 'gcr.io/cloud-builders/docker'
+  id: gpdb7-rhel8-test-pxf-image-cache
+  entrypoint: 'bash'
+  args:
+    - '-c'
+    - |
+      mkdir -p /workspace/build
+      docker pull gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rhel8-test-pxf:latest || exit 0
+  waitFor: ['-']
+
+- name: 'gcr.io/cloud-builders/docker'
+  id: gpdb7-rhel8-test-pxf-image
+  args:
+    - 'build'
+    - '--build-arg=BASE_IMAGE=${_PRIVATE_BASE_IMAGE_REPOSITORY}/gpdb7-rhel8-test:latest'
+    - '--build-arg=GINKGO_VERSION=${_GINKGO_VERSION}'
+    - '--tag=gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rhel8-test-pxf:$COMMIT_SHA'
+    - '--cache-from'
+    - 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rhel8-test-pxf:latest'
+    - '-f'
+    - 'concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile'
+    - '/workspace/build/'
+  waitFor:
+    - gpdb7-rhel8-test-pxf-image-cache
+
+# Greenplum 7 Ubuntu 18.04 Image
 - name: 'gcr.io/cloud-builders/docker'
   id: gpdb7-rocky9-test-pxf-image-cache
   entrypoint: 'bash'
@@ -265,5 +291,6 @@ images:
 - 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-rocky9-test-pxf:$COMMIT_SHA'
 - 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-ubuntu18.04-test-pxf:$COMMIT_SHA'
 - 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-oel7-test-pxf:$COMMIT_SHA'
-- 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rocky8-test-pxf:$COMMIT_SHA'
-- 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rocky9-test-pxf:$COMMIT_SHA'
+- 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-centos7-test-pxf:$COMMIT_SHA'
+- 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-rhel8-test-pxf:$COMMIT_SHA'
+- 'gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb7-ubuntu18.04-test-pxf:$COMMIT_SHA'
diff --git a/concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile b/concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile
index 39ccd433..6217f14c 100644
--- a/concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile
+++ b/concourse/docker/pxf-dev-base/gpdb7/rhel8/Dockerfile
@@ -2,16 +2,10 @@ ARG BASE_IMAGE=gcr.io/data-gpdb-private-images/gpdb7-rhel8-test:latest
 
 FROM ${BASE_IMAGE}
 
-ARG GO_VERSION
-ARG GO_SHA256SUM
-
-ADD apache-maven.tar.gz /usr/share
+ARG GINKGO_VERSION
 
 # install Go utilities
-RUN mkdir -p /tmp/pxf_src/ && cd /tmp \
-    && wget -O go.tgz -q https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \
-    && echo "${GO_SHA256SUM} /tmp/go.tgz" | sha256sum --check \
-    && rm -rf /usr/local/go && tar -C /usr/local -xzf go.tgz && rm go.tgz
+RUN GOPATH=/opt/go /usr/local/go/bin/go install github.com/onsi/ginkgo/ginkgo@v${GINKGO_VERSION}
 
 # add minio software
 RUN useradd -s /sbin/nologin -d /opt/minio minio \
@@ -22,8 +16,17 @@ RUN useradd -s /sbin/nologin -d /opt/minio minio \
     && chmod +x /opt/minio/bin/minio \
     && chown -R minio:minio /opt/minio
 
+ARG MAVEN_VERSION=3.6.3
+ARG USER_HOME_DIR="/root"
+ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
+
 # install dependencies that are missing on the base images
-RUN ln -s /usr/share/apache-maven-*/bin/mvn /usr/bin/mvn
+RUN curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
+    && mkdir -p /usr/share/maven \
+    && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
+    && rm -f /tmp/apache-maven.tar.gz \
+    && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
+    && /usr/bin/pip2 install paramiko --no-cache-dir
 
 # create rsa key for the root user
 RUN ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa \
@@ -58,11 +61,11 @@ RUN ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa \
     && echo >> ~gpadmin/.pxfrc 'export PGPORT=5432' \
     && echo >> ~gpadmin/.pxfrc 'export GOPATH=/opt/go' \
     && echo >> ~gpadmin/.pxfrc 'export GPHOME=$(find /usr/local/ -name greenplum-db* -type d | head -n1)' \
+    && echo >> ~gpadmin/.pxfrc 'export LD_LIBRARY_PATH=${GPHOME}/lib:${LD_LIBRARY_PATH-}' \
     && echo >> ~gpadmin/.pxfrc 'export GPHD_ROOT=/singlecluster' \
     && echo >> ~gpadmin/.pxfrc 'export PXF_HOME=/usr/local/pxf-gp7' \
     && echo >> ~gpadmin/.pxfrc 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk' \
-    && echo >> ~gpadmin/.pxfrc 'export PG_CONFIG=${GPHOME}/bin/pg_config' \
-    && echo >> ~gpadmin/.pxfrc 'export PATH=${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$PATH' \
+    && echo >> ~gpadmin/.pxfrc 'export PATH=${GPHOME}/bin:${PXF_HOME}/bin:${GOPATH}/bin:/usr/local/go/bin:$JAVA_HOME/bin:$PATH' \
     && ln -s ~gpadmin/.pxfrc ~root \
     && echo >> ~gpadmin/.bashrc 'source ~/.pxfrc' \
     && chown -R gpadmin:gpadmin ~gpadmin
diff --git a/concourse/pipelines/cloudbuild_pipeline.yml b/concourse/pipelines/cloudbuild_pipeline.yml
index d82a92bb..b8709082 100644
--- a/concourse/pipelines/cloudbuild_pipeline.yml
+++ b/concourse/pipelines/cloudbuild_pipeline.yml
@@ -92,16 +92,138 @@ jobs:
       - name: pxf_src
       run:
         path: pxf_src/concourse/scripts/check_docker_images_and_tag.bash
-  - task: trigger_builds
-    image: gcloud
-    params:
-      GOOGLE_CREDENTIALS: ((ud/pxf/secrets/pxf-cloudbuild-service-account-key))
-      GOOGLE_PROJECT_ID: ((ud/pxf/common/google-project-id))
-      GOOGLE_ZONE: ((ud/pxf/common/google-zone))
-      TRIGGER_LIST: "pxf-dev-server"
-    config:
-      platform: linux
-      inputs:
-      - name: pxf_src
-      run:
-        path: pxf_src/concourse/scripts/trigger_cloudbuild.bash
+
+## ======================================================================
+## RESOURCES
+## ======================================================================
+resources:
+  - name: gcloud
+    type: registry-image
+    icon: docker
+    source:
+      repository: google/cloud-sdk
+      tag: slim
+
+  - name: pxf-dev-base-cloudbuild-trigger
+    type: git
+    icon: git
+    source:
+      branch: ((pxf-git-branch))
+      uri: ((ud/pxf/common/git-remote))
+      paths:
+        - concourse/docker/pxf-dev-base
+
+  - name: dockerfile-gpdb-pxf-mapr
+    type: git
+    icon: git
+    source:
+      branch: ((pxf-git-branch))
+      uri: ((ud/pxf/common/git-remote))
+      paths:
+        - concourse/docker/mapr
+
+  - name: base-images-trigger
+    type: git
+    icon: git
+    source:
+      uri: ((ud/pxf/common/gp-image-baking-repo-uri))
+      branch: ((ud/pxf/common/gp-image-baking-repo-branch))
+      private_key: ((ud/pxf/secrets/gp-image-baking-repo-key))
+      paths:
+        - images/docker/gpdb5/gpdb5-centos7-build-test
+        - images/docker/gpdb6/gpdb6-centos7-test
+        - images/docker/gpdb6/gpdb6-ubuntu18.04-test
+        - images/docker/gpdb6/gpdb6-oel7-test
+        - images/docker/gpdb6/gpdb6-rhel8-test
+        - images/docker/gpdb7/gpdb7-centos7-test
+        - images/docker/gpdb7/gpdb7-rhel8-test
+
+## ======================================================================
+## JOBS
+## ======================================================================
+jobs:
+  - name: Check upstream base images
+    max_in_flight: 1
+    plan:
+    - in_parallel:
+      - get: gcloud
+      - get: pxf_src
+        resource: pxf-dev-base-cloudbuild-trigger
+      - get: base-images-trigger
+        trigger: true
+    - task: trigger_builds
+      image: gcloud
+      params:
+        GOOGLE_CREDENTIALS: ((ud/pxf/secrets/pxf-cloudbuild-service-account-key))
+        GOOGLE_PROJECT_ID: ((ud/pxf/common/google-project-id))
+        GOOGLE_ZONE: ((ud/pxf/common/google-zone))
+        TRIGGER_LIST: "pxf-dev-base rpmrebuild"
+      config:
+        platform: linux
+        inputs:
+          - name: pxf_src
+        run:
+          path: pxf_src/concourse/scripts/trigger_cloudbuild.bash
+
+  - name: Check pxf-dev-base images
+    max_in_flight: 1
+    plan:
+    - in_parallel:
+      - get: gcloud
+      - get: pxf_src
+        resource: pxf-dev-base-cloudbuild-trigger
+        trigger: true
+      - get: base-images-trigger
+        passed: [Check upstream base images]
+        trigger: true
+    - task: check_docker_images_and_tag
+      timeout: 30m
+      image: gcloud
+      params:
+        GOOGLE_CREDENTIALS: ((ud/pxf/secrets/pxf-cloudbuild-service-account-key))
+        GOOGLE_PROJECT_ID: ((ud/pxf/common/google-project-id))
+        GOOGLE_ZONE: ((ud/pxf/common/google-zone))
+        IMAGE_LIST: "gpdb5-centos7-test-pxf gpdb6-centos7-test-pxf gpdb6-rhel8-test-pxf gpdb6-ubuntu18.04-test-pxf gpdb6-oel7-test-pxf gpdb7-centos7-test-pxf gpdb7-rhel8-test-pxf gpdb7-ubuntu18.04-test-pxf"
+      config:
+        platform: linux
+        inputs:
+          - name: pxf_src
+        run:
+          path: pxf_src/concourse/scripts/check_docker_images_and_tag.bash
+    - task: trigger_builds
+      image: gcloud
+      params:
+        GOOGLE_CREDENTIALS: ((ud/pxf/secrets/pxf-cloudbuild-service-account-key))
+        GOOGLE_PROJECT_ID: ((ud/pxf/common/google-project-id))
+        GOOGLE_ZONE: ((ud/pxf/common/google-zone))
+        TRIGGER_LIST: "pxf-dev-server pxf-dev-mapr"
+      config:
+        platform: linux
+        inputs:
+          - name: pxf_src
+        run:
+          path: pxf_src/concourse/scripts/trigger_cloudbuild.bash
+
+  - name: Check pxf-dev-mapr images
+    max_in_flight: 1
+    plan:
+    - in_parallel:
+      - get: gcloud
+      - get: pxf_src
+        resource: dockerfile-gpdb-pxf-mapr
+        trigger: true
+    - do: *pxf_dev_mapr_image
+
+  - name: Check pxf-dev-mapr images 2
+    max_in_flight: 1
+    plan:
+    - in_parallel:
+      - get: gcloud
+      - get: pxf_src
+        resource: pxf-dev-base-cloudbuild-trigger
+        passed: [Check pxf-dev-base images]
+        trigger: true
+      - get: base-images-trigger
+        passed: [Check pxf-dev-base images]
+        trigger: true
+    - do: *pxf_dev_mapr_image


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 35/37: Relax the requirement that C string length matches Java string length (#870)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 42dddc466f9e10ba355ffbad90ffe70e14e31519
Author: Bradford D. Boyle <br...@vmware.com>
AuthorDate: Mon Sep 19 13:27:48 2022 -0700

    Relax the requirement that C string length matches Java string length (#870)
    
    Commit 94f8ccad added a check that the length of received strings (as
    determined by strnlen) matched the length of the string as determined by
    the Java-based PXF service; if they did not, this was treated as a fatal
    error. Some users have reported that they have ORC/Parquet files with
    strings that contain ASCCII NUL-bytes. These strings would not have a
    strnlen calculate length that matches with the Java string lenght.
    
    This commit removes the requirements that the lengths be equal and
    instead logs a debug message when they do not match.
    
    Authored-by: Bradford D. Boyle <br...@vmware.com>
---
 .../greenplum/pxf/automation/features/orc/OrcReadTest.java  |  6 ++++++
 .../main/pxf/features/orc/read/null_in_string/__init__.py   |  0
 .../features/orc/read/null_in_string/expected/query01.ans   | 13 +++++++++++++
 .../main/pxf/features/orc/read/null_in_string/runTest.py    | 11 +++++++++++
 .../pxf/features/orc/read/null_in_string/sql/query01.sql    |  3 +++
 5 files changed, 33 insertions(+)

diff --git a/automation/src/test/java/org/greenplum/pxf/automation/features/orc/OrcReadTest.java b/automation/src/test/java/org/greenplum/pxf/automation/features/orc/OrcReadTest.java
index ec6ef820..480d19db 100644
--- a/automation/src/test/java/org/greenplum/pxf/automation/features/orc/OrcReadTest.java
+++ b/automation/src/test/java/org/greenplum/pxf/automation/features/orc/OrcReadTest.java
@@ -175,6 +175,12 @@ public class OrcReadTest extends BaseFeature {
         runSqlTest("features/orc/read/null_in_string");
     }
 
+    @Test(groups = {"features", "gpdb", "security", "hcfs"})
+    public void orcReadStringsContainingNullByte() throws Exception {
+        prepareReadableExternalTable("pxf_orc_null_in_string", ORC_NULL_IN_STRING_COLUMNS, hdfsPath + ORC_NULL_IN_STRING);
+        runTincTest("pxf.features.orc.read.null_in_string.runTest");
+    }
+
     private void prepareReadableExternalTable(String name, String[] fields, String path) throws Exception {
         prepareReadableExternalTable(name, fields, path, false);
     }
diff --git a/automation/tincrepo/main/pxf/features/orc/read/null_in_string/__init__.py b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/automation/tincrepo/main/pxf/features/orc/read/null_in_string/expected/query01.ans b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/expected/query01.ans
new file mode 100644
index 00000000..bbfd641a
--- /dev/null
+++ b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/expected/query01.ans
@@ -0,0 +1,13 @@
+-- start_ignore
+-- end_ignore
+-- @description query01 for reading strings contain NUL-byte from ORC files
+SELECT * FROM pxf_orc_null_in_string ORDER BY id;
+ id |               context               |     value
+----+-------------------------------------+---------------
+  1 | simple string                       | hello
+  2 | simple string with space            | hello world
+  3 | simple string with double quote     | hello "world"
+  4 | NUL-byte in middle of string        | hello
+  5 | NUL-byte at the beginning of string |
+  6 | NUL-byte at the end of string       | hello world
+(6 rows)
\ No newline at end of file
diff --git a/automation/tincrepo/main/pxf/features/orc/read/null_in_string/runTest.py b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/runTest.py
new file mode 100644
index 00000000..916deefe
--- /dev/null
+++ b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/runTest.py
@@ -0,0 +1,11 @@
+from mpp.models import SQLConcurrencyTestCase
+
+class OrcNullInString(SQLConcurrencyTestCase):
+    """
+    @db_name pxfautomation
+    @concurrency 1
+    @gpdiff True
+    """
+    sql_dir = 'sql'
+    ans_dir = 'expected'
+    out_dir = 'output'
diff --git a/automation/tincrepo/main/pxf/features/orc/read/null_in_string/sql/query01.sql b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/sql/query01.sql
new file mode 100644
index 00000000..52e65cb3
--- /dev/null
+++ b/automation/tincrepo/main/pxf/features/orc/read/null_in_string/sql/query01.sql
@@ -0,0 +1,3 @@
+-- @description query01 for reading strings contain NUL-byte from ORC files
+
+SELECT * FROM pxf_orc_null_in_string ORDER BY id;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 11/37: updated ProjectionInfo related code for GP7 and code refactor

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 6fa21e7cd6196d13eb5ee8250b4e13c01f575454
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 22 10:42:40 2022 -0700

    updated ProjectionInfo related code for GP7 and code refactor
---
 external-table/src/pxfheaders.c | 245 ++++++++++++++++++++++++++++++----------
 1 file changed, 185 insertions(+), 60 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index d07a9595..a9bd3661 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -23,6 +23,7 @@
 #if PG_VERSION_NUM >= 120000
 #include "access/external.h"
 #include "extension/gp_exttable_fdw/extaccess.h"
+#include "executor/execExpr.h"
 #else
 #include "access/fileam.h"
 #include "catalog/pg_exttable.h"
@@ -39,7 +40,12 @@ static char *get_format_name(ExtTableEntry *exttbl);
 static char *getFormatterString(ExtTableEntry *exttbl);
 static bool isFormatterPxfDelimited(ExtTableEntry *exttbl);
 static bool isFormatterPxfWritable(ExtTableEntry *exttbl);
-static void add_projection_desc_httpheaders(CHURL_HEADERS headers, ProjectionInfo *projInfo, List *qualsAttributes, Relation rel);
+#if PG_VERSION_NUM >= 120000
+static void add_projection_desc_httpheader_pg12(CHURL_HEADERS headers, ProjectionInfo *projInfo, List *qualsAttributes, Relation rel);
+#else
+static void add_projection_desc_httpheader_pg94(CHURL_HEADERS headers, ProjectionInfo *projInfo, List *qualsAttributes, Relation rel);
+#endif
+
 static bool add_attnums_from_targetList(Node *node, List *attnums);
 static void add_projection_index_header(CHURL_HEADERS pVoid, StringInfoData data, int attno, char number[32]);
 static List *appendCopyEncodingOptionToList(List *copyFmtOpts, int encoding);
@@ -155,7 +161,11 @@ build_http_headers(PxfInputData *input)
 		if (qualsAreSupported &&
 			(qualsAttributes != NIL || list_length(input->quals) == 0))
 		{
-			add_projection_desc_httpheaders(headers, proj_info, qualsAttributes, rel);
+			#if PG_VERSION_NUM >= 120000
+				add_projection_desc_httpheader_pg12(headers, proj_info, qualsAttributes, rel);
+			#else
+				add_projection_desc_httpheader_pg94(headers, proj_info, qualsAttributes, rel);
+			#endif
 		}
 		else
 		{
@@ -272,7 +282,7 @@ add_tuple_desc_httpheader(CHURL_HEADERS headers, Relation rel)
 	for (i = 0, attrIx = 0; i < tuple->natts; ++i)
 	{
 		#if PG_VERSION_NUM >= 120000
-			Form_pg_attribute attribute = &tuple->attrs[i];
+			FormData_pg_attribute *attribute = &tuple->attrs[i];
 		#else
 			FormData_pg_attribute *attribute = tuple->attrs[i];
 		#endif
@@ -494,8 +504,10 @@ int getNumSimpleVars(ProjectionInfo *projInfo)
  * indices will be 0, 2. This is because we use 0-based indexing and because
  * col2 was dropped, the indices for col3 and col4 get shifted by -1.
  */
+
+#if PG_VERSION_NUM < 120000
 static void
-add_projection_desc_httpheaders(CHURL_HEADERS headers,
+add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
 							   ProjectionInfo *projInfo,
 							   List *qualsAttributes,
 							   Relation rel)
@@ -504,22 +516,11 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	int			   dropped_count;
 	int			   number;
 	int			   numTargetList;
-#if PG_VERSION_NUM < 90400 || PG_VERSION_NUM == 120000
-	int			   numSimpleVars = 0;
+#if PG_VERSION_NUM < 90400
+	int			   numSimpleVars;
 #endif
 	char			long_number[sizeof(int32) * 8];
-	/* FIXME: to get it to compile assign it to NULL */
-	// pi_varNumbers is not available anymore in the postgters code
-	// https://doxygen.postgresql.org/structProjectionInfo.html
-	//int				*varNumbers = projInfo->pi_varNumbers;
-#if PG_VERSION_NUM < 120000 // This will work for 6.x and lower versions of GPDB
-    int				*varNumbers = projInfo->pi_varNumbers;
-    List *targetList = projInfo->pi_targetlist;
-#else
-	int				*varNumbers = NULL; //TODO Need to find a proper value here
-	List *targetList = (List *)projInfo->pi_state.resultslot;
-#endif
-
+	int				*varNumbers = projInfo->pi_varNumbers;
 	Bitmapset		*attrs_used;
 	StringInfoData	formatter;
 	List		   *targetList;   // targetList from the query plan
@@ -528,18 +529,14 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	// STEP 0: initialize variables
 	initStringInfo(&formatter);
 	numTargetList = 0;
+
 #if PG_VERSION_NUM >= 90400
 	/*
 	 * Non-simpleVars are added to the targetlist
 	 * we use expression_tree_walker to access attrno information
 	 * we do it through a helper function add_attnums_from_targetList
 	 */
-	/* FIXME: commenting this out for compilation success */
-	// pi_targetlist is not available anymore in the postgters code
-	// https://doxygen.postgresql.org/structProjectionInfo.html
-	//if (projInfo->pi_targetlist)
-
-	if (targetList)
+	if (projInfo->pi_targetlist)
 	{
 #else
 	numSimpleVars = 0;
@@ -553,17 +550,10 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 		List     *l = lappend_int(NIL, 0);
 		ListCell *lc1;
 
-		/* FIXME: commenting this out to make it compile */
-
-		foreach(lc1, targetList)
+		foreach(lc1, projInfo->pi_targetlist)
 		{
-		#if PG_VERSION_NUM >= 120000
-		    ExprState *gstate = (ExprState *) lfirst(lc1);
-            add_attnums_from_targetList((Node *) gstate->expr, l);
-		#else
 			GenericExprState *gstate = (GenericExprState *) lfirst(lc1);
 			add_attnums_from_targetList((Node *) gstate->arg->expr, l);
-		#endif
 		}
 
 		foreach(lc1, l)
@@ -579,29 +569,19 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 
 		list_free(l);
 	}
-#if PG_VERSION_NUM < 90400 || PG_VERSION_NUM >= 120000
+#if PG_VERSION_NUM < 90400
 	else
 	{
-		#if PG_VERSION_NUM >= 120000
-			numSimpleVars = list_length(targetList);
-		#else
-			numSimpleVars = list_length(projInfo->pi_targetlist);
-		#endif
+		numSimpleVars = list_length(projInfo->pi_targetlist);
 	}
 #endif
 
 	number = numTargetList +
-
-
-    #if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
-            // FIXME: Commenting this out for compilation success
-            // pi_numSimpleVars is not available anymore in the postgters 12 code
-            // https://doxygen.postgresql.org/structProjectionInfo.html
-            projInfo->pi_numSimpleVars +
-    #else
-            numSimpleVars +
-    #endif
-
+#if PG_VERSION_NUM >= 90400
+		projInfo->pi_numSimpleVars +
+#else
+		numSimpleVars +
+#endif
 		list_length(qualsAttributes);
 	if (number == 0)
 		return;
@@ -612,13 +592,11 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	pg_ltoa(number, long_number);
 	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
-
-#if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
-        /* FIXME: commenting out to get compile to work */
-        //for (i = 0; i < projInfo->pi_numSimpleVars; i++)
-        for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+#if PG_VERSION_NUM >= 90400
+	for (i = 0; i < projInfo->pi_numSimpleVars; i++)
 #else
 	for (i = 0; varNumbers && i < numSimpleVars; i++)
+#endif
 	{
 		attrs_used =
 			bms_add_member(attrs_used,
@@ -642,13 +620,8 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 
 	for (i = 1; i <= tupdesc->natts; i++)
 	{
-        #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i-1];
-        #else
-            FormData_pg_attribute *attr = tupdesc->attrs[i-1];
-        #endif
 		/* Ignore dropped attributes. */
-		if (attr->attisdropped)
+		if (tupdesc->attrs[i - 1]->attisdropped)
 		{
 			/* keep a counter of the number of dropped attributes */
 			droppedCount++;
@@ -675,6 +648,158 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	pfree(formatter.data);
 	bms_free(attrs_used);
 }
+#endif
+
+/*
+ * Report projection description to the remote component, the indices of
+ * dropped columns do not get reported, as if they never existed, and
+ * column indices that follow dropped columns will be shifted by the number
+ * of dropped columns that precede it. For example,
+ *
+ *  ---------------------------------------------
+ * |  col1  |  col2 (dropped)  |  col3  |  col4  |
+ *  ---------------------------------------------
+ *
+ * Let's assume that col1 and col4 are projected, the reported projected
+ * indices will be 0, 2. This is because we use 0-based indexing and because
+ * col2 was dropped, the indices for col3 and col4 get shifted by -1.
+ */
+
+#if PG_VERSION_NUM >= 120000
+static void
+add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
+							   ProjectionInfo *projInfo,
+							   List *qualsAttributes,
+							   Relation rel)
+{
+	int			   i;
+	int			   dropped_count;
+	int			   number;
+	int			   numTargetList;
+	char			long_number[sizeof(int32) * 8];
+	//int				*varNumbers = projInfo->pi_varNumbers;
+	Bitmapset		*attrs_used;
+	StringInfoData	formatter;
+	TupleDesc		tupdesc;
+    ExprEvalStep step;
+	initStringInfo(&formatter);
+	numTargetList = 0;
+
+	 List *targetList = (List *) projInfo->pi_state.expr;
+     int  numSimpleVars = 0;
+
+#if PG_VERSION_NUM >= 90400
+
+	int numNonSimpleVars = 0;
+
+	 for (int i = 0; i < projInfo->pi_state.steps_len; i++)
+     {
+             step = projInfo->pi_state.steps[i];
+             if (step.opcode == EEOP_ASSIGN_INNER_VAR ||
+                     step.opcode == EEOP_ASSIGN_OUTER_VAR ||
+                     step.opcode == EEOP_ASSIGN_SCAN_VAR)
+                     numSimpleVars++;
+             else if (step.opcode == EEOP_ASSIGN_TMP_MAKE_RO ||
+                              step.opcode == EEOP_ASSIGN_TMP)
+                     numNonSimpleVars++;
+     }
+      int * varNumbers = &numNonSimpleVars;
+	/*
+	 * Non-simpleVars are added to the targetlist
+	 * we use expression_tree_walker to access attrno information
+	 * we do it through a helper function add_attnums_from_targetList
+	 */
+	if (targetList)
+	{
+#else
+
+	if (numNonSimpleVars > 0)
+	{
+		/*
+		 * When there are not just simple Vars we need to
+		 * walk the tree to get attnums
+		 */
+#endif
+		List     *l = lappend_int(NIL, 0);
+		ListCell *lc1;
+
+		foreach(lc1, targetList)
+		{
+			ExprState *gstate = (ExprState *) lfirst(lc1);
+            add_attnums_from_targetList( (Node *) gstate, l);
+		}
+
+		foreach(lc1, l)
+		{
+			int attno = lfirst_int(lc1);
+			if (attno > InvalidAttrNumber)
+			{
+				add_projection_index_header(headers,
+											formatter, attno - 1, long_number);
+				numTargetList++;
+			}
+		}
+
+		list_free(l);
+	}
+
+	number = numTargetList + numSimpleVars + list_length(qualsAttributes);
+	if (number == 0)
+		return;
+
+	attrs_used = NULL;
+
+	/* Convert the number of projection columns to a string */
+	pg_ltoa(number, long_number);
+	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
+
+    for (i = 0; varNumbers && i < numSimpleVars ; i++)
+	{
+		attrs_used =
+			bms_add_member(attrs_used,
+						 varNumbers[i] - FirstLowInvalidHeapAttributeNumber);
+	}
+
+	ListCell *attribute = NULL;
+
+	/*
+	 * AttrNumbers coming from quals
+	 */
+	foreach(attribute, qualsAttributes)
+	{
+		AttrNumber attrNumber = (AttrNumber) lfirst_int(attribute);
+		attrs_used =
+			bms_add_member(attrs_used,
+						 attrNumber + 1 - FirstLowInvalidHeapAttributeNumber);
+	}
+
+	tupdesc = RelationGetDescr(rel);
+	dropped_count = 0;
+
+	for (i = 1; i <= tupdesc->natts; i++)
+	{
+		/* Ignore dropped attributes. */
+		if (tupdesc->attrs[i - 1].attisdropped)
+		{
+			/* keep a counter of the number of dropped attributes */
+			dropped_count++;
+			continue;
+		}
+
+		if (bms_is_member(i - FirstLowInvalidHeapAttributeNumber, attrs_used))
+		{
+			/* Shift the column index by the running dropped_count */
+			add_projection_index_header(headers, formatter,
+										i - 1 - dropped_count, long_number);
+		}
+	}
+
+	list_free(qualsAttributes);
+	pfree(formatter.data);
+	bms_free(attrs_used);
+}
+#endif
+
 
 /*
  * Adds the projection index header for the given attno


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 28/37: removed jsoup dependency and unused class from the automation code (#863)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 1f5c4badf700fd033551026cebfe6ac31483e093
Author: Alexander Denissov <de...@users.noreply.github.com>
AuthorDate: Tue Sep 6 15:03:16 2022 -0700

    removed jsoup dependency and unused class from the automation code (#863)
---
 automation/pom.xml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/automation/pom.xml b/automation/pom.xml
index 38a05504..3e4c2ae7 100644
--- a/automation/pom.xml
+++ b/automation/pom.xml
@@ -231,12 +231,6 @@
             <version>1.10.11</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <version>4.2.0</version>
-        </dependency>
-
         <!-- AWS Dependencies -->
         <dependency>
             <groupId>com.amazonaws</groupId>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 23/37: Add basic community files

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 24a69b64d3f9185445aa88fe38be0b0d54369cba
Author: Dianjin Wang <wa...@gmail.com>
AuthorDate: Wed Nov 29 15:16:09 2023 +0800

    Add basic community files
---
 .github/ISSUE_TEMPLATE/bug-report.yml |  63 ++++++++++
 .github/ISSUE_TEMPLATE/config.yml     |  14 +++
 .github/pull_request_template.md      |  20 +++
 CODE-OF-CONDUCT.md                    | 149 ++++++++++++++--------
 CONTRIBUTING.md                       |  91 +++++++++-----
 NOTICE                                |  12 ++
 README.md                             | 226 +++++++++++++++++++---------------
 SECURITY.md                           | 189 ++++++++++------------------
 8 files changed, 457 insertions(+), 307 deletions(-)

diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
new file mode 100644
index 00000000..ea736c32
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -0,0 +1,63 @@
+name: "\U0001F41B Bug Report"
+description: Problems and issues with code in PXF for CloudberryDB.
+title: "[Bug] "
+labels: ["type: Bug"]
+body:
+  - type: markdown
+    attributes:
+      value: "Thank you for reporting the problem! We really appreciate your efforts to improve Cloudberry Database. Before reporting it, please (ideally) test on the latest release or main to see if the issue is fixed."
+  - type: textarea
+    attributes:
+      label: Cloudberry Database and PXF version
+      description: What version are you using? 
+  - type: textarea
+    attributes:
+      label: What happened
+      description: Describe what happened.
+      placeholder: >
+        Please provide the context in which the problem occurred and explain what happened
+    validations:
+      required: true
+  - type: textarea
+    attributes:
+      label: What you think should happen instead
+      description: What do you think went wrong?
+      placeholder: >
+        Please explain why you think the behavior is erroneous. It is extremely helpful if you copy&paste the fragment of logs showing the exact error messages or wrong behavior. If you can provide some screenshots or videos, you can include files by dragging and dropping them here.
+  - type: textarea
+    attributes:
+      label: How to reproduce
+      description: >
+        What should we do to reproduce the problem? Any SQL commands or operations? 
+      placeholder: >
+        Please make sure you provide a reproducible step-by-step case of how to reproduce the problem as minimally and precisely as possible. Remember that non-reproducible issues will be closed! Opening a discussion is recommended as a first step.
+  - type: input
+    attributes:
+      label: Operating System
+      description: What Operating System are you using?
+      placeholder: "You can get it via `cat /etc/os-release` for example"
+  - type: textarea
+    attributes:
+      label: Anything else
+      description: Anything else we need to know?
+      placeholder: >
+        How often does this problem occur? (Once? Every time? Only when certain conditions are met?) Any relevant logs to include? Put them here.
+  - type: checkboxes
+    attributes:
+      label: Are you willing to submit PR?
+      description: >
+        This is absolutely not required, but we are happy to guide you in the contribution process, especially if you already understand how to implement the fix.
+      options:
+        - label: Yes, I am willing to submit a PR!
+  - type: checkboxes
+    attributes:
+      label: Code of Conduct
+      description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
+      options:
+        - label: >
+            I agree to follow this project's
+            [Code of Conduct](https://cloudberrydb.org/community/coc).
+          required: true
+  - type: markdown
+    attributes:
+      value: "Thanks for completing our form!"
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..a3a57eb1
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,14 @@
+blank_issues_enabled: false
+contact_links:
+  - name: 🙏🏻 Q&A
+    url: https://github.com/orgs/cloudberrydb/discussions/categories/q-a
+    about: Ask for help when running/developing Cloudberry Database.
+  - name: 💡️ New Ideas / Feature Requests
+    url: https://github.com/orgs/cloudberrydb/discussions/categories/ideas-feature-requests
+    about: Share ideas for new features.
+  - name: 🎙️ Submit Your Proposal
+    url: https://github.com/orgs/cloudberrydb/discussions/categories/proposal
+    about: As a developer, proposing any major change or enhancement to Cloudberry Database.
+  - name: 💬️ Join Slack for Real-time Chat
+    url: https://communityinviter.com/apps/cloudberrydb/welcome
+    about: Real-time chat including QA, Dev, Events and more.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..0dfb7e84
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,20 @@
+<!--Thank you for contributing! -->
+<!--In case of an existing issue or discussions, please reference it-->
+fix #ISSUE_Number
+<!--Remove this section if no corresponding issue.-->
+
+---
+
+## Change logs
+
+> Describe your change clearly, including what problem is being solved or what document is being added or updated.
+
+## Contributor's checklist
+
+Here are some reminders before you submit your pull request:
+
+* Make sure that your Pull Request has a clear title and commit message. You can take the [Git commit template](https://github.com/cloudberrydb/cloudberrydb/blob/main/.gitmessage) as a reference.
+* Sign the Contributor License Agreement as prompted for your first-time contribution (*One-time setup*).
+* Learn the [code contribution](https://cloudberrydb.org/contribute/code) and [doc contribution](https://cloudberrydb.org/contribute/doc) guides for better collaboration.
+* List your communications in the [GitHub Issues](https://github.com/cloudberrydb/cloudberrydb-site/issues) or [Discussions](https://github.com/orgs/cloudberrydb/discussions) (if has or needed).
+* Feel free to ask for the cloudberrydb team to help review and approve.
diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md
index 3352843c..922d7f50 100644
--- a/CODE-OF-CONDUCT.md
+++ b/CODE-OF-CONDUCT.md
@@ -2,79 +2,130 @@
 
 ## Our Pledge
 
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to make participation in the Greenplum
-Platform Extension Framework project and our community a harassment-free
-experience for everyone, regardless of age, body size, disability, ethnicity,
-sex characteristics, gender identity and expression, level of experience,
-education, socio-economic status, nationality, personal appearance, race,
-religion, or sexual identity and orientation.
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
 
 ## Our Standards
 
-Examples of behavior that contributes to creating a positive environment
-include:
+Examples of behavior that contributes to a positive environment for our
+community include:
 
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+  and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall
+  community
 
-Examples of unacceptable behavior by participants include:
+Examples of unacceptable behavior include:
 
-* The use of sexualized language or imagery and unwelcome sexual attention or
-  advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
+* The use of sexualized language or imagery, and sexual attention or advances of
+  any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
 * Public or private harassment
-* Publishing others' private information, such as a physical or electronic
-  address, without explicit permission
+* Publishing others' private information, such as a physical or email address,
+  without their explicit permission
 * Other conduct which could reasonably be considered inappropriate in a
   professional setting
 
-## Our Responsibilities
+## Enforcement Responsibilities
 
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
 
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
 
 ## Scope
 
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an
-appointed representative at an online or offline event. Representation of a
-project may be further defined and clarified by project maintainers.
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
 
 ## Enforcement
 
 Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at oss-coc@vmware.com. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an
-incident. Further details of specific enforcement policies may be posted
-separately.
+reported to the community leaders responsible for enforcement at info@cloudberrydb.org.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of
+actions.
 
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the
+community.
 
 ## Attribution
 
 This Code of Conduct is adapted from the [Contributor Covenant][homepage],
-version 1.4, available at
-https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
 
-[homepage]: https://www.contributor-covenant.org
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
 
-For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
 
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3c406b6f..518942f4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,49 +1,78 @@
-# Contributing
+Cloudberry Database community welcomes contributions from anyone, new and
+experienced! We appreciate your interest in contributing. This guide will help
+you get started with the contribution.
 
-We warmly welcome and appreciate contributions from the community!
-By participating you agree to the [code of conduct](https://github.com/greenplum-db/pxf/blob/main/CODE-OF-CONDUCT.md).
-To contribute:
+## Code of Conduct
 
-- Sign our [Contributor License Agreement](https://cla.vmware.com/cla/1/preview).
+Everyone who participates in Cloudberry Database, either as a user or a
+contributor, is obliged to follow our community [Code of
+Conduct](./CODE_OF_CONDUCT.md). Every violation against it will be reviewed
+and investigated and will result in a response that is deemed necessary and
+appropriate to the circumstances. The moderator team is obligated to maintain
+confidentiality regarding the reporter of an incident.
 
-- Fork the PXF repository on GitHub.
+Some behaviors that contribute to creating a positive environment include:
 
-- Clone the repository.
+* Use welcoming and inclusive language.
+* Respect differing viewpoints and experiences.
+* Accept constructive criticism gracefully.
+* Foster what's best for the community.
+* Show empathy for community members.
 
-- Follow the README.md to set up your environment and run the tests.
+## GitHub Contribution Workflow
 
-- Create a change
+1. Fork this repo to your own GitHub account.
+2. Clone down the repo to your local system.
 
-    - Create a topic branch.
+```
+git clone https://github.com/your-user-name/pxf.git
+```
 
-    - Make commits as logical units for ease of reviewing.
+3. Add the upstream repo. (You only have to do this once, not every time.)
 
-    - Follow similar coding styles as found throughout the code base.
+```
+git remote add upstream https://github.com/cloudberrydb/pxf.git
+```
 
-    - Rebase with main often to stay in sync with upstream.
+4. Create a new branch to hold your work.
 
-    - Add appropriate unit and automation tests.
+```
+git checkout -b new-branch-name
+```
 
-    - Ensure a well written commit message as explained [here](https://chris.beams.io/posts/git-commit/) and [here](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
+5. Work on your new code.
 
-- Submit a pull request (PR).
+6. Commit your changes.
 
-    - Create a [pull request from your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/.creating-a-pull-request-from-a-fork).
+```
+git add <the change files>
+git commit
+```
 
-    - Address PR feedback with fixup and/or squash commits.
-        ```
-        git add .
-        git commit --fixup <commit SHA> 
-            Or
-        git commit --squash <commit SHA>
-        ```    
+7. Push your changes to your GitHub repo.
 
-    - Once the PR is approved, project committers will merge it to main
-      branch according to the product release schedule. They might further
-      squash the commits in the PR if they deem necessary.
+```
+git push origin new-branch-name
+```
 
-# Community
+8. Open a PR(Pull Request).
 
-Connect with PXF and Greenplum on:
-- [Slack](https://greenplum.slack.com/)
-- [Dev Google Group mailing list](https://groups.google.com/a/greenplum.org/forum/#!forum/gpdb-dev/join)
+Go to the repo on GitHub. There will be a message about your recently pushed
+branch, asking if you would like to open a pull request. Follow the prompts,
+compare across repositories, and submit the PR.
+
+9. Get your code reviewed.
+10. Congratulations! Once your PR is approved, and passes the CI/CD without
+errors, then the code will be merged. Your code will be shipped in the recent
+future releases.
+
+## Sync your branch with the upstream
+
+Before working on your next contribution, make sure your local repository is
+up to date:
+
+```
+git checkout main
+git fetch upstream
+git rebase upstream/main
+```
diff --git a/NOTICE b/NOTICE
index e26d62b0..816927f0 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,3 +1,15 @@
+Platform Extension Framework for Cloudberry Database
+Copyright 2023 HashData Technology Limited. or its affiliates. All Rights Reserved.
+
+This product is licensed to you under the Apache 2.0 license (the "License").
+You may not use this product except in compliance with the Apache 2.0 License.
+
+This product may include a number of subcomponents with separate copyright 
+notices and license terms. Your use of these subcomponents is subject to the 
+terms and conditions of the subcomponent's license, as noted in the LICENSE file.
+
+=================================================================
+
 Greenplum Platform Extension Framework
 Copyright 2018-Present VMware, Inc. or its affiliates. All Rights Reserved.
 
diff --git a/README.md b/README.md
index 82f1510c..6e863f00 100755
--- a/README.md
+++ b/README.md
@@ -1,73 +1,64 @@
-**PXF Build** [![Concourse Build Status](http://ci.ud.gpdb.pivotal.io/api/v1/teams/main/pipelines/pxf-build/badge)](https://ci.ud.gpdb.pivotal.io/teams/main/pipelines/pxf-build) |
-**PXF Certification** [![Concourse Build Status](http://ci.ud.gpdb.pivotal.io/api/v1/teams/main/pipelines/pxf-certification/badge)](https://ci.ud.gpdb.pivotal.io/teams/main/pipelines/pxf-certification)
+# Platform Extension Framework (PXF) for Cloudberry Database
 
-----------------------------------------------------------------------
+[![Slack](https://img.shields.io/badge/Join_Slack-6a32c9)](https://communityinviter.com/apps/cloudberrydb/welcome)
+[![Twitter Follow](https://img.shields.io/twitter/follow/cloudberrydb)](https://twitter.com/cloudberrydb)
+[![Website](https://img.shields.io/badge/Visit%20Website-eebc46)](https://cloudberrydb.org)
+[![GitHub Discussions](https://img.shields.io/github/discussions/cloudberrydb/cloudberrydb)](https://github.com/orgs/cloudberrydb/discussions)
 
-Introduction
-============
+---
 
-PXF is an extensible framework that allows a distributed database like Greenplum to query external data files, whose metadata is not managed by the database.
+## Introduction
+
+PXF is an extensible framework that allows a distributed database like Greenplum and Cloudberry Database to query external data files, whose metadata is not managed by the database.
 PXF includes built-in connectors for accessing data that exists inside HDFS files, Hive tables, HBase tables, JDBC-accessible databases and more.
 Users can also create their own connectors to other data storage or processing engines.
 
-Repository Contents
-================
-## external-table/
-Contains the Greenplum extension implementing an External Table protocol handler
-
-## fdw/
-Contains the Greenplum extension implementing a Foreign Data Wrapper (FDW) for PXF
-
-## server/
-Contains the server side code of PXF along with the PXF Service and all the Plugins
-
-## cli/
-Contains command line interface code for PXF
-
-## automation/
-Contains the automation and integration tests for PXF against the various datasources
-
-## singlecluster/
-Hadoop testing environment to exercise the pxf automation tests
-
-## concourse/
-Resources for PXF's Continuous Integration pipelines
-
-## regression/
-Contains the end-to-end (integration) tests for PXF against the various datasources, utilizing the PostgreSQL testing framework `pg_regress`
-
-## downloads/
-An empty directory that serves as a staging location for Greenplum RPMs for the development Docker image
-
-PXF Development
-=================
-Below are the steps to build and install PXF along with its dependencies including Greenplum and Hadoop.
-
-To start, ensure you have a `~/workspace` directory and have cloned the `pxf` and its prerequisites (shown below) under it.
+## Repository Contents
+
+* `external-table/`  
+    Contains the CloudberryDB extension implementing an External Table protocol handler
+* `fdw/`    
+    Contains the CloudberryDB extension implementing a Foreign Data Wrapper (FDW) for PXF
+* `server/`  
+    Contains the server side code of PXF along with the PXF Service and all the Plugins
+* `cli/`    
+    Contains command line interface code for PXF
+* `automation/`  
+    Contains the automation and integration tests for PXF against the various datasources
+* `singlecluster/`  
+    Hadoop testing environment to exercise the pxf automation tests
+* `regression/`  
+    Contains the end-to-end (integration) tests for PXF against the various datasources, utilizing the PostgreSQL testing framework `pg_regress`
+* `downloads/`  
+    An empty directory that serves as a staging location for CloudberryDB RPMs for the development Docker image
+
+## PXF Development
+
+Below are the steps to build and install PXF along with its dependencies including CloudberryDB and Hadoop.
+
+> [!Note]
+> To start, ensure you have a `~/workspace` directory and have cloned the `pxf` and its prerequisites (shown below) under it.
 (The name `workspace` is not strictly required but will be used throughout this guide.)
+
 ```bash
 mkdir -p ~/workspace
 cd ~/workspace
 
-git clone https://github.com/greenplum-db/pxf.git
-```
-Alternatively, you may create a symlink to your existing repo folder.
-```bash
-ln -s ~/<git_repos_root> ~/workspace
+git clone https://github.com/cloudberrydb/pxf.git
 ```
 
-## Install Dependencies
+### Install Dependencies
 
 To build PXF, you must have:
 
 1. GCC compiler, `make` system, `unzip` package, `maven` for running integration tests
-2. Installed Greenplum DB
+2. Installed Cloudberry Database
 
-    Either download and install Greenplum RPM or build Greenplum from the source by following instructions in the [GPDB README](https://github.com/greenplum-db/gpdb).
+    Either download and install CloudberryDB RPM or build CloudberryDB from the source by following instructions in the [CloudberryDB](https://github.com/cloudberrydb/cloudberrydb).
 
-    Assuming you have installed Greenplum into `/usr/local/greenplum-db` directory, run its environment script:
+    Assuming you have installed CloudberryDB into `/usr/local/cloudberry-db` directory, run its environment script:
     ```
-    source /usr/local/greenplum-db/greenplum_path.sh
+    source /usr/local/cloudberry-db/greenplum_path.sh
     ```
 
 3. JDK 1.8 or JDK 11 to compile/run
@@ -98,8 +89,10 @@ To build PXF, you must have:
 
     Note that CentOS 6 provides an older, unsupported version of cURL (7.19). You should install a newer version from source if you are on CentOS 6.
 
-## How to Build PXF
+### How to Build PXF
+
 PXF uses Makefiles to build its components. PXF server component uses Gradle that is wrapped into the Makefile for convenience.
+
 ```bash
 cd ~/workspace/pxf
 
@@ -110,12 +103,12 @@ make
 make test
 ```
 
-## How to Install PXF
+### How to Install PXF
 
-To install PXF, first make sure that the user has sufficient permissions in the `$GPHOME` and `$PXF_HOME` directories to perform the installation. It's recommended to change ownership to match the installing user. For example, when installing PXF as user `gpadmin` under `/usr/local/greenplum-db`:
+To install PXF, first make sure that the user has sufficient permissions in the `$GPHOME` and `$PXF_HOME` directories to perform the installation. It's recommended to change ownership to match the installing user. For example, when installing PXF as user `gpadmin` under `/usr/local/cloudberry-db`:
 
 ```bash
-export GPHOME=/usr/local/greenplum-db
+export GPHOME=/usr/local/cloudberry-db
 export PXF_HOME=/usr/local/pxf
 export PXF_BASE=${HOME}/pxf-base
 chown -R gpadmin:gpadmin "${GPHOME}" "${PXF_HOME}"
@@ -124,22 +117,26 @@ make -C ~/workspace/pxf install
 
 NOTE: if `PXF_BASE` is not set, it will default to `PXF_HOME`, and server configurations, libraries or other configurations, might get deleted after a PXF re-install.
 
-## How to Run PXF
+### How to Run PXF
 
 Ensure that PXF is in your path. This command can be added to your .bashrc
+
 ```bash
 export PATH=/usr/local/pxf/bin:$PATH
 ```
 
 Then you can prepare and start up PXF by doing the following.
+
 ```bash
 pxf prepare
 pxf start
 ```
+
 If `${HOME}/pxf-base` does not exist, `pxf prepare` will create the directory for you. This command should only need to be run once.
 
-## Re-installing PXF after making changes
-Note: Local development with PXF requires a running Greenplum cluster.
+### Re-installing PXF after making changes
+
+Note: Local development with PXF requires a running CloudberryDB cluster.
 
 Once the desired changes have been made, there are 2 options to re-install PXF:
 
@@ -151,7 +148,7 @@ After PXF has been re-installed, you can restart the PXF instance using:
 pxf restart
 ```
 
-## How to demonstrate Hadoop Integration
+### How to demonstrate Hadoop Integration
 In order to demonstrate end to end functionality you will need Hadoop installed. We have all the related hadoop components (hdfs, hive, hbase, zookeeper, etc) mapped into simple artifact named singlecluster.
 You can [download from here](https://storage.googleapis.com/pxf-public/singlecluster-HDP.tar.gz) and untar the `singlecluster-HDP.tar.gz` file, which contains everything needed to run Hadoop.
 
@@ -161,7 +158,7 @@ cd ~/workspace
 tar xzf singlecluster-HDP.tar.gz
 ```
 
-Create a symlink using `ln -s ~/workspace/singlecluster-HDP ~/workspace/singlecluster` and then follow the steps in [Setup Hadoop](#Setup-Hadoop).
+Create a symlink using `ln -s ~/workspace/singlecluster-HDP ~/workspace/singlecluster` and then follow the steps in [Setup Hadoop](####Setup-Hadoop).
 
 While PXF can run on either Java 8 or Java 11, please ensure that you are running Java 8 for hdfs, hadoop, etc. Please set your java version by seting your `JAVA_HOME` to the appropriate location.
 
@@ -175,41 +172,17 @@ Initialize the default server configurations:
 cp ${PXF_HOME}/templates/*-site.xml ${PXF_BASE}/servers/default
 ```
 
-# Development With Docker
-NOTE: Since the docker container will house all Single cluster Hadoop, Greenplum and PXF, we recommend that you have at least 4 cpus and 6GB memory allocated to Docker. These settings are available under docker preferences.
+### Development With Docker
 
-<!-- TODO: Understand why this only works for 6.6 RPM and not latest GPDB6 -->
-The quick and easy is to download the GPDB 6.6 RPM from Github and move it into the `/downloads` folder. Then run `./dev/start.bash` to get a docker image with a running GPDB6, Hadoop cluster and an installed PXF.
+> [!Note]
+> Since the docker container will house all Single cluster Hadoop, CloudberryDB and PXF, we recommend that you have at least 4 cpus and 6GB memory allocated to Docker. These settings are available under docker preferences.
 
-If you would like more control over the GPDB installation, you can use the steps below.
+The quick and easy is to download the CloudberryDB RPM from GitHub and move it into the `/downloads` folder. Then run `./dev/start.bash` to get a docker image with a running CloudberryDB, Hadoop cluster and an installed PXF.
 
-```bash
-# Get the latest centos7 image for GPDB6
-docker pull gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-centos7-test-pxf:latest
-
-# If you want to use gdb to debug gpdb you need the --privileged flag in the command below
-docker run --rm -it \
-  -p 5432:5432 \
-  -p 5888:5888 \
-  -p 8000:8000 \
-  -p 5005:5005 \
-  -p 8020:8020 \
-  -p 9000:9000 \
-  -p 9090:9090 \
-  -p 50070:50070 \
-  -w /home/gpadmin/workspace \
-  -v ~/workspace/gpdb:/home/gpadmin/workspace/gpdb \
-  -v ~/workspace/pxf:/home/gpadmin/workspace/pxf \
-  -v ~/workspace/singlecluster-HDP:/home/gpadmin/workspace/singlecluster \
-  gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-centos7-test-pxf:latest /bin/bash -c \
-  "/home/gpadmin/workspace/pxf/dev/set_up_gpadmin_user.bash && /usr/sbin/sshd && su - gpadmin"
-```
-
-### Setup GPDB in the Docker image
+#### Setup GPDB in the Docker image
 
 Configure, build and install GPDB. This will be needed only when you use the container for the first time with GPDB source.
 
-<!-- TODO: This may be because we no longer use greenplum-db-devel?-->
 ```bash
 ~/workspace/pxf/dev/build_gpdb.bash
 sudo mkdir /usr/local/greenplum-db-devel
@@ -217,7 +190,7 @@ sudo chown gpadmin:gpadmin /usr/local/greenplum-db-devel
 ~/workspace/pxf/dev/install_gpdb.bash
 ```
 
-For subsequent minor changes to GPDB source you can simply do the following:
+For subsequent minor changes to CloudberryDB source you can simply do the following:
 ```bash
 ~/workspace/pxf/dev/install_gpdb.bash
 ```
@@ -227,17 +200,18 @@ Run all the instructions below and run GROUP=smoke (in one script):
 ~/workspace/pxf/dev/smoke_shortcut.sh
 ```
 
-Create Greenplum Cluster
+Create CloudberryDB Cluster
 ```bash
-source /usr/local/greenplum-db-devel/greenplum_path.sh
-make -C ~/workspace/gpdb create-demo-cluster
-source ~/workspace/gpdb/gpAux/gpdemo/gpdemo-env.sh
+source /usr/local/cloudberrydb-db-devel/greenplum_path.sh
+make -C ~/workspace/cbdb create-demo-cluster
+source ~/workspace/cbdb/gpAux/gpdemo/gpdemo-env.sh
 ```
 
-### Setup Hadoop
+#### Setup Hadoop
 Hdfs will be needed to demonstrate functionality. You can choose to start additional hadoop components (hive/hbase) if you need them.
 
 Setup [User Impersonation](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Superusers.html) prior to starting the hadoop components (this allows the `gpadmin` user to access hadoop data).
+
 ```bash
 ~/workspace/pxf/dev/configure_singlecluster.bash
 ```
@@ -251,6 +225,7 @@ popd
 ```
 
 Start other optional components based on your need
+
 ```bash
 pushd ~/workspace/singlecluster/bin
 # Start Hive
@@ -263,7 +238,7 @@ pushd ~/workspace/singlecluster/bin
 popd
 ```
 
-### Setup Minio (optional)
+#### Setup Minio (optional)
 Minio is an S3-API compatible local storage solution. The development docker image comes with Minio software pre-installed. To start the Minio server, run the following script:
 ```bash
 source ~/workspace/pxf/dev/start_minio.bash
@@ -272,7 +247,7 @@ After the server starts, you can access Minio UI at `http://localhost:9000` from
 
 The script also sets `PROTOCOL=minio` so that the automation framework will use the local Minio server when running S3 automation tests. If later you would like to run Hadoop HDFS tests, unset this variable with `unset PROTOCOL` command.
 
-### Setup PXF
+#### Setup PXF
 
 Install PXF Server
 ```bash
@@ -289,7 +264,7 @@ Install PXF client (ignore if this is already done)
 psql -d template1 -c "create extension pxf"
 ```
 
-### Run PXF Tests
+#### Run PXF Tests
 All tests use a database named `pxfautomation`.
 ```bash
 pushd ~/workspace/pxf/automation
@@ -316,7 +291,7 @@ cp ${PXF_HOME}/lib/pxf-hbase-*.jar ~/workspace/singlecluster/hbase/lib/pxf-hbase
 ~/workspace/singlecluster/bin/start-hbase.sh
 ```
 
-### Make Changes to PXF
+#### Make Changes to PXF
 
 To deploy your changes to PXF in the development environment.
 
@@ -331,7 +306,7 @@ yes | $PXF_HOME/bin/pxf init
 $PXF_HOME/bin/pxf start
 ```
 
-# IDE Setup (IntelliJ)
+## IDE Setup (IntelliJ)
 
 - Start IntelliJ. Click "Open" and select the directory to which you cloned the `pxf` repo.
 - Select `File > Project Structure`.
@@ -344,7 +319,7 @@ no JDK set for Gradle. Just cancel and retry. It goes away the second time.
 - Optionally you can replace `${PXF_TMP_DIR}` with `${GPHOME}/pxf/tmp` in `automation/pom.xml`
 - Select `Tools > Create Command-line Launcher...` to enable starting Intellij with the `idea` command, e.g. `cd ~/workspace/pxf && idea .`.
 
-## Debugging the locally running instance of PXF server using IntelliJ
+### Debugging the locally running instance of PXF server using IntelliJ
 
 - In IntelliJ, click `Edit Configuration` and add a new one of type `Remote`
 - Change the name to `PXF Service Boot`
@@ -354,6 +329,53 @@ no JDK set for Gradle. Just cancel and retry. It goes away the second time.
 - Debug the new configuration in IntelliJ
 - Run a query in GPDB that uses PXF to debug with IntelliJ
 
-# To run a Kerberized Hadoop Cluster
+## To run a Kerberized Hadoop Cluster
+
+### Requirements
+
+- Download bin_gpdb (from any of the pipelines)
+- Download pxf_tarball (from any of the pipelines)
+
+These instructions allow you to run a Kerberized cluster
+
+```bash
+docker run --rm -it \
+  --privileged \
+  --hostname c6401.ambari.apache.org \
+  -p 5432:5432 \
+  -p 5888:5888 \
+  -p 8000:8000 \
+  -p 8080:8080 \
+  -p 8020:8020 \
+  -p 9000:9000 \
+  -p 9090:9090 \
+  -p 50070:50070 \
+  -w /home/gpadmin/workspace \
+  -v ~/workspace/cbdb:/home/gpadmin/workspace/gpdb_src \
+  -v ~/workspace/pxf:/home/gpadmin/workspace/pxf_src \
+  -v ~/workspace/singlecluster-HDP:/home/gpadmin/workspace/singlecluster \
+  -v ~/Downloads/bin_cbdb:/home/gpadmin/workspace/bin_cbdb \
+  -v ~/Downloads/pxf_tarball:/home/gpadmin/workspace/pxf_tarball \
+  -e CLUSTER_NAME=hdp \
+  -e NODE=c6401.ambari.apache.org \
+  -e REALM=AMBARI.APACHE.ORG \
+  gcr.io/$PROJECT_ID/gpdb-pxf-dev/gpdb6-centos7-test-pxf-hdp2 /bin/bash
+
+# Inside the container run the following command:
+pxf_src/concourse/scripts/test_pxf_secure.bash
+
+echo "+----------------------------------------------+"
+echo "| Kerberos admin principal: admin/admin@$REALM |"
+echo "| Kerberos admin password : admin              |"
+echo "+----------------------------------------------+"
+
+su - gpadmin
+```
+
+## Contribute
+
+See the [CONTRIBUTING](./CONTRIBUTING.md) file for how to make contributions dedicated to the PXF for Cloudberry Database.
+
+## License
 
-- See instructions in the dev folder for spinning up a kerberized Dataproc cluster in GCP.
\ No newline at end of file
+Under Apache License V2.0, See the [LICENSE](./LICENSE) for details.
diff --git a/SECURITY.md b/SECURITY.md
index fabbb9d2..36b48877 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,125 +1,64 @@
-# Security Release Process
-
-Greenplum Database has adopted this security disclosure and response policy to
-ensure we responsibly handle critical issues.
-
-## Reporting a Vulnerability - Private Disclosure Process
-
-Security is of the highest importance and all security vulnerabilities or
-suspected security vulnerabilities should be reported to Greenplum Database
-privately, to minimize attacks against current users of Greenplum Database
-before they are fixed. Vulnerabilities will be investigated and patched on the
-next patch (or minor) release as soon as possible. This information could be
-kept entirely internal to the project.
-
-If you know of a publicly disclosed security vulnerability for Greenplum
-Database, please **IMMEDIATELY** contact the Greenplum Database project team
-(security@greenplum.org).
-
-**IMPORTANT: Do not file public issues on GitHub for security vulnerabilities!**
-
-To report a vulnerability or a security-related issue, please contact the email
-address with the details of the vulnerability. The email will be fielded by the
-Greenplum Database project team. Emails will be addressed promptly, including a
-detailed plan to investigate the issue and any potential workarounds to perform
-in the meantime. Do not report non-security-impacting bugs through this
-channel. Use [GitHub issues](https://github.com/greenplum-db/gpdb/issues)
-instead.
-
-## Proposed Email Content
-
-Provide a descriptive subject line and in the body of the email include the
-following information:
-
-* Basic identity information, such as your name and your affiliation or company.
-* Detailed steps to reproduce the vulnerability  (POC scripts, screenshots, and
-  logs are all helpful to us).
-* Description of the effects of the vulnerability on Greenplum Database and the
-  related hardware and software configurations, so that the Greenplum Database
-  project team can reproduce it.
-* How the vulnerability affects Greenplum Database usage and an estimation of
-  the attack surface, if there is one.
-* List other projects or dependencies that were used in conjunction with
-  Greenplum Database to produce the vulnerability.
-
-## When to report a vulnerability
-
-* When you think Greenplum Database has a potential security vulnerability.
-* When you suspect a potential vulnerability but you are unsure that it impacts
-  Greenplum Database.
-* When you know of or suspect a potential vulnerability on another project that
-  is used by Greenplum Database.
-
-## Patch, Release, and Disclosure
-
-The Greenplum Database project team will respond to vulnerability reports as
-follows:
-
-1. The Greenplum project team will investigate the vulnerability and determine
-its effects and criticality.
-2. If the issue is not deemed to be a vulnerability, the Greenplum project team
-will follow up with a detailed reason for rejection.
-3. The Greenplum project team will initiate a conversation with the reporter
-promptly.
-4. If a vulnerability is acknowledged and the timeline for a fix is determined,
-the Greenplum project team will work on a plan to communicate with the
-appropriate community, including identifying mitigating steps that affected
-users can take to protect themselves until the fix is rolled out.
-5. The Greenplum project team will also create a
-[CVSS](https://www.first.org/cvss/specification-document) using the [CVSS
-Calculator](https://www.first.org/cvss/calculator/3.0). The Greenplum project
-team makes the final call on the calculated CVSS; it is better to move quickly
-than making the CVSS perfect. Issues may also be reported to
-[Mitre](https://cve.mitre.org/) using this [scoring
-calculator](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator). The CVE will
-initially be set to private.
-6. The Greenplum project team will work on fixing the vulnerability and perform
-internal testing before preparing to roll out the fix.
-7. A public disclosure date is negotiated by the Greenplum Database project
-team, and the bug submitter. We prefer to fully disclose the bug as soon as
-possible once a user mitigation or patch is available. It is reasonable to
-delay disclosure when the bug or the fix is not yet fully understood, or the
-solution is not well-tested. The timeframe for disclosure is from immediate
-(especially if it’s already publicly known) to a few weeks. The Greenplum
-Database project team holds the final say when setting a public disclosure
-date.
-8. Once the fix is confirmed, the Greenplum project team will patch the
-vulnerability in the next patch or minor release, and backport a patch release
-into earlier supported releases as necessary. Upon release of the patched
-version of Greenplum Database, we will follow the **Public Disclosure
-Process**.
-
-## Public Disclosure Process
-
-The Greenplum project team publishes a [public
-advisory](https://github.com/greenplum-db/gpdb/security/advisories?state=published)
-to the Greenplum Database community via GitHub. In most cases, additional
-communication via Slack, Twitter, mailing lists, blog and other channels will
-assist in educating Greenplum Database users and rolling out the patched
-release to affected users.
-
-The Greenplum project team will also publish any mitigating steps users can
-take until the fix can be applied to their Greenplum Database instances.
-
-## Mailing lists
-
-* Use security@greenplum.org to report security concerns to the Greenplum
-  Database project team, who uses the list to privately discuss security issues
-  and fixes prior to disclosure.
-
-## Confidentiality, integrity and availability
-
-We consider vulnerabilities leading to the compromise of data confidentiality,
-elevation of privilege, or integrity to be our highest priority concerns.
-Availability, in particular in areas relating to DoS and resource exhaustion,
-is also a serious security concern. The Greenplum Database project team takes
-all vulnerabilities, potential vulnerabilities, and suspected vulnerabilities
-seriously and will investigate them in an urgent and expeditious manner.
-
-Note that we do not currently consider the default settings for Greenplum
-Database to be secure-by-default. It is necessary for operators to explicitly
-configure settings, role based access control, and other resource related
-features in Greenplum Database to provide a hardened Greenplum Database
-environment. We will not act on any security disclosure that relates to a lack
-of safe defaults. Over time, we will work towards improved safe-by-default
-configuration, taking into account backwards compatibility.
+Thanks for helping make Cloudberry Database safe!
+
+---
+
+## Reporting Security Issues
+
+To report a security issue, please email
+[security@cloudberrydb.org](mailto:security@cloudberrydb.org). This
+project follows a 90-day disclosure timeline. We will publish the
+[security
+advisories](https://github.com/cloudberrydb/cloudberrydb/security/advisories)
+via GitHub.
+
+You should receive a response within 2 weeks. If for some reason you
+do not, please follow up via email to ensure we received your original
+message.
+
+Please include the requested information listed below (as much as you
+can provide) to help us better understand the nature and scope of the
+possible issue:
+
+* Type of issue (e.g. buffer overflow, SQL injection, cross-site
+  scripting, etc.)
+* Full paths of source file(s) related to the manifestation of the
+  issue
+* The location of the affected source code (tag/branch/commit or
+  direct URL)
+* Any special configuration required to reproduce the issue
+* Step-by-step instructions to reproduce the issue
+* Proof-of-concept or exploit code (if possible)
+* Impact of the issue, including how an attacker might exploit the
+  issue
+
+This information will help us triage your report more quickly.
+
+## Do not
+
+For better collaboration, we hope you:
+
+- Do not file public issues on GitHub for security vulnerabilities.
+- Do not report non-security-impacting bugs through this channel. If
+  you have any questions on using, development, please use [GitHub
+  Issues, Discussions or
+  Slack](https://github.com/cloudberrydb/cloudberrydb/issues/new/choose)
+  instead.
+
+## Handling Process
+
+Here's an overview of the security issues handling process:
+
+* The reporter reports the security issues to the Cloudberry Database
+  team.
+* The Cloudberry Database team investigates the report and decides to
+  accept or reject the report. If our team rejects the report, the
+  team will explain why to the reporter. If we accept the report, our
+  team will work privately with the reporter to fix the security
+  issues.
+* Release the new version of the Cloudberry Database that includes the
+  fix.
+* Public the security issues.
+
+## Preferred Languages
+
+We prefer all communications to be in English.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 02/37: Changes for compiling PXF with GPDB 6.x

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 7df14917424a7e46ed2450f04405f92ee775c2c7
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 8 13:49:01 2022 -0700

    Changes for compiling PXF with GPDB 6.x
---
 external-table/src/gpdbwritableformatter.c | 26 +++++++++++++++-----------
 external-table/src/pxfheaders.c            | 15 ++++++++++++---
 external-table/src/pxfuriparser.c          |  7 +++++--
 external-table/src/pxfuriparser.h          |  2 +-
 4 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c
index 9885c3f0..a76a836d 100644
--- a/external-table/src/gpdbwritableformatter.c
+++ b/external-table/src/gpdbwritableformatter.c
@@ -347,7 +347,7 @@ boolArrayToByteArray(bool *data, int len, int validlen, int *outlen, TupleDesc t
 	for (i = 0, j = 0, k = 7; i < len; i++)
 	{
 		/* Ignore dropped attributes. */
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -396,7 +396,7 @@ byteArrayToBoolArray(bits8 *data, int data_len, int len, bool **booldata, int bo
 	for (i = 0, j = 0, k = 7; i < boollen; i++)
 	{
 		/* Ignore dropped attributes. */
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -440,7 +440,7 @@ verifyExternalTableDefinition(int16 ncolumns_remote, AttrNumber nvalidcolumns, A
 	/* Extract Column Type and check against External Table definition */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -512,7 +512,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	nvalidcolumns = 0;
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -545,7 +545,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 		/* setup the text/binary input function */
 		for (i = 0; i < ncolumns; i++)
 		{
-            #if PG_VERSION_NUM > 90400
+            #if PG_VERSION_NUM >= 120000
                 Form_pg_attribute attr = &tupdesc->attrs[i];
             #else
                 Form_pg_attribute attr = tupdesc->attrs[i];
@@ -607,7 +607,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	 */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -697,7 +697,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Write col type for columns that have not been dropped */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -718,7 +718,7 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	/* Column Value */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -789,7 +789,7 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	/* Get the number of valid columns, excluding dropped columns */
 	for (i = 0; i < ncolumns; i++)
 	{
-        #if PG_VERSION_NUM > 90400
+        #if PG_VERSION_NUM >= 120000
             Form_pg_attribute attr = &tupdesc->attrs[i];
         #else
             Form_pg_attribute attr = tupdesc->attrs[i];
@@ -820,7 +820,7 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 
 		for (i = 0; i < ncolumns; i++)
 		{
-			#if PG_VERSION_NUM > 90400
+			#if PG_VERSION_NUM >= 120000
 				Form_pg_attribute attr = &tupdesc->attrs[i];
 			#else
 				Form_pg_attribute attr = tupdesc->attrs[i];
@@ -942,7 +942,11 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	/* extract column value */
 	for (i = 0; i < ncolumns; i++)
 	{
-		Form_pg_attribute attr = TupleDescAttr(tupdesc, i);
+		#if PG_VERSION_NUM >= 120000
+			Form_pg_attribute attr = &tupdesc->attrs[i];
+		#else
+			Form_pg_attribute attr = tupdesc->attrs[i];
+		#endif
 
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped)
diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 90db8701..1ab908ad 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -21,9 +21,9 @@
 #include "pxfheaders.h"
 #include "commands/defrem.h"
 #if PG_VERSION_NUM >= 120000
+#include "utils/timestamp.h"
 #include "access/external.h"
 #include "extension/gp_exttable_fdw/extaccess.h"
-#include "executor/execExpr.h"
 #else
 #include "access/fileam.h"
 #include "catalog/pg_exttable.h"
@@ -272,7 +272,11 @@ add_tuple_desc_httpheader(CHURL_HEADERS headers, Relation rel)
 	/* Iterate attributes */
 	for (i = 0, attrIx = 0; i < tuple->natts; ++i)
 	{
-		FormData_pg_attribute *attribute = TupleDescAttr(tuple, i);
+		#if PG_VERSION_NUM >= 120000
+			Form_pg_attribute attribute = &tuple->attrs[i];
+		#else
+			Form_pg_attribute attribute = tuple->attrs[i];
+		#endif
 
 		/* Ignore dropped attributes. */
 		if (attribute->attisdropped)
@@ -570,8 +574,13 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 
 	for (i = 1; i <= tupdesc->natts; i++)
 	{
+        #if PG_VERSION_NUM >= 120000
+            Form_pg_attribute attr = &tupdesc->attrs[i];
+        #else
+            Form_pg_attribute attr = tupdesc->attrs[i];
+        #endif
 		/* Ignore dropped attributes. */
-		if (TupleDescAttr(tupdesc, i - 1)->attisdropped)
+		if (attr->attisdropped)
 		{
 			/* keep a counter of the number of dropped attributes */
 			droppedCount++;
diff --git a/external-table/src/pxfuriparser.c b/external-table/src/pxfuriparser.c
index 47fce006..52f18af9 100644
--- a/external-table/src/pxfuriparser.c
+++ b/external-table/src/pxfuriparser.c
@@ -290,8 +290,11 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri)
 	foreach(option, uri->options)
 	{
 		OptionData *data = (OptionData *) lfirst(option);
-
-		Value	   *key = makeString(asc_toupper(data->key, strlen(data->key)));
+		#if PG_VERSION_NUM >= 120000
+				Value	   *key = makeString(asc_toupper(data->key, strlen(data->key)));
+		#else
+				Value	   *key = makeString(str_toupper(data->key, strlen(data->key)));
+		#endif
 
 		if (!list_member(previousKeys, key))
 			previousKeys = lappend(previousKeys, key);
diff --git a/external-table/src/pxfuriparser.h b/external-table/src/pxfuriparser.h
index b007ea80..f52de266 100644
--- a/external-table/src/pxfuriparser.h
+++ b/external-table/src/pxfuriparser.h
@@ -24,7 +24,7 @@
 #include "nodes/pg_list.h"
 #include "fmgr.h"
 #include "utils/builtins.h"
-#if PG_VERSION_NUM >= 90600
+#if PG_VERSION_NUM >= 120000
 #include "lib/stringinfo.h"
 #include "nodes/value.h"
 #endif


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 10/37: Fix Tests for GP7

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit dcffb4d201345559a118185d22200af643894215
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Tue Sep 20 02:08:37 2022 -0700

    Fix Tests for GP7
---
 external-table/src/pxfheaders.c | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index bfd0fa44..d07a9595 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -504,8 +504,8 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	int			   dropped_count;
 	int			   number;
 	int			   numTargetList;
-#if PG_VERSION_NUM < 90400
-	int			   numSimpleVars;
+#if PG_VERSION_NUM < 90400 || PG_VERSION_NUM == 120000
+	int			   numSimpleVars = 0;
 #endif
 	char			long_number[sizeof(int32) * 8];
 	/* FIXME: to get it to compile assign it to NULL */
@@ -554,13 +554,18 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 		ListCell *lc1;
 
 		/* FIXME: commenting this out to make it compile */
-#if PG_VERSION_NUM < 120000
+
 		foreach(lc1, targetList)
 		{
+		#if PG_VERSION_NUM >= 120000
+		    ExprState *gstate = (ExprState *) lfirst(lc1);
+            add_attnums_from_targetList((Node *) gstate->expr, l);
+		#else
 			GenericExprState *gstate = (GenericExprState *) lfirst(lc1);
 			add_attnums_from_targetList((Node *) gstate->arg->expr, l);
+		#endif
 		}
-#endif
+
 		foreach(lc1, l)
 		{
 			int attno = lfirst_int(lc1);
@@ -574,11 +579,21 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 
 		list_free(l);
 	}
+#if PG_VERSION_NUM < 90400 || PG_VERSION_NUM >= 120000
+	else
+	{
+		#if PG_VERSION_NUM >= 120000
+			numSimpleVars = list_length(targetList);
+		#else
+			numSimpleVars = list_length(projInfo->pi_targetlist);
+		#endif
+	}
+#endif
 
 	number = numTargetList +
-#if PG_VERSION_NUM < 120000
 
-    #if PG_VERSION_NUM >= 90400
+
+    #if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
             // FIXME: Commenting this out for compilation success
             // pi_numSimpleVars is not available anymore in the postgters 12 code
             // https://doxygen.postgresql.org/structProjectionInfo.html
@@ -586,7 +601,6 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
     #else
             numSimpleVars +
     #endif
-#endif
 
 		list_length(qualsAttributes);
 	if (number == 0)
@@ -599,15 +613,10 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
 
-#if PG_VERSION_NUM >= 90400
-
-    #if PG_VERSION_NUM >= 120000
-        for (i = 0; i < sizeof(targetList) ; i++)
-    #else
+#if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
         /* FIXME: commenting out to get compile to work */
         //for (i = 0; i < projInfo->pi_numSimpleVars; i++)
         for (i = 0; i < projInfo->pi_numSimpleVars; i++)
-    #endif
 #else
 	for (i = 0; varNumbers && i < numSimpleVars; i++)
 	{


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 05/37: Fix compilation for PXF on GP7

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit d826a137db43e560fbd844c8ebc47c85e5d1c504
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Mon Sep 12 15:49:20 2022 -0700

    Fix compilation for PXF on GP7
---
 concourse/docker/rpmrebuild/rhel/Dockerfile | 18 ++++++++++++++++++
 concourse/scripts/build.bash                |  3 +++
 concourse/scripts/test.bash                 |  7 +++++++
 concourse/tasks/test.yml                    |  2 ++
 external-table/src/pxfheaders.c             |  1 -
 external-table/test/pxfheaders_test.c       | 10 ++++++++--
 6 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/concourse/docker/rpmrebuild/rhel/Dockerfile b/concourse/docker/rpmrebuild/rhel/Dockerfile
new file mode 100644
index 00000000..05b9364f
--- /dev/null
+++ b/concourse/docker/rpmrebuild/rhel/Dockerfile
@@ -0,0 +1,18 @@
+ARG BASE_IMAGE=gcr.io/data-gpdb-private-images/gpdb6-rhel8-test:latest
+
+FROM centos:7 as downloader
+
+# download source RPM for rpmrebuild from EPEL repository for EL7
+RUN yum install -y epel-release && yumdownloader --source rpmrebuild
+
+FROM ${BASE_IMAGE}
+
+COPY --from=downloader /rpmrebuild-*.src.rpm /
+
+# build EL8 RPM for rpmrebuild from the downloaded source RPM
+RUN rpmbuild --rebuild rpmrebuild-*.src.rpm \
+    && rpm -i /root/rpmbuild/RPMS/noarch/rpmrebuild-*.el8.noarch.rpm \
+    && rm rpmrebuild-*.src.rpm \
+    && rm -rf /root/rpmbuild
+
+RUN yum install libcgroup-tools
diff --git a/concourse/scripts/build.bash b/concourse/scripts/build.bash
index abef1583..5e1caa85 100755
--- a/concourse/scripts/build.bash
+++ b/concourse/scripts/build.bash
@@ -99,6 +99,9 @@ install_gpdb
 # given in the gpdb_package, so set the GPHOME after installation
 GPHOME=$(find /usr/local/ -name "greenplum-db-${GPDB_VERSION}*")
 
+# To Be Removed
+# This is temporary to change. Since The PR to incorporate these changes isn't merged in GPDB yet.
+
 HEADER_FILE_GP7=pxf_gp7_headerfile
 if [[ ${GPDB_VERSION:0:1} -ge 7 ]]; then
  #PROJECT=${GOOGLE_PROJECT_ID:-}
diff --git a/concourse/scripts/test.bash b/concourse/scripts/test.bash
index ed7cde8b..206e323f 100755
--- a/concourse/scripts/test.bash
+++ b/concourse/scripts/test.bash
@@ -131,6 +131,13 @@ function _main() {
 		install_gpdb_package
 	fi
 
+HEADER_FILE_GP7=pxf_gp7_headerfile
+if [[ ${GP_VER} -ge 7 ]]; then
+  mkdir ${GPHOME}/include/postgresql/server/extension/gp_exttable_fdw
+  cp ${HEADER_FILE_GP7}/extaccess.h  ${GPHOME}/include/postgresql/server/extension/gp_exttable_fdw
+fi
+
+
 	# Install PXF
 	if [[ -d pxf_package ]]; then
 		# forward compatibility pipeline works with PXF rpms, not rpm tarballs
diff --git a/concourse/tasks/test.yml b/concourse/tasks/test.yml
index 8d5d747f..695470af 100644
--- a/concourse/tasks/test.yml
+++ b/concourse/tasks/test.yml
@@ -13,6 +13,8 @@ inputs:
   optional: true
 - name: pxf_fdw_tarball
   optional: true
+- name: pxf_gp7_headerfile
+  optional: true
 
 params:
   ACCESS_KEY_ID:
diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 2d45a319..7ed01d2f 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -25,7 +25,6 @@
 #include "extension/gp_exttable_fdw/extaccess.h"
 #else
 #include "access/fileam.h"
-#include "utils/timestamp.h"
 #include "catalog/pg_exttable.h"
 #endif
 #include "utils/timestamp.h"
diff --git a/external-table/test/pxfheaders_test.c b/external-table/test/pxfheaders_test.c
index 57ff1cb5..4235d19d 100644
--- a/external-table/test/pxfheaders_test.c
+++ b/external-table/test/pxfheaders_test.c
@@ -188,7 +188,11 @@ test_build_http_headers(void **state)
 	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-FORMAT"));
 #if PG_VERSION_NUM >= 90400
 	expect_string(normalize_key_name, key, "delimiter");
-	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-DELIMITER"));
+
+	// Pipeline is failing with this error, so commenting this out.
+	// java.lang.IllegalArgumentException: The HTTP header line [x-gp-options-delimiter: ] does not conform to RFC 7230 and has been ignored.
+
+	//will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-DELIMITER"));
 	expect_string(normalize_key_name, key, "null");
 	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-NULL"));
 	expect_string(normalize_key_name, key, "escape");
@@ -202,7 +206,9 @@ test_build_http_headers(void **state)
 	expect_headers_append(input_data->headers, "X-GP-FORMAT", TextFormatName);
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-FORMAT", "csv");
 #if PG_VERSION_NUM >= 90400
-	expect_headers_append(input_data->headers, "X-GP-OPTIONS-DELIMITER", "|");
+    // Pipeline is failing with this error, so commenting this out.
+	// java.lang.IllegalArgumentException: The HTTP header line [x-gp-options-delimiter: ] does not conform to RFC 7230 and has been ignored.
+	//expect_headers_append(input_data->headers, "X-GP-OPTIONS-DELIMITER", "|");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-NULL", "");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-ESCAPE", "\"");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-QUOTE", "\"");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 33/37: ci: allow existing artifacts to remain if there is no pivnet product (#868)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 45efced0e188cb782098ddd50bf06f97397c3de5
Author: Ashuka Xue <ax...@vmware.com>
AuthorDate: Thu Sep 15 15:21:14 2022 -0700

    ci: allow existing artifacts to remain if there is no pivnet product (#868)
    
    In the case that there is no pivnet artifact to pull down, do not error
    out. Instead, keep whatever artifact was already present in the bucket.
---
 concourse/scripts/get_product_files.bash | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/concourse/scripts/get_product_files.bash b/concourse/scripts/get_product_files.bash
index f00024bb..9175adeb 100755
--- a/concourse/scripts/get_product_files.bash
+++ b/concourse/scripts/get_product_files.bash
@@ -32,12 +32,30 @@ versions=$(echo "${versions}" | grep -v "${GPDB_VERSION}\.99\.99")
 num_gpdb_versions=$(echo "${versions}" | wc -l)
 echo "Number of versions: ${num_gpdb_versions}"
 
-# if `VERSIONS_BEFORE_LATEST` is out of range, use the oldest available version
-if ((VERSIONS_BEFORE_LATEST >= num_gpdb_versions)); then
-	echo "VERSION_BEFORE_LATEST (${VERSIONS_BEFORE_LATEST}) exceeds number of versions (${num_gpdb_versions}) on GCS for Greenplum ${GPDB_VERSION}"
-	VERSIONS_BEFORE_LATEST=$((num_gpdb_versions - 1))
-	echo "Update VERSIONS_BEFORE_LATEST to ${VERSIONS_BEFORE_LATEST}"
-fi
+	if [[ -z "${id}" ]]; then
+		echo "Did not find '${file}' in product files for GPDB '${gpdb_version}'"
+
+		case "${file}" in
+			*rhel7*) existing_file="$(find ${product_dirs[$i]}/ -name *rhel7*.rpm)" ;;
+			*rhel8*) existing_file="$(find ${product_dirs[$i]}/ -name *rhel8*.rpm)" ;;
+			*ubuntu18*) existing_file="$(find ${product_dirs[$i]}/ -name *ubuntu18*.deb)" ;;
+			*)
+				echo "Unexpected file: ${file}"
+				exit 1;;
+		esac
+
+		echo "Keeping existing file: ${existing_file}"
+		continue
+	fi
+	echo "Cleaning ${product_dirs[$i]} and downloading ${file} with id ${id} to ${product_dirs[$i]}..."
+	rm -f "${product_dirs[$i]}"/*.{rpm,deb}
+	pivnet download-product-files \
+		"--download-dir=${product_dirs[$i]}" \
+		"--product-slug=${PRODUCT_SLUG}" \
+		"--release-version=${gpdb_version}" \
+		"--product-file-id=${id}" >/dev/null 2>&1 &
+	pids+=($!)
+done
 
 # get the `VERSIONS_BEFORE_LATEST`-th (zero-based index) latest version
 target_version=$(echo "${versions}" | awk -v i=${VERSIONS_BEFORE_LATEST} 'NR == i+1')


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 24/37: Update README.md (#1)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 635c1493f361f9d41c5499c399fe96ca29030df2
Author: Dianjin Wang <wa...@gmail.com>
AuthorDate: Thu Jun 13 10:06:49 2024 +0800

    Update README.md (#1)
---
 README.md | 53 ++++++++++++++++++++++++-----------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/README.md b/README.md
index 6e863f00..0f664531 100755
--- a/README.md
+++ b/README.md
@@ -13,24 +13,18 @@ PXF is an extensible framework that allows a distributed database like Greenplum
 PXF includes built-in connectors for accessing data that exists inside HDFS files, Hive tables, HBase tables, JDBC-accessible databases and more.
 Users can also create their own connectors to other data storage or processing engines.
 
+This project is forked from [greenplum/pxf](https://github.com/greenplum-db/pxf-archive) and customized for Cloudberry Database.
+
 ## Repository Contents
 
-* `external-table/`  
-    Contains the CloudberryDB extension implementing an External Table protocol handler
-* `fdw/`    
-    Contains the CloudberryDB extension implementing a Foreign Data Wrapper (FDW) for PXF
-* `server/`  
-    Contains the server side code of PXF along with the PXF Service and all the Plugins
-* `cli/`    
-    Contains command line interface code for PXF
-* `automation/`  
-    Contains the automation and integration tests for PXF against the various datasources
-* `singlecluster/`  
-    Hadoop testing environment to exercise the pxf automation tests
-* `regression/`  
-    Contains the end-to-end (integration) tests for PXF against the various datasources, utilizing the PostgreSQL testing framework `pg_regress`
-* `downloads/`  
-    An empty directory that serves as a staging location for CloudberryDB RPMs for the development Docker image
+* `external-table/` : Contains the CloudberryDB extension implementing an External Table protocol handler
+* `fdw/` : Contains the CloudberryDB extension implementing a Foreign Data Wrapper (FDW) for PXF
+* `server/` : Contains the server side code of PXF along with the PXF Service and all the Plugins
+* `cli/` : Contains command line interface code for PXF
+* `automation/` : Contains the automation and integration tests for PXF against the various datasources
+* `singlecluster/` : Hadoop testing environment to exercise the pxf automation tests
+* `regression/` : Contains the end-to-end (integration) tests for PXF against the various datasources, utilizing the PostgreSQL testing framework `pg_regress`
+* `downloads/` : An empty directory that serves as a staging location for CloudberryDB RPMs for the development Docker image
 
 ## PXF Development
 
@@ -56,9 +50,9 @@ To build PXF, you must have:
 
     Either download and install CloudberryDB RPM or build CloudberryDB from the source by following instructions in the [CloudberryDB](https://github.com/cloudberrydb/cloudberrydb).
 
-    Assuming you have installed CloudberryDB into `/usr/local/cloudberry-db` directory, run its environment script:
+    Assuming you have installed CloudberryDB into `/usr/local/cloudberrydb` directory, run its environment script:
     ```
-    source /usr/local/cloudberry-db/greenplum_path.sh
+    source /usr/local/cloudberrydb/greenplum_path.sh
     ```
 
 3. JDK 1.8 or JDK 11 to compile/run
@@ -78,10 +72,11 @@ To build PXF, you must have:
     export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
     ```
 
-   For the new M1 Apple Macs, add the following to your path instead
-   ```shell
-   export PATH=$PATH:/opt/homebrew/bin/go/bin:$GOPATH/bin
-   ```
+    Once you have installed Go, you will need the `ginkgo` tool which runs Go tests,
+    respectively. Assuming `go` is on your `PATH`, you can run:
+    ```
+    go install github.com/onsi/ginkgo/ginkgo@latest
+    ```
 
 5. cURL (7.29 or later):
 
@@ -105,10 +100,10 @@ make test
 
 ### How to Install PXF
 
-To install PXF, first make sure that the user has sufficient permissions in the `$GPHOME` and `$PXF_HOME` directories to perform the installation. It's recommended to change ownership to match the installing user. For example, when installing PXF as user `gpadmin` under `/usr/local/cloudberry-db`:
+To install PXF, first make sure that the user has sufficient permissions in the `$GPHOME` and `$PXF_HOME` directories to perform the installation. It's recommended to change ownership to match the installing user. For example, when installing PXF as user `gpadmin` under `/usr/local/cloudberrydb`:
 
 ```bash
-export GPHOME=/usr/local/cloudberry-db
+export GPHOME=/usr/local/cloudberrydb
 export PXF_HOME=/usr/local/pxf
 export PXF_BASE=${HOME}/pxf-base
 chown -R gpadmin:gpadmin "${GPHOME}" "${PXF_HOME}"
@@ -179,14 +174,14 @@ cp ${PXF_HOME}/templates/*-site.xml ${PXF_BASE}/servers/default
 
 The quick and easy is to download the CloudberryDB RPM from GitHub and move it into the `/downloads` folder. Then run `./dev/start.bash` to get a docker image with a running CloudberryDB, Hadoop cluster and an installed PXF.
 
-#### Setup GPDB in the Docker image
+#### Setup CloudberryDB in the Docker image
 
-Configure, build and install GPDB. This will be needed only when you use the container for the first time with GPDB source.
+Configure, build and install CloudberryDB. This will be needed only when you use the container for the first time with CloudberryDB source.
 
 ```bash
 ~/workspace/pxf/dev/build_gpdb.bash
-sudo mkdir /usr/local/greenplum-db-devel
-sudo chown gpadmin:gpadmin /usr/local/greenplum-db-devel
+sudo mkdir /usr/local/cloudberry-db-devel
+sudo chown gpadmin:gpadmin /usr/local/cloudberry-db-devel
 ~/workspace/pxf/dev/install_gpdb.bash
 ```
 
@@ -327,7 +322,7 @@ no JDK set for Gradle. Just cancel and retry. It goes away the second time.
 - Save the configuration
 - Restart PXF in DEBUG Mode `PXF_DEBUG=true pxf restart`
 - Debug the new configuration in IntelliJ
-- Run a query in GPDB that uses PXF to debug with IntelliJ
+- Run a query in CloudberryDB that uses PXF to debug with IntelliJ
 
 ## To run a Kerberized Hadoop Cluster
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 31/37: docs - misc updates/additions to the orc write docs (#864)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 4974d1fd6b13c341d652728e5b6f5bbe5fca4f32
Author: Lisa Owen <lo...@pivotal.io>
AuthorDate: Wed Sep 14 16:37:35 2022 -0600

    docs - misc updates/additions to the orc write docs (#864)
    
    * docs - misc updates/additions to the orc write docs
    
    * reword per bradford
    
    * more rewording per bradford
---
 docs/content/hdfs_orc.html.md.erb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/content/hdfs_orc.html.md.erb b/docs/content/hdfs_orc.html.md.erb
index f429ee2b..415cd292 100644
--- a/docs/content/hdfs_orc.html.md.erb
+++ b/docs/content/hdfs_orc.html.md.erb
@@ -198,7 +198,8 @@ Procedure:
     {"location": "Rome", "month": "Mar","num_orders": 87, "total_sales": 1557.39, "items_sold": ["coats"]}
     {"location": "Bangalore", "month": "May","num_orders": 317, "total_sales": 8936.99, "items_sold": ["winter socks", "long-sleeved shirts", "boots"]}
     {"location": "Beijing", "month": "Jul","num_orders": 411, "total_sales": 11600.67, "items_sold": ["hoodies/sweaters", "pants"]}
-    {"location": "Los Angeles", "month": "Dec","num_orders": 0, "total_sales": 0.00, "items_sold": null}' > /tmp/sampledata.json
+    {"location": "Los Angeles", "month": "Dec","num_orders": 0, "total_sales": 0.00, "items_sold": null}
+' > /tmp/sampledata.json
     ```
 
 1. [Download](https://repo1.maven.org/maven2/org/apache/orc/orc-tools) the most recent version of the `orc-tools` JAR to the current working directory.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 17/37: Resolving conflicts

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit b42eb7096793c87e14c2ff87844091ab4dd2a479
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Oct 20 14:17:37 2022 -0700

    Resolving conflicts
---
 .../components/common/DbSystemObject.java          |  1 -
 concourse/scripts/pxf_common.bash                  | 12 ++--
 concourse/scripts/test.bash                        | 75 +++++++++++++++++++---
 concourse/tasks/test.yml                           |  5 +-
 4 files changed, 72 insertions(+), 21 deletions(-)

diff --git a/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java b/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
index e07e2456..c389ea5b 100755
--- a/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
+++ b/automation/src/main/java/org/greenplum/pxf/automation/components/common/DbSystemObject.java
@@ -358,7 +358,6 @@ public abstract class DbSystemObject extends BaseSystemObject implements IDbFunc
 		if (table != null) {
 			tableName = table.getName();
 		}
-		// TODO : Conflict with Alex's PR need to remove later.
 		return metaData.getTables(null, null, "%" + tableName, new String[] { "TABLE", "FOREIGN TABLE" });
 	}
 
diff --git a/concourse/scripts/pxf_common.bash b/concourse/scripts/pxf_common.bash
index c313a32c..d071d6e4 100755
--- a/concourse/scripts/pxf_common.bash
+++ b/concourse/scripts/pxf_common.bash
@@ -53,13 +53,11 @@ function inflate_dependencies() {
 		tarballs+=(regression-tools/regression-tools.tar.gz)
 	fi
 
-  # TODO : Conflict with Alex's PR need to remove later.
-  # when running automation against GP7, we need python2 dependencies shipped with gp6 to make Tinc work
-  # if required, these libraries will be fetched by a CI pipeline under gp6-python-libs directory
-  if [[ -f gp6-python-libs/gp6-python-libs.tar.gz ]]; then
-    tarballs+=(gp6-python-libs/gp6-python-libs.tar.gz)
-  fi
-
+	# when running automation against GP7, we need python2 dependencies shipped with gp6 to make Tinc work
+	# if required, these libraries will be fetched by a CI pipeline under gp6-python-libs directory
+	if [[ -f gp6-python-libs/gp6-python-libs.tar.gz ]]; then
+		tarballs+=(gp6-python-libs/gp6-python-libs.tar.gz)
+	fi
 	(( ${#tarballs[@]} == 0 )) && return
 	for t in "${tarballs[@]}"; do
 		tar -xzf "${t}" -C ~gpadmin
diff --git a/concourse/scripts/test.bash b/concourse/scripts/test.bash
index b2e724ed..77f27409 100755
--- a/concourse/scripts/test.bash
+++ b/concourse/scripts/test.bash
@@ -67,6 +67,65 @@ function run_pg_regress() {
 	su gpadmin -c ~gpadmin/run_pxf_automation_test.sh
 }
 
+function run_pxf_automation() {
+	# Let's make sure that automation/singlecluster directories are writeable
+	chmod a+w pxf_src/automation /singlecluster || true
+	find pxf_src/automation/tinc* -type d -exec chmod a+w {} \;
+
+	local extension_name="pxf"
+	if [[ ${USE_FDW} == "true" ]]; then
+		extension_name="pxf_fdw"
+	fi
+
+	#TODO: remove once exttable tests with GP7 are set
+	if [[ ${GROUP} == fdw_gpdb_schedule ]]; then
+		extension_name="pxf_fdw"
+	fi
+
+	su gpadmin -c "
+		source '${GPHOME}/greenplum_path.sh' &&
+		psql -p ${PGPORT} -d template1 -c 'CREATE EXTENSION ${extension_name}'
+	"
+	# prepare certification output directory
+	mkdir -p certification
+	chmod a+w certification
+
+	cat > ~gpadmin/run_pxf_automation_test.sh <<-EOF
+		#!/usr/bin/env bash
+		set -exo pipefail
+
+		source ~gpadmin/.pxfrc
+
+		export PATH=\$PATH:${GPHD_ROOT}/bin
+		export GPHD_ROOT=${GPHD_ROOT}
+		export PXF_HOME=${PXF_HOME}
+		export PGPORT=${PGPORT}
+		export USE_FDW=${USE_FDW}
+
+		cd pxf_src/automation
+		time make GROUP=${GROUP} test
+
+		# if the test is successful, create certification file
+		gpdb_build_from_sql=\$(psql -c 'select version()' | grep Greenplum | cut -d ' ' -f 6,8)
+		gpdb_build_clean=\${gpdb_build_from_sql%)}
+		pxf_version=\$(< ${PXF_HOME}/version)
+		echo "GPDB-\${gpdb_build_clean/ commit:/-}-PXF-\${pxf_version}" > "${PWD}/certification/certification.txt"
+		echo
+		echo '****************************************************************************************************'
+		echo "Wrote certification : \$(< ${PWD}/certification/certification.txt)"
+		echo '****************************************************************************************************'
+	EOF
+
+	chown gpadmin:gpadmin ~gpadmin/run_pxf_automation_test.sh
+	chmod a+x ~gpadmin/run_pxf_automation_test.sh
+
+	if [[ ${ACCEPTANCE} == true ]]; then
+		echo 'Acceptance test pipeline'
+		exit 1
+	fi
+
+	su gpadmin -c ~gpadmin/run_pxf_automation_test.sh
+}
 
 function generate_extras_fat_jar() {
 	mkdir -p /tmp/fatjar
@@ -137,7 +196,6 @@ if [[ ${GP_VER} -ge 7 ]]; then
   cp ${HEADER_FILE_GP7}/extaccess.h  ${GPHOME}/include/postgresql/server/extension/gp_exttable_fdw
 fi
 
-
 	# Install PXF
 	if [[ -d pxf_package ]]; then
 		# forward compatibility pipeline works with PXF rpms, not rpm tarballs
@@ -203,15 +261,12 @@ fi
 
 	inflate_dependencies
 
-  # TODO : Conflict with Alex's PR need to remove later.
-  # To run Tinc against GP7 we need to modify PYTHONPATH in $GPHOME/greenplum_path.sh since Tinc calls that script
-  # we will set PYTHONPATH to point to the set of python libs compiled with Python2 for GP6
-  if [[ ${GP_VER} == 7 ]]; then
-    local gp6_python_libs=~gpadmin/python
-    echo "export PYTHONPATH=${gp6_python_libs}" >> /usr/local/greenplum-db/greenplum_path.sh
-  fi
-
-
+	# To run Tinc against GP7 we need to modify PYTHONPATH in $GPHOME/greenplum_path.sh since Tinc calls that script
+	# we will set PYTHONPATH to point to the set of python libs compiled with Python2 for GP6
+	if [[ ${GP_VER} == 7 ]]; then
+	  local gp6_python_libs=~gpadmin/python
+	  echo "export PYTHONPATH=${gp6_python_libs}" >> /usr/local/greenplum-db/greenplum_path.sh
+	fi
 
 	ln -s "${PWD}/pxf_src" ~gpadmin/pxf_src
 
diff --git a/concourse/tasks/test.yml b/concourse/tasks/test.yml
index 6f89f8c9..b868ff46 100644
--- a/concourse/tasks/test.yml
+++ b/concourse/tasks/test.yml
@@ -13,9 +13,9 @@ inputs:
   optional: true
 - name: pxf_fdw_tarball
   optional: true
-- name: pxf_gp7_headerfile
+- name: gp6-python-libs
   optional: true
-- name: gp6-python-libs # TODO : Conflict with Alex's PR need to remove later.
+- name: pxf_gp7_headerfile
   optional: true
 
 params:
@@ -35,6 +35,5 @@ params:
   PG_REGRESS:
   USE_FDW: false
   ADJUST_AUTOMATION: true
-
 run:
   path: pxf_src/concourse/scripts/test.bash


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 03/37: Handle fucntion call for 6.x and 7.x

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit a81df0b94fa4991eef7305948f3815e1dd1657b4
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Fri Sep 9 14:35:19 2022 -0700

    Handle fucntion call for 6.x and 7.x
---
 external-table/src/pxfheaders.c   |  2 +-
 external-table/src/pxfuriparser.c | 13 ++++++++-----
 external-table/src/pxfutils.c     |  7 ++++++-
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 1ab908ad..2d45a319 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -21,11 +21,11 @@
 #include "pxfheaders.h"
 #include "commands/defrem.h"
 #if PG_VERSION_NUM >= 120000
-#include "utils/timestamp.h"
 #include "access/external.h"
 #include "extension/gp_exttable_fdw/extaccess.h"
 #else
 #include "access/fileam.h"
+#include "utils/timestamp.h"
 #include "catalog/pg_exttable.h"
 #endif
 #include "utils/timestamp.h"
diff --git a/external-table/src/pxfuriparser.c b/external-table/src/pxfuriparser.c
index 52f18af9..e251e0c9 100644
--- a/external-table/src/pxfuriparser.c
+++ b/external-table/src/pxfuriparser.c
@@ -290,11 +290,14 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri)
 	foreach(option, uri->options)
 	{
 		OptionData *data = (OptionData *) lfirst(option);
-		#if PG_VERSION_NUM >= 120000
-				Value	   *key = makeString(asc_toupper(data->key, strlen(data->key)));
-		#else
-				Value	   *key = makeString(str_toupper(data->key, strlen(data->key)));
-		#endif
+
+// For GP 5.x latest ( 5.29.8) the server_version_num is 80323.
+// For 6.x or later str_toupper doesn't work as it has different signature ( one extra parameter) so the asc_toupper will work for 6.x or 7.x
+#if PG_VERSION_NUM <= 80323
+		Value	   *key = makeString(str_toupper(data->key, strlen(data->key)));
+#else
+		Value	   *key = makeString(asc_toupper(data->key, strlen(data->key)));
+#endif
 
 		if (!list_member(previousKeys, key))
 			previousKeys = lappend(previousKeys, key);
diff --git a/external-table/src/pxfutils.c b/external-table/src/pxfutils.c
index c6a01e6c..d8b2258d 100644
--- a/external-table/src/pxfutils.c
+++ b/external-table/src/pxfutils.c
@@ -22,8 +22,13 @@ normalize_key_name(const char *key)
 				(errcode(ERRCODE_INTERNAL_ERROR),
 				 errmsg("internal error in pxfutils.c:normalize_key_name. Parameter key is null or empty.")));
 	}
-
+// For GP 5.x latest ( 5.29.8) the server_version_num is 80323.
+// For 6.x or later str_toupper doesn't work as it has different signature ( one extra parameter) so the asc_toupper will work for 6.x or 7.x
+#if PG_VERSION_NUM <= 80323
+	return psprintf("X-GP-OPTIONS-%s", str_toupper(pstrdup(key), strlen(key)));
+#else
 	return psprintf("X-GP-OPTIONS-%s", asc_toupper(pstrdup(key), strlen(key)));
+#endif
 }
 
 /*


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 12/37: Update Catalog query to get Foreign Tables

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 82d659f974074a561b66a6b619c14af55944629b
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Thu Sep 22 14:27:04 2022 -0700

    Update Catalog query  to get Foreign Tables
---
 external-table/test/pxfheaders_test.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/external-table/test/pxfheaders_test.c b/external-table/test/pxfheaders_test.c
index 4235d19d..57ff1cb5 100644
--- a/external-table/test/pxfheaders_test.c
+++ b/external-table/test/pxfheaders_test.c
@@ -188,11 +188,7 @@ test_build_http_headers(void **state)
 	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-FORMAT"));
 #if PG_VERSION_NUM >= 90400
 	expect_string(normalize_key_name, key, "delimiter");
-
-	// Pipeline is failing with this error, so commenting this out.
-	// java.lang.IllegalArgumentException: The HTTP header line [x-gp-options-delimiter: ] does not conform to RFC 7230 and has been ignored.
-
-	//will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-DELIMITER"));
+	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-DELIMITER"));
 	expect_string(normalize_key_name, key, "null");
 	will_return(normalize_key_name, pstrdup("X-GP-OPTIONS-NULL"));
 	expect_string(normalize_key_name, key, "escape");
@@ -206,9 +202,7 @@ test_build_http_headers(void **state)
 	expect_headers_append(input_data->headers, "X-GP-FORMAT", TextFormatName);
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-FORMAT", "csv");
 #if PG_VERSION_NUM >= 90400
-    // Pipeline is failing with this error, so commenting this out.
-	// java.lang.IllegalArgumentException: The HTTP header line [x-gp-options-delimiter: ] does not conform to RFC 7230 and has been ignored.
-	//expect_headers_append(input_data->headers, "X-GP-OPTIONS-DELIMITER", "|");
+	expect_headers_append(input_data->headers, "X-GP-OPTIONS-DELIMITER", "|");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-NULL", "");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-ESCAPE", "\"");
 	expect_headers_append(input_data->headers, "X-GP-OPTIONS-QUOTE", "\"");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 04/37: Temporary add GPDB header file to Install directory Manually

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 18056b1f2d933df518535a7e5afc325be6e5a609
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Mon Sep 12 00:37:51 2022 -0700

    Temporary add GPDB header file to Install directory Manually
---
 .../pipelines/templates/dev_build_pipeline-tpl.yml | 173 +++++++++++++++++++--
 concourse/scripts/build.bash                       |  16 +-
 concourse/scripts/initialize_gpdb.bash             |   1 +
 concourse/tasks/build.yml                          |   2 +
 4 files changed, 179 insertions(+), 13 deletions(-)

diff --git a/concourse/pipelines/templates/dev_build_pipeline-tpl.yml b/concourse/pipelines/templates/dev_build_pipeline-tpl.yml
index 659ac660..b2ace48a 100644
--- a/concourse/pipelines/templates/dev_build_pipeline-tpl.yml
+++ b/concourse/pipelines/templates/dev_build_pipeline-tpl.yml
@@ -142,11 +142,70 @@ resources:
     {% include 'resources/pxf-artifact-tpl.yml' %}
 {% endcall %}
 
+- name: gpdb7_rhel8_rpm_latest-0
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/gpdb-concourse-resources-prod-bucket-name))
+    json_key: ((concourse-gcs-resources-service-account-key))
+    regexp: server/published/master/greenplum-db-(7.*)-rhel8-x86_64.rpm
+
 ## ---------- PXF 5 Artifact ---------------
 {% if multinode_el7 %}
     [[macros.resource_pxf5_gp6_el7_artifact()]]
 {% endif %}
 
+## ---------- PXF Build Artifacts ----------
+{% set gp_ver = None %}
+
+{% for gp_ver in range(5, 8) %}
+- name: pxf_gp[[gp_ver]]_tarball_rhel7
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/build-bucket-name))
+    json_key: ((ud/pxf/secrets/pxf-storage-service-account-key))
+    versioned_file: dev/[[user]]-[[branch]]/snapshots/pxf6/pxf-gp[[gp_ver]].el7.tar.gz
+{% endfor %}
+
+{% set gp_ver = 6 %}
+- name: pxf_gp[[gp_ver]]_tarball_ubuntu18
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/build-bucket-name))
+    json_key: ((ud/pxf/secrets/pxf-storage-service-account-key))
+    versioned_file: dev/[[user]]-[[branch]]/snapshots/pxf6/pxf-gp[[gp_ver]]-ubuntu18.04.tar.gz
+{% set gp_ver = None %}
+
+{% for gp_ver in range(6, 7) %}
+- name: pxf_gp[[gp_ver]]_tarball_rhel8
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/build-bucket-name))
+    json_key: ((ud/pxf/secrets/pxf-storage-service-account-key))
+    versioned_file: dev/[[user]]-[[branch]]/snapshots/pxf6/pxf-gp[[gp_ver]].el8.tar.gz
+{% endfor %}
+
+
+- name: pxf_gp7_headerfile
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/build-resources-bucket-name))
+    json_key: ((ud/pxf/secrets/pxf-storage-service-account-key))
+    versioned_file: build-dependencies/extaccess.h
+
+
+- name: pxf-build-dependencies
+  type: gcs
+  icon: google-drive
+  source:
+    bucket: ((ud/pxf/common/build-resources-bucket-name))
+    json_key: ((ud/pxf/secrets/pxf-storage-service-account-key))
+    versioned_file: build-dependencies/pxf-build-dependencies.tar.gz
+
 ## ---------- Auxiliary Resources ----------
 {% if use_ccp %}
     [[macros.resource_terraform('gpdb')]]
@@ -161,13 +220,29 @@ resources:
 ## ======================================================================
 jobs:
 
-## ---------- Build and Basic single node Test Swimlanes ----------
-{# include a build job for all OS other than OEL (which does not have a separate build job) #}
-{% call(x) macros.for_each_config(build_test_pxf_combinations) %}
-    {% if x.test_os != 'oel' %}
-        {% include 'jobs/build-tpl.yml' %}
-    {% endif %}
-{% endcall %}
+## ---------- Centos 7 Swimlane ----------
+{% for gp_ver in range(5, 8) %}
+- name: Build PXF-GP[[gp_ver]] on RHEL7
+  plan:
+  - in_parallel:
+    - get: pxf_src
+      trigger: true
+    - get: gpdb_package
+      resource: gpdb[[gp_ver]]_rhel7_rpm_latest-0
+    - get: gpdb[[gp_ver]]-pxf-dev-centos7-image
+    - get: pxf-build-dependencies
+{% if gp_ver == 7 %}
+    - get: pxf_gp7_headerfile
+{% endif %}
+  - task: Build PXF-GP[[gp_ver]] on RHEL7
+    image: gpdb[[gp_ver]]-pxf-dev-centos7-image
+    file: pxf_src/concourse/tasks/build.yml
+    params:
+      LICENSE: ((ud/pxf/common/rpm-license))
+      VENDOR: ((ud/pxf/common/rpm-vendor))
+  - put: pxf_gp[[gp_ver]]_tarball_rhel7
+    params:
+      file: dist/pxf-gp[[gp_ver]]-*.el7.tar.gz
 
 {# include a non-FDW test job for all OS other than OEL (unless requested in the Makefile) #}
 {% call(x) macros.for_each_config(build_test_pxf_combinations) %}
@@ -212,9 +287,87 @@ jobs:
             {% set use_impers = 'false' if (test_feature in clouds or test_feature == default_distro) else 'true' %}
             {% do x.update({'use_impers': use_impers}) %}
 
-            {# define a protocol if the feature is a cloud test #}
-            {% set protocol = test_feature if test_feature in clouds else '' %}
-            {% do x.update({'protocol': protocol}) %}
+## -- PXF GP7 REHL 8 --
+
+  {% set gp_ver = 7 %}
+- name: Build PXF-GP[[gp_ver]] on RHEL8
+  plan:
+    - in_parallel:
+        - get: pxf_src
+          trigger: true
+        - get: gpdb_package
+          resource: gpdb[[gp_ver]]_rhel8_rpm_latest-0
+        - get: gpdb[[gp_ver]]-pxf-dev-rhel8-image
+        - get: pxf-build-dependencies
+    - task: Build PXF-GP[[gp_ver]] on RHEL8
+      image: gpdb[[gp_ver]]-pxf-dev-rhel8-image
+      file: pxf_src/concourse/tasks/build.yml
+      params:
+        LICENSE: ((ud/pxf/common/rpm-license))
+        VENDOR: ((ud/pxf/common/rpm-vendor))
+        GOOGLE_CREDENTIALS: ((ud/pxf/secrets/ccp-ci-service-account-key))
+        GOOGLE_PROJECT_ID: ((ud/pxf/common/google-project-id))
+        GOOGLE_ZONE: ((ud/pxf/common/google-zone))
+    - put: pxf_gp[[gp_ver]]_tarball_rhel8
+      params:
+        file: dist/pxf-gp[[gp_ver]]-*.el8.tar.gz
+
+- name: Test PXF-GP[[gp_ver]]-HDP2 on RHEL8
+  plan:
+    - in_parallel:
+        - get: pxf_src
+          passed: [Build PXF-GP[[gp_ver]] on RHEL8]
+          trigger: true
+        - get: pxf_tarball
+          resource: pxf_gp[[gp_ver]]_tarball_rhel8
+          passed: [Build PXF-GP[[gp_ver]] on RHEL8]
+        - get: gpdb_package
+          resource: gpdb[[gp_ver]]_rhel8_rpm_latest-0
+          passed: [Build PXF-GP[[gp_ver]] on RHEL8]
+        - get: gpdb[[gp_ver]]-pxf-dev-rhel8-image
+          passed: [Build PXF-GP[[gp_ver]] on RHEL8]
+        - get: pxf-automation-dependencies
+        - get: singlecluster
+          resource: singlecluster-hdp2
+    - task: Test PXF-GP[[gp_ver]]-HDP2 on RHEL8
+      file: pxf_src/concourse/tasks/test.yml
+      image: gpdb[[gp_ver]]-pxf-dev-rhel8-image
+      params:
+        ACCESS_KEY_ID: ((tf-machine-access-key-id))
+        GP_VER: [[gp_ver]]
+        GROUP: gpdb,proxy,profile
+SECRET_ACCESS_KEY: ((tf-machine-secret-access-key))
+  {% set gp_ver = None %}
+
+## ---------- Extended Tests ----------
+{% set gp_ver = 6 %}
+{% if hdp2 %}
+- name: Test PXF-GP[[gp_ver]]-HDP2-NO-IMPERS on RHEL7
+  plan:
+  - in_parallel:
+    - get: pxf_src
+      passed: [Build PXF-GP[[gp_ver]] on RHEL7]
+      trigger: true
+    - get: pxf_tarball
+      resource: pxf_gp[[gp_ver]]_tarball_rhel7
+      passed: [Build PXF-GP[[gp_ver]] on RHEL7]
+    - get: gpdb_package
+      resource: gpdb[[gp_ver]]_rhel7_rpm_latest-0
+      passed: [Build PXF-GP[[gp_ver]] on RHEL7]
+    - get: gpdb[[gp_ver]]-pxf-dev-centos7-image
+    - get: pxf-automation-dependencies
+    - get: singlecluster
+      resource: singlecluster-hdp2
+  - task: Test PXF-GP[[gp_ver]]-HDP2-NO-IMPERS on RHEL7
+    file: pxf_src/concourse/tasks/test.yml
+    image: gpdb[[gp_ver]]-pxf-dev-centos7-image
+    params:
+      GP_VER: [[gp_ver]]
+      IMPERSONATION: false
+{% if slack_notification %}
+    <<: *slack_alert
+{% endif %}
+{% endif %}
 
             {# define a feature name to go into the test job name, unless it is a test against a distro/cloud only #}
             {% set feature = test_feature if test_feature not in distros and test_feature not in clouds else '' %}
diff --git a/concourse/scripts/build.bash b/concourse/scripts/build.bash
index 6cfb731b..abef1583 100755
--- a/concourse/scripts/build.bash
+++ b/concourse/scripts/build.bash
@@ -97,9 +97,19 @@ function package_pxf_fdw() {
 install_gpdb
 # installation of GPDB from RPM/DEB doesn't ensure that the installation location will match the version
 # given in the gpdb_package, so set the GPHOME after installation
-# In case we are testing a dev version (i.e: 6.25.3+dev.6.54a3437), GPDB_VERSION%%+* will remove any extra string from + onwards
-# TODO: revert this change when there are publicly available distributions of rocky9 GPDB rpms
-GPHOME=$(find /usr/local/ -name "greenplum-db-${GPDB_VERSION%%+*}*")
+GPHOME=$(find /usr/local/ -name "greenplum-db-${GPDB_VERSION}*")
+
+HEADER_FILE_GP7=pxf_gp7_headerfile
+if [[ ${GPDB_VERSION:0:1} -ge 7 ]]; then
+ #PROJECT=${GOOGLE_PROJECT_ID:-}
+
+ #gcloud config set project "$PROJECT"
+ #gcloud auth activate-service-account --key-file=<(echo "$GOOGLE_CREDENTIALS")
+
+  mkdir ${GPHOME}/include/postgresql/server/extension/gp_exttable_fdw
+  cp ${HEADER_FILE_GP7}/extaccess.h  ${GPHOME}/include/postgresql/server/extension/gp_exttable_fdw
+fi
+
 inflate_dependencies
 compile_pxf
 package_pxf
diff --git a/concourse/scripts/initialize_gpdb.bash b/concourse/scripts/initialize_gpdb.bash
index 02743dea..7630e9a7 100755
--- a/concourse/scripts/initialize_gpdb.bash
+++ b/concourse/scripts/initialize_gpdb.bash
@@ -21,6 +21,7 @@ sed -e "s/MASTER_HOSTNAME=mdw/MASTER_HOSTNAME=\$(hostname -f)/g" \
 	"${GPHOME}/docs/cli_help/gpconfigs/gpinitsystem_config" >~gpadmin/gpconfigs/gpinitsystem_config
 chmod +w ~gpadmin/gpconfigs/gpinitsystem_config
 
+
 #Script to start segments and create directories.
 hostname -f >/tmp/hosts.txt
 
diff --git a/concourse/tasks/build.yml b/concourse/tasks/build.yml
index 5e9f7924..2e6a61ee 100644
--- a/concourse/tasks/build.yml
+++ b/concourse/tasks/build.yml
@@ -9,6 +9,8 @@ inputs:
   optional: true
 - name: pxf_src
 - name: gpdb_package
+- name: pxf_gp7_headerfile
+  optional: true
 
 outputs:
 - name: dist


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 14/37: Fixing Tinc tests

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit b099e6099dd47dd4477036ede98fb96bd1aabae4
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Fri Sep 23 15:03:40 2022 -0700

    Fixing Tinc tests
---
 automation/sqlrepo/features/general/alter/csv/expected/query01.ans | 6 ++++++
 automation/sqlrepo/features/general/alter/csv/sql/query01.sql      | 6 ++++++
 .../general/alter/pxfwritable_export/parquet/expected/query01.ans  | 7 +++++++
 .../general/alter/pxfwritable_export/parquet/sql/query01.sql       | 6 ++++++
 .../without_column_projection/expected/query01.ans                 | 3 +++
 .../pxfwritable_import/without_column_projection/sql/query01.sql   | 3 +++
 6 files changed, 31 insertions(+)

diff --git a/automation/sqlrepo/features/general/alter/csv/expected/query01.ans b/automation/sqlrepo/features/general/alter/csv/expected/query01.ans
index 387649e3..e420274b 100644
--- a/automation/sqlrepo/features/general/alter/csv/expected/query01.ans
+++ b/automation/sqlrepo/features/general/alter/csv/expected/query01.ans
@@ -12,6 +12,12 @@
 -- m/ERROR/
 -- s/ERROR:  missing data for column "bool"/ERROR:  invalid input syntax for integer: "1.0"/g
 --
+-- m/ERROR/
+-- s/ERROR:  invalid input syntax for integer: "1.0"/ERROR:  invalid input syntax for type integer: "1.0"/g
+--
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
 -- m/pxf:\/\/(.*)\/pxf_automation_data/
 -- s/pxf:\/\/.*alter-tests.*/pxf:\/\/pxf_automation_data?PROFILE=*:text/
 --
diff --git a/automation/sqlrepo/features/general/alter/csv/sql/query01.sql b/automation/sqlrepo/features/general/alter/csv/sql/query01.sql
index 55b43906..204bdb71 100644
--- a/automation/sqlrepo/features/general/alter/csv/sql/query01.sql
+++ b/automation/sqlrepo/features/general/alter/csv/sql/query01.sql
@@ -10,6 +10,12 @@
 -- m/ERROR/
 -- s/ERROR:  missing data for column "bool"/ERROR:  invalid input syntax for integer: "1.0"/g
 --
+-- m/ERROR/
+-- s/ERROR:  invalid input syntax for integer: "1.0"/ERROR:  invalid input syntax for type integer: "1.0"/g
+--
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
 -- m/pxf:\/\/(.*)\/pxf_automation_data/
 -- s/pxf:\/\/.*alter-tests.*/pxf:\/\/pxf_automation_data?PROFILE=*:text/
 --
diff --git a/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/expected/query01.ans b/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/expected/query01.ans
index 8a16cafa..50d1f85c 100644
--- a/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/expected/query01.ans
+++ b/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/expected/query01.ans
@@ -1,3 +1,10 @@
+-- start_matchsubs
+--
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
+-- end_matchsubs
+
 -- start_ignore
 -- end_ignore
 -- @description query01 test altering table, dropping columns during write
diff --git a/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/sql/query01.sql b/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/sql/query01.sql
index 50a20423..05d98b50 100644
--- a/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/sql/query01.sql
+++ b/automation/sqlrepo/features/general/alter/pxfwritable_export/parquet/sql/query01.sql
@@ -1,4 +1,10 @@
 -- @description query01 test altering table, dropping columns during write
+-- start_matchsubs
+--
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
+-- end_matchsubs
 
 -- Insert all columns
 INSERT INTO pxf_alter_write_parquet_table
diff --git a/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/expected/query01.ans b/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/expected/query01.ans
index 27078841..09bed38a 100644
--- a/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/expected/query01.ans
+++ b/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/expected/query01.ans
@@ -11,6 +11,9 @@
 -- m/,.*line (.*)/
 -- s/,.*line (.*)//g
 --
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
 -- end_matchsubs
 -- sets the bytea output to the expected by the tests
 SET bytea_output='escape';
diff --git a/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/sql/query01.sql b/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/sql/query01.sql
index d8230707..ce2d0c4e 100644
--- a/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/sql/query01.sql
+++ b/automation/sqlrepo/features/general/alter/pxfwritable_import/without_column_projection/sql/query01.sql
@@ -10,6 +10,9 @@
 -- m/,.*line (.*)/
 -- s/,.*line (.*)//g
 --
+-- m/ALTER/
+-- s/ALTER EXTERNAL TABLE/ALTER FOREIGN TABLE/g
+--
 -- end_matchsubs
 
 -- sets the bytea output to the expected by the tests


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 15/37: Fixing Table/DB encoding comparison for GP7

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 240a95c25c2f87aa3c1fe65e4132a02b64c15813
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Fri Sep 30 14:45:15 2022 -0700

    Fixing Table/DB encoding comparison for GP7
---
 external-table/src/gpdbwritableformatter.c | 57 ++++++++++++++++++++++++------
 1 file changed, 47 insertions(+), 10 deletions(-)

diff --git a/external-table/src/gpdbwritableformatter.c b/external-table/src/gpdbwritableformatter.c
index 79dd35eb..fc08cd24 100644
--- a/external-table/src/gpdbwritableformatter.c
+++ b/external-table/src/gpdbwritableformatter.c
@@ -512,11 +512,30 @@ gpdbwritableformatter_export(PG_FUNCTION_ARGS)
 	 */
 	if (myData == NULL)
 	{
-		if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
-		{
-		     ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-		            errmsg(FORMATTER_ENCODING_ERR_MSG, "export")));
-		}
+        // In GP7 FORMATTER_GET_EXTENCODING(fcinfo) gets the database encoding which may not match the table encoding
+        // and thus results in exception here. So getting the table encoding from the ExtTableEntry
+#if PG_VERSION_NUM < 120000
+        if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
+        {
+                 ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                            errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
+        }
+#else
+        Relation rel = FORMATTER_GET_RELATION(fcinfo);
+        if(rel != NULL)
+        {
+            ExtTableEntry *exttbl = GetExtTableEntry(rel->rd_id);
+            if (exttbl->encoding != PG_UTF8) {
+                ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                        errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
+            }
+        }
+        // TODO: If for some reason the Relation is null here, then shall we throw an error anyways ??
+        else{
+            ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                    errmsg("gpdbwritable formatter can only export UTF8 formatted data. Define the external table with ENCODING UTF8")));
+        }
+#endif
 
 		myData = palloc(sizeof(format_t));
 		myData->values = palloc(sizeof(Datum) * ncolumns);
@@ -769,11 +788,29 @@ gpdbwritableformatter_import(PG_FUNCTION_ARGS)
 	 */
 	if (myData == NULL)
 	{
-		if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
-		{
-			ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
-							errmsg(FORMATTER_ENCODING_ERR_MSG, "import")));
-		}
+        // In GP7 FORMATTER_GET_EXTENCODING(fcinfo) gets the database encoding which may not match the table encoding
+        // and thus results in exception here. So getting the table encoding from the ExtTableEntry
+#if PG_VERSION_NUM < 120000
+            if (FORMATTER_GET_EXTENCODING(fcinfo) != PG_UTF8)
+            {
+                     ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                                errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
+            }
+#else
+        Relation rel = FORMATTER_GET_RELATION(fcinfo);
+        if(rel != NULL) {
+            ExtTableEntry *exttbl = GetExtTableEntry(rel->rd_id);
+            if (exttbl->encoding != PG_UTF8) {
+                ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                        errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
+            }
+        }
+        // TODO: If for some reason the Relation is null here, then shall we throw an error anyways ??
+        else{
+            ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION),
+                    errmsg("gpdbwritable formatter can only import UTF8 formatted data. Define the external table with ENCODING UTF8")));
+        }
+#endif
 
 		myData = palloc(sizeof(format_t));
 		myData->values = palloc(sizeof(Datum) * ncolumns);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 36/37: Fix stack overflow in add_projection_desc_httpheader_pg12

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 8839ece689f91d39d7aedc09bf1f5ad5ead80ce2
Author: WANG Weinan <wa...@hashdata.cn>
AuthorDate: Tue Jun 24 18:36:44 2025 +0800

    Fix stack overflow in add_projection_desc_httpheader_pg12
---
 external-table/src/pxfheaders.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 583384a3..9ddbbbbe 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -651,6 +651,23 @@ add_projection_desc_httpheader_pg94(CHURL_HEADERS headers,
  */
 
 #if PG_VERSION_NUM >= 120000
+static void
+set_var_number(int **varNumbers, int *varNumberSize, int value, int offset)
+{
+	if (*varNumberSize == 0)
+	{
+		*varNumberSize = Max(32, offset * 2);
+		*varNumbers = (int *) palloc0(sizeof(int) * (*varNumberSize));
+	}
+	else if (*varNumberSize <= offset)
+	{
+		*varNumberSize = Max(*varNumberSize * 2, offset * 2);
+		*varNumbers = (int *) repalloc(*varNumbers, sizeof(int) * (*varNumberSize));
+	}
+
+	*varNumbers[offset] = value;
+}
+
 static void
 add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
                  ProjectionInfo *projInfo,
@@ -665,7 +682,9 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
     // In versions < 120000, projInfo->pi_varNumbers contains atttribute numbers of SimpleVars
     // Since,this pi_varNumbers doesn't exist in PG12 and above, we can add the attribute numbers by
     // iterating on the Simple vars.
-  int       varNumbers[sizeof(int32) * 8];
+  
+  int       varNumbersSize = 0;
+  int       *varNumbers = NULL;
   Bitmapset   *attrs_used;
   StringInfoData  formatter;
   TupleDesc   tupdesc;
@@ -717,8 +736,8 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
         add_projection_index_header(headers,
                       formatter, attno - 1, long_number);
         numTargetList++;
-                varNumbers[i] = attno;
-                i++;
+		set_var_number(&varNumbers, &varNumbersSize, attno, i);
+		i++;
       }
     }
 
@@ -776,6 +795,9 @@ add_projection_desc_httpheader_pg12(CHURL_HEADERS headers,
     }
   }
 
+  if (varNumbers)
+  	pfree(varNumbers);
+
   list_free(qualsAttributes);
   pfree(formatter.data);
   bms_free(attrs_used);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 27/37: install Java 8 JDK in gp7 centos7 docker image (#862)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 5410b7b7b75774a2f416ebf1cdeda9656b7e79bf
Author: Alexander Denissov <de...@users.noreply.github.com>
AuthorDate: Tue Sep 6 15:00:31 2022 -0700

    install Java 8 JDK in gp7 centos7 docker image (#862)
---
 concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile b/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
index 628f0d97..7d7b404c 100644
--- a/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
+++ b/concourse/docker/pxf-dev-base/gpdb7/centos7/Dockerfile
@@ -32,7 +32,7 @@ RUN curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERS
     && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
     && rm -f /tmp/apache-maven.tar.gz \
     && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
-    && yum install -y rpm-build python-devel jq sudo java-1.8.0-openjdk java-11-openjdk-devel && yum clean all \
+    && yum install -y rpm-build python-devel jq sudo java-1.8.0-openjdk-devel java-11-openjdk-devel && yum clean all \
     && cd /tmp && /usr/bin/pip install --upgrade pip==20.3.3 \
     && /usr/bin/pip install paramiko --no-cache-dir
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 22/37: Bump Spring Boot's built-in Tomcat to 9.0.72

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 4cf46962217c21e93f6340f99dd6d5523d38091b
Author: Terry Ning <ni...@hashdata.cn>
AuthorDate: Thu May 25 20:02:25 2023 +0800

    Bump Spring Boot's built-in Tomcat to 9.0.72
    
    This PR is used to bump the Tomcat built in Spring Boot from 9.0.60
    to 9.0.72 because of the security issue CVE-2023-28708.
    
    Authored-by: Terry Ning <ni...@hashdata.cn>
---
 server/build.gradle | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/build.gradle b/server/build.gradle
index 2116ef81..518aa7a4 100644
--- a/server/build.gradle
+++ b/server/build.gradle
@@ -112,6 +112,10 @@ configure(javaProjects) {
             // revert once springboot provided postgresql is upgraded to bundle postgresql:42.7.2+
             dependency("org.postgresql:postgresql:42.7.2")
 
+            dependency("org.apache.tomcat.embed:tomcat-embed-core:9.0.72")
+            dependency("org.apache.tomcat.embed:tomcat-embed-el:9.0.72")
+            dependency("org.apache.tomcat.embed:tomcat-embed-websocket:9.0.72")
+
             dependency("org.simplify4u:slf4j-mock:2.3.0")
             dependency("org.threeten:threeten-extra:1.5.0")
             dependency("org.tukaani:xz:1.8")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 08/37: Fix code for GP7 and GP6 API diff

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit ae79dd65dfdcc6abfe45ebb76e3e38a3a6833dfd
Author: Himanshu Pandey <pa...@vmware.com>
AuthorDate: Fri Sep 16 15:21:33 2022 -0700

    Fix code for GP7 and GP6 API diff
---
 external-table/src/pxfheaders.c | 88 ++++++++++++++++++++++++++++++++---------
 1 file changed, 69 insertions(+), 19 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 7ed01d2f..a1969299 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -274,7 +274,7 @@ add_tuple_desc_httpheader(CHURL_HEADERS headers, Relation rel)
 		#if PG_VERSION_NUM >= 120000
 			Form_pg_attribute attribute = &tuple->attrs[i];
 		#else
-			Form_pg_attribute attribute = tuple->attrs[i];
+			FormData_pg_attribute *attribute = tuple->attrs[i];
 		#endif
 
 		/* Ignore dropped attributes. */
@@ -501,25 +501,51 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 							   Relation rel)
 {
 	int			   i;
-	int			   droppedCount;  // count of dropped attributes
-	int			   headerCount;   // count of created http headers
-	char		   long_number[sizeof(int32) * 8];
-	int			   numSimpleVars; // number of pre-computed simple vars
-	int			   *varNumbers;   // pre-computed array of simple var attrnos
+	int			   dropped_count;
+	int			   number;
+	int			   numTargetList;
+#if PG_VERSION_NUM < 90400
+	int			   numSimpleVars;
+#endif
+	char			long_number[sizeof(int32) * 8];
+	/* FIXME: to get it to compile assign it to NULL */
+	// pi_varNumbers is not available anymore in the postgters code
+	// https://doxygen.postgresql.org/structProjectionInfo.html
+	//int				*varNumbers = projInfo->pi_varNumbers;
+#if PG_VERSION_NUM < 120000
+    int				*varNumbers = projInfo->pi_varNumbers;
+    List *targetList = projInfo->pi_targetlist;
+#else
+	int				*varNumbers = NULL; //TODO Need to find a proper value here
+	List *targetList = (List *)projInfo->pi_state.resultslot;
+#endif
 
-	Bitmapset	   *attrs_used;   // hashset to keep and de-dup collected attrnos
+	Bitmapset		*attrs_used;
 	StringInfoData	formatter;
 	List		   *targetList;   // targetList from the query plan
 	TupleDesc	   tupdesc;
 
 	// STEP 0: initialize variables
 	initStringInfo(&formatter);
-	attrs_used = NULL;
-	targetList = getTargetList(projInfo);
-	varNumbers = getVarNumbers(projInfo);
+	numTargetList = 0;
+#if PG_VERSION_NUM >= 90400
+	/*
+	 * Non-simpleVars are added to the targetlist
+	 * we use expression_tree_walker to access attrno information
+	 * we do it through a helper function add_attnums_from_targetList
+	 */
+	/* FIXME: commenting this out for compilation success */
+	// pi_targetlist is not available anymore in the postgters code
+	// https://doxygen.postgresql.org/structProjectionInfo.html
+	//if (projInfo->pi_targetlist)
+
+	if (targetList)
+	{
+#else
+	numSimpleVars = 0;
 
-	// STEP 1: collect attribute numbers (attrno) from the targetList, if necessary
-	if (needToIterateTargetList(targetList, varNumbers)) {
+	if (!varNumbers)
+	{
 		/*
 		 * we use expression_tree_walker to access attrno information
 		 * we do it through a helper function add_attnums_from_targetList
@@ -527,12 +553,14 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 		List     *l = lappend_int(NIL, 0);
 		ListCell *lc1;
 
+		/* FIXME: commenting this out to make it compile */
+#if PG_VERSION_NUM < 120000
 		foreach(lc1, targetList)
 		{
-			Node *node = getTargetListEntryExpression(lc1);
-			add_attnums_from_targetList(node, l);
+			GenericExprState *gstate = (GenericExprState *) lfirst(lc1);
+			add_attnums_from_targetList((Node *) gstate->arg->expr, l);
 		}
-
+#endif
 		foreach(lc1, l)
 		{
 			int attno = lfirst_int(lc1);
@@ -547,8 +575,30 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 		list_free(l);
 	}
 
-	// STEP 2: collect attribute numbers from pre-computed list of varNumbers (if available) of simpleVars
-	numSimpleVars = getNumSimpleVars(projInfo);
+	number = numTargetList +
+#if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
+		// FIXME: Commenting this out for compilation success
+		// pi_numSimpleVars is not available anymore in the postgters 12 code
+		// https://doxygen.postgresql.org/structProjectionInfo.html
+		projInfo->pi_numSimpleVars +
+#else
+		numSimpleVars +
+#endif
+		list_length(qualsAttributes);
+	if (number == 0)
+		return;
+
+	attrs_used = NULL;
+
+	/* Convert the number of projection columns to a string */
+	pg_ltoa(number, long_number);
+	churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
+
+#if PG_VERSION_NUM >=90400
+	/* FIXME: commenting out to get compile to work */
+	//for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+	for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+#else
 	for (i = 0; varNumbers && i < numSimpleVars; i++)
 	{
 		attrs_used =
@@ -574,9 +624,9 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
 	for (i = 1; i <= tupdesc->natts; i++)
 	{
         #if PG_VERSION_NUM >= 120000
-            Form_pg_attribute attr = &tupdesc->attrs[i];
+            Form_pg_attribute attr = &tupdesc->attrs[i-1];
         #else
-            Form_pg_attribute attr = tupdesc->attrs[i];
+            FormData_pg_attribute *attr = tupdesc->attrs[i-1];
         #endif
 		/* Ignore dropped attributes. */
 		if (attr->attisdropped)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 32/37: docs - command block formatting fix (#866)

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit e021d6ff86ee02ad1d15c06709e0af60c4d05f69
Author: Lisa Owen <lo...@pivotal.io>
AuthorDate: Wed Sep 14 17:14:39 2022 -0600

    docs - command block formatting fix (#866)
---
 docs/content/hdfs_orc.html.md.erb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs/content/hdfs_orc.html.md.erb b/docs/content/hdfs_orc.html.md.erb
index 415cd292..f429ee2b 100644
--- a/docs/content/hdfs_orc.html.md.erb
+++ b/docs/content/hdfs_orc.html.md.erb
@@ -198,8 +198,7 @@ Procedure:
     {"location": "Rome", "month": "Mar","num_orders": 87, "total_sales": 1557.39, "items_sold": ["coats"]}
     {"location": "Bangalore", "month": "May","num_orders": 317, "total_sales": 8936.99, "items_sold": ["winter socks", "long-sleeved shirts", "boots"]}
     {"location": "Beijing", "month": "Jul","num_orders": 411, "total_sales": 11600.67, "items_sold": ["hoodies/sweaters", "pants"]}
-    {"location": "Los Angeles", "month": "Dec","num_orders": 0, "total_sales": 0.00, "items_sold": null}
-' > /tmp/sampledata.json
+    {"location": "Los Angeles", "month": "Dec","num_orders": 0, "total_sales": 0.00, "items_sold": null}' > /tmp/sampledata.json
     ```
 
 1. [Download](https://repo1.maven.org/maven2/org/apache/orc/orc-tools) the most recent version of the `orc-tools` JAR to the current working directory.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


(cloudberry-pxf) 37/37: Modify operator precedence.

Posted by dj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit a43e9e2bf78459be57e812aff99ac07283927b63
Author: Max Yang <ya...@hashdata.cn>
AuthorDate: Tue Jun 24 21:09:38 2025 +0800

    Modify operator precedence.
---
 external-table/src/pxfheaders.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index 9ddbbbbe..203c6a79 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -665,7 +665,7 @@ set_var_number(int **varNumbers, int *varNumberSize, int value, int offset)
 		*varNumbers = (int *) repalloc(*varNumbers, sizeof(int) * (*varNumberSize));
 	}
 
-	*varNumbers[offset] = value;
+	(*varNumbers)[offset] = value;
 }
 
 static void


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org