Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show external location table miss the path option #14714

Closed
BohuTANG opened this issue Feb 22, 2024 · 5 comments
Closed

show external location table miss the path option #14714

BohuTANG opened this issue Feb 22, 2024 · 5 comments
Labels
C-feature Category: feature

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Feb 22, 2024

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'
);

@BohuTANG BohuTANG added the C-feature Category: feature label Feb 22, 2024
@BohuTANG
Copy link
Member Author

BohuTANG commented Feb 22, 2024

Not sure can we do this? @youngsofun

@youngsofun
Copy link
Member

CONNECTION itself is not stored, it is translated to StorageParams when create fuse table.

To achieve this effect, need to either

  1. able to restore CONNECTION from StorageParams
  2. 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.

@BohuTANG
Copy link
Member Author

Thank you for the clarification. I will now close this issue.

@BohuTANG
Copy link
Member Author

BohuTANG commented Feb 28, 2024

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

@ariesdevil
Copy link
Collaborator

The endpoint_url is also part of StorageParams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature
Projects
None yet
Development

No branches or pull requests

3 participants