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

support file filter on external table #5345

Open
ftong2020 opened this issue Jan 12, 2025 · 1 comment
Open

support file filter on external table #5345

ftong2020 opened this issue Jan 12, 2025 · 1 comment
Labels
C-enhancement Category Enhancements

Comments

@ftong2020
Copy link

What type of enhancement is this?

User experience

What does the enhancement do?

When using greptimedb external table, user can use a path to include multiple files. On MacOS, OS itself will add .DS_Store file to the folder when it is indexed. Then, external table will complain invalid file format because .DS_Store is also included.

It will be very handy if external table can support glob filters or at least some form of wildcard matching.

Implementation challenges

No response

@ftong2020 ftong2020 added the C-enhancement Category Enhancements label Jan 12, 2025
@WenyXu
Copy link
Member

WenyXu commented Jan 13, 2025

Hi @ftong2020,
We support the pattern option when creating an external table. Here's an example:

CREATE EXTERNAL TABLE city (
            host string,
            ts timestamp,
            cpu float64 default 0,
            memory float64,
            TIME INDEX (ts),
            PRIMARY KEY(host)
) WITH (location='/var/data/', format='parquet', pattern='*.parquet');

For more details:
https://docs.greptime.com/reference/sql/create/#create-external-table

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

No branches or pull requests

2 participants