cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

[Bug] Failed to load data with singlenode mode using `insert into ... select ...`

Open zhangyue-hashdata opened this issue 8 months ago • 2 comments

Apache Cloudberry version

No response

What happened

postgres=# CREATE TABLE t1 (c1 int) with (appendonly=true, orientation=column);
CREATE TABLE
postgres=# CREATE EXTERNAL TABLE ext_t1 (like t1)
postgres-# LOCATION ('file://hashdata/home/gpadmin/data/data/tpcds10s/t1.dat')
postgres-# FORMAT 'TEXT' (DELIMITER '|' NULL AS '' ESCAPE AS E'\\');
CREATE EXTERNAL TABLE
postgres=# insert into t1 select * from ext_t1;
ERROR:  'ON COORDINATOR' is not supported by this protocol yet

What you think should happen instead

No response

How to reproduce

postgres=# CREATE TABLE t1 (c1 int) with (appendonly=true, orientation=column);
CREATE TABLE
postgres=# CREATE EXTERNAL TABLE ext_t1 (like t1)
postgres-# LOCATION ('file://hashdata/home/gpadmin/data/data/tpcds10s/t1.dat')
postgres-# FORMAT 'TEXT' (DELIMITER '|' NULL AS '' ESCAPE AS E'\\');
CREATE EXTERNAL TABLE
postgres=# insert into t1 select * from ext_t1;
ERROR:  'ON COORDINATOR' is not supported by this protocol yet

Operating System

Linux

Anything else

No response

Are you willing to submit PR?

  • [ ] Yes, I am willing to submit a PR!

Code of Conduct

zhangyue-hashdata avatar Apr 10 '25 11:04 zhangyue-hashdata

Hi, @zhangyue-hashdata welcome!🎊 Thanks for taking the time to point this out.🙌

github-actions[bot] avatar Apr 10 '25 11:04 github-actions[bot]

postgres=# CREATE TABLE t1 (c1 int) with (appendonly=true, orientation=column); CREATE TABLE postgres=# CREATE EXTERNAL TABLE ext_t1 (like t1) postgres-# LOCATION ('file://hashdata/home/gpadmin/data/data/tpcds10s/t1.dat') postgres-# FORMAT 'TEXT' (DELIMITER '|' NULL AS '' ESCAPE AS E'\'); CREATE EXTERNAL TABLE postgres=# insert into t1 select * from ext_t1; ERROR: 'ON COORDINATOR' is not supported by this protocol yet

This is expected.

The file protocol is not supported on the master node. In a single-node deployment, CBDB operates similarly to a single master node.

Recommended Solutions:

  1. Use the COPY command to import files when working on the master node or in single-node mode.
  2. If you must use a protocol, consider implementing a custom protocol instead. Reference: contrib/extprotocol

avamingli avatar May 16 '25 15:05 avamingli