databend
databend copied to clipboard
show external location table miss the path option
Summary
Create external location table:
CREATE CONNECTION test
STORAGE_TYPE = 's3'
SECRET_ACCESS_KEY = '<your-secret-access-key>'
ACCESS_KEY_ID = '<your-access-key-id>';
CREATE TABLE t1(id int) 's3://xx/yy/zz' CONNECTION=(CONNECTION_NAME='test');
show create table t1;
---
CREATE TABLE t1 (
id INT NULL
) ENGINE = FUSE
COMPRESSION = 'zstd'
STORAGE_FORMAT = 'parquet';
Expect:
CREATE TABLE t1 (
id INT NULL
) ENGINE = FUSE
COMPRESSION = 'zstd'
STORAGE_FORMAT = 'parquet'
's3://xx/yy/zz'
CONNECTION = (
CONNECTION_NAME = 'test'
);
Not sure can we do this? @youngsofun
CONNECTION
itself is not stored, it is translated to StorageParams
when create fuse table.
To achieve this effect, need to either
- able to restore CONNECTION from StorageParams
- store CONNECTION in table meta, solely for use of
show create table
.
more over, it show create table
shows CONNECTION_NAME = 'test'
, the connection should ref to the connection object even after table creation, and resolve each time of read.
Thank you for the clarification. I will now close this issue.
Another question, can we show the external localtion table as:
CREATE TABLE t1 (
id INT NULL
) ENGINE = FUSE
COMPRESSION = 'zstd'
STORAGE_FORMAT = 'parquet'
's3://xx/yy/zz' -- show this option
to know a table is external location or a normal table.
Now, we don't konw a table is external location or not, because it show create table
is:
show create table t1;
---
CREATE TABLE t1 (
id INT NULL
) ENGINE = FUSE
COMPRESSION = 'zstd'
STORAGE_FORMAT = 'parquet';
cc @ariesdevil
The endpoint_url
is also part of StorageParams