robertmu opened a new issue, #1385:
URL: https://github.com/apache/cloudberry/issues/1385
When creating an external table using `CREATE EXTERNAL TABLE ... EXECUTE
'...'`, if the specified command in the `EXECUTE` clause does not exist,
Cloudberry returns 0 rows when the table is queried, without reporting any
error. This behavior is inconsistent with Greenplum Database 7, which reports a
clear error in the same scenario.
The silent failure in Cloudberry can be misleading for users, as it's
impossible to distinguish between a command that successfully executed with no
output and a command that failed to execute. The expected behavior is to
propagate the error from the OS, informing the user that the command was not
found.
```
cbdb@robertmu-VirtualBox:~$ psql
psql (14.4, server 14.4)
Type "help" for help.
cbdb=# CREATE EXTERNAL WEB TEMP TABLE test_program_exist(content text)
EXECUTE 'seq 1 5' ON MASTER FORMAT 'TEXT';
CREATE EXTERNAL TABLE
cbdb=# select * from test_program_exist;
content
---------
1
2
3
4
5
(5 rows)
cbdb=# CREATE EXTERNAL WEB TEMP TABLE test_program_not_exist(content text)
EXECUTE '/xx/seq 1 5' ON MASTER FORMAT 'TEXT';
CREATE EXTERNAL TABLE
cbdb=# select * from test_program_not_exist;
content
---------
(0 rows)
cbdb=# select version();
version
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 14.4 (Apache Cloudberry 2.0.0-incubating-rc3 build dev) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0,
64-bit compiled on Aug 26 2025 10:53:40
(1 row)
cbdb=#
```
```
gpdb7@robertmu-VirtualBox:~$ psql
psql (12.12)
Type "help" for help.
gpdb7=# CREATE EXTERNAL WEB TEMP TABLE test_program_exist(content text)
EXECUTE 'seq 1 5' ON MASTER FORMAT 'TEXT';
CREATE EXTERNAL TABLE
gpdb7=# select * from test_program_exist;
content
---------
1
2
3
4
5
(5 rows)
gpdb7=# CREATE EXTERNAL WEB TEMP TABLE test_program_not_exist(content text)
EXECUTE '/xx/seq 1 5' ON MASTER FORMAT 'TEXT';
CREATE EXTERNAL TABLE
gpdb7=# select * from test_program_not_exist;
ERROR: external table test_program_not_exist command ended with error. sh:
/xx/seq: No such file or directory
DETAIL: Command: execute:/xx/seq 1 5
gpdb7=#
gpdb7=# select version();
version
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 12.12 (Greenplum Database 7.0.0-beta.0+482967c1b4 build dev) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0,
64-bit compiled on Nov 8 2024 23:43:47 Bhuvnesh C.
(1 row)
gpdb7=#
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]