Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1119cf9
Extending gpfdist in Cloudberry Database to Support SFTP Protocol for…
Jul 12, 2025
23f372b
Feature: Add SFTP support to gpfdist for data ingestion
Jul 18, 2025
536a830
Feature: Add SFTP support to gpfdist for data
Jul 19, 2025
080908d
Feature: Add SFTP support to gpfdist for data
Jul 21, 2025
ecf10ac
Add SFTP support to gpfdist for data loading
Jul 26, 2025
3193c63
Add SFTP support to gpfdist for data ingestion
Jul 26, 2025
81649bd
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
18f20c9
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
d7c262f
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
7aff224
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
edb93c2
Add SFTP support to gpfdist for data ingestion
Aug 19, 2025
bcddd0b
Extending gpfdist in Cloudberry Database to Support SFTP Protocol for…
Jul 12, 2025
2c4cc59
Feature: Add SFTP support to gpfdist for data ingestion
Jul 18, 2025
b0bda87
Feature: Add SFTP support to gpfdist for data
Jul 19, 2025
976cc15
Feature: Add SFTP support to gpfdist for data
Jul 21, 2025
b283297
Add SFTP support to gpfdist for data loading
Jul 26, 2025
6d2f45c
Add SFTP support to gpfdist for data ingestion
Jul 26, 2025
47fabe8
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
14e20c1
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
bed2bee
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
2aad679
Add SFTP support to gpfdist for data ingestion
Aug 18, 2025
ae5ee92
Add SFTP support to gpfdist for data ingestion
Aug 19, 2025
da02369
Merge branch 'main' into temp_cloudberry
tuhaihe Oct 14, 2025
97bfa7c
Merge branch 'main' of https://github.com/ZTE-EBASE/cloudberry into t…
Oct 16, 2025
ef0466d
Add libssh2-devel package for gpfdist SFTP
Oct 16, 2025
09ea01d
Merge branch 'temp_cloudberry' of https://github.com/ZTE-EBASE/cloudb…
Oct 16, 2025
5fc0571
Merge branch 'main' of https://github.com/ZTE-EBASE/cloudberry into t…
Oct 17, 2025
8f4673a
Feature: Add SFTP support to gpfdist for data
Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,8 @@ enable_faultinjector
enable_debug_extensions
enable_pxf
enable_gpfdist
LIBSSH2_LIBS
LIBSSH2_CFLAGS
enable_strong_random
enable_rpath
default_port
Expand Down Expand Up @@ -975,6 +977,8 @@ XML2_CFLAGS
XML2_LIBS
LZ4_CFLAGS
LZ4_LIBS
LIBSSH2_LIBS
LIBSSH2_CFLAGS
LDFLAGS_EX
LDFLAGS_SL
PERL
Expand Down Expand Up @@ -1734,6 +1738,10 @@ Some influential environment variables:
XML2_LIBS linker flags for XML2, overriding pkg-config
LZ4_CFLAGS C compiler flags for LZ4, overriding pkg-config
LZ4_LIBS linker flags for LZ4, overriding pkg-config
LIBSSH2_CFLAGS
C compiler flags for LIBSSH2, overriding pkg-config
LIBSSH2_LIBS
linker flags for LIBSSH2, overriding pkg-config
LDFLAGS_EX extra linker flags for linking executables only
LDFLAGS_SL extra linker flags for linking shared libraries only
PERL Perl program
Expand Down Expand Up @@ -15154,6 +15162,89 @@ fi
LIBS="$_LIBS"
fi

#
# LIBSSH2
#
#
if test "$enable_gpfdist" = yes; then
# Check libssh2 >= 1.0.0

pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2 >= 1.0.0" >&5
$as_echo_n "checking for libssh2 >= 1.0.0... " >&6; }

if test -n "$LIBSSH2_CFLAGS"; then
pkg_cv_LIBSSH2_CFLAGS="$LIBSSH2_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssh2 >= 1.0.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libssh2 >= 1.0.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSSH2_CFLAGS=`$PKG_CONFIG --cflags "libssh2 >= 1.1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBSSH2_LIBS"; then
pkg_cv_LIBSSH2_LIBS="$LIBSSH2_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssh2 >= 1.0.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libssh2 >= 1.0.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSSH2_LIBS=`$PKG_CONFIG --libs "libssh2 >= 1.0.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi



if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBSSH2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libssh2 >= 1.0.0" 2>&1`
else
LIBSSH2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libssh2 >= 1.0.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBSSH2_PKG_ERRORS" >&5

as_fn_error $? "libssh2 >= 1.0.0 is required for gpfdist support" "$LINENO" 5

elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
as_fn_error $? "libssh2 >= 1.0.0 is required for gpfdist support" "$LINENO" 5

else
LIBSSH2_CFLAGS=$pkg_cv_LIBSSH2_CFLAGS
LIBSSH2_LIBS=$pkg_cv_LIBSSH2_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }

$as_echo "#define LIBSSH2 1" >>confdefs.h

fi


#
# SSL Library
#
Expand Down
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ PGAC_ARG_BOOL(enable, gpfdist, yes,
[do not use gpfdist])
AC_SUBST(enable_gpfdist)

if test "$enable_gpfdist" = yes; then
# Check libssh2 >= 1.0.0
PKG_CHECK_MODULES([LIBSSH2], [libssh2 >= 1.0.0],
[AC_DEFINE([LIBSSH2], [1], [Define if libssh2 is available])],
[AC_MSG_ERROR([libssh2 >= 1.0.0 is required for gpfdist support])]
Copy link
Member

Choose a reason for hiding this comment

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

PKG_CHECK_MODULES([LIBSSH2], [libssh2 >= 1.0.0],
  [AC_DEFINE([LIBSSH2], [1], [Define if libssh2 is available])],
  [AC_MSG_WARN([libssh2 >= 1.0.0 not found, gpfdist will build without libssh2 support])]
)

If libssh2 is not found, only a warning is issued (AC_MSG_WARN), the macro is not defined, and the configure process does not fail.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, I'll make the changes. Thank you!

)
AC_MSG_RESULT([checking whether to build with gpfdist support ... yes])
fi

#
# pxf
#
Expand Down Expand Up @@ -1652,6 +1661,10 @@ if test "$enable_gpfdist" = yes ; then
EVENT_LIBS=" -levent"
AC_SUBST(EVENT_LIBS)

AC_SEARCH_LIBS(libssh2_init, [libssh2], [have_libssh2=yes; LIBSSH2_LIBS=" -lssh2"], [AC_MSG_ERROR([libssh2 is required for gpfdist])])
AC_SUBST(LIBSSH2_LIBS)
AC_SUBST(have_libssh2)

AC_SEARCH_LIBS(yaml_parser_initialize, [yaml], [have_yaml=yes; YAML_LIBS=" -lyaml"], [AC_MSG_WARN([libyaml is not found. disabling transformations for gpfdist.])])
AC_SUBST(YAML_LIBS)
AC_SUBST(have_yaml)
Expand Down Expand Up @@ -1950,6 +1963,7 @@ if test "$enable_gpfdist" = yes; then

AC_CHECK_HEADERS(yaml.h, [], [AC_MSG_WARN([header file <yaml.h> is not found. disabling transformations for gpfdist.])])
AC_CHECK_HEADERS(event.h, [], [AC_MSG_ERROR([header file <event.h> is required for gpfdist])])
AC_CHECK_HEADERS(libssh2, [], [AC_MSG_ERROR([header file <libssh2.h> is required for gpfdist])])

ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$apr_includes $CPPFLAGS"
Expand Down
1 change: 1 addition & 0 deletions src/backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ LIBS := $(filter-out -lreadline -ledit -ltermcap -lncurses -lcurses, $(LIBS))

# Cloudberry uses threads in the backend
LIBS := $(LIBS) -lpthread
LIBS := $(LIBS) -lssh2

ifeq ($(with_systemd),yes)
LIBS += -lsystemd
Expand Down
4 changes: 3 additions & 1 deletion src/backend/utils/misc/fstream/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ subdir = src/backend/utils/misc/fstream
top_builddir = ../../../../..
include $(top_builddir)/src/Makefile.global

override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
LDFLAGS += -lssh2

override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) $(CPPFLAGS)

OBJS = fstream.o gfile.o

Expand Down
Loading
Loading