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

Example of query interception to rewrite a fake table with predicates #4

Open
danthegoodman1 opened this issue Jul 4, 2023 · 1 comment

Comments

@danthegoodman1
Copy link

danthegoodman1 commented Jul 4, 2023

I woul dlike to use fabduckdb to intercept queries to a non-existent table, including predicates, and replace them with a table function.

So a query like:

select *
from icedb
where year >= 2022
and year <= 2023

Could be intercepted in python, and rewritten to be:

select *
from icedb(start_year:=2022, end_year:=2023)

Or even at this extent, it could be rewritten even further to avoid the table macro and go right to something like:

select *
from read_parquet([...], hive_partitioning=1, filename=1)
where ...

Tracked for IceDB here: danthegoodman1/icedb#45

@danthegoodman1
Copy link
Author

I see that subqueries and CTEs aren't currently supported, which will make it hard to fully implement this for IceDB querying

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

No branches or pull requests

1 participant