forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 2
Add lakehouse options for create table statements #255
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
Open
Tmonster
wants to merge
173
commits into
main
Choose a base branch
from
add_lakehouse_options_for_create_table_statements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add lakehouse options for create table statements #255
Tmonster
wants to merge
173
commits into
main
from
add_lakehouse_options_for_create_table_statements
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Run all test (including `test_slow`) but skip those that take too long. - Renamed tests from `test` to `test_slow` since they were taking too long for `test`. - Removed some leftover code to enable verification for all tests - we have a config for that now.
* Update ICU to the 2025c time zone data
* Update ICU to the 2025c time zone data
Fixes: duckdblabs/duckdb-internal#6851 Previously we look through every character query (after tokenizing) to look for the semicolon. This caused us to incorrectly split if a semicolon was inside a comment `SELECT 1; -- ; `. Resulting in this case in 2 queries rather than 1. For this query: ```sql create or replace result my_result as from ( select 1 where starts_with('name', 'test_simple_share') -- ; ); ``` Re the tokenization, I don't think the problem lies in the fact that `) -- ;` is returned as a single token (though comments should maybe become something separate), but rather that we were not looking for the `;` token properly in the splitting logic, rather going character by character. Also this logic is already fixed on main, but slightly differently. Perhaps I should reuse that.
…ges to the search path have no effect on it
…his catalog in the candidates always
* Add the RHS bindings when we are doing SEMI or ANTI ASOF joins with a predicate.
* Disallow using arbitrary predicates in AsOf with RIGHT/FULL/SEMI joins.
* Convert the semi-join to an inner join and import the count directly
* Disallow using arbitrary predicates in AsOf with ANTI joins.
* Convert the semi-join to an inner join and import the count directly
* Disallow using arbitrary predicates in AsOf with RIGHT/FULL/SEMI joins.
* Remove the predicate test and relocation (join predicate push-down will take care of it) * Update test plans and add correctness tests for new cases.
* Enforce ordering in test
Follow-up to duckdb#20348. Related issue: duckdblabs/duckdb-internal#7002
* Remove the predicate test and relocation (join predicate push-down will take care of it) * Update test plans and add correctness tests for new cases.
Bumped while building duckdb-wasm, I would expect other clients or packagers of duckdb might also hit this, and fix is simple.
e046f3e to
4d2da25
Compare
4d2da25 to
5b3a60c
Compare
… and sorted by are used. Remove lakehouse working
… and sorted by are used. Remove lakehouse working
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/duckdblabs/duckdb-internal/issues/6589
Fixes https://github.com/duckdblabs/duckdb-internal/issues/6590
Feature
This PR is to introduce lakehouse syntax to the DuckDB create table statement. Specifically for Iceberg, it would be nice to include the ability to set table properties, data location, partitioned by and sorted by in the create table statement.
Engines do this in different ways, but I find the SPARK/Athena way cleanest for the following reasons.
Another option was to support a
WITH ()clause an shove all of these new properties in there. I feel like this will lead to confusion as iceberg & ducklake grow and change, and we will eventually move certain key/value pairs out to be more prominent in the create table statement.If any of these table properties are declared when creating a DuckDB table, an error is thrown.
Examples in other engines
Athena
Spark
Flink
Trino
Snowflake
TODO:
I have a PR for Alter Table as well, I did not want to add too much all at once.
Eventually I want to add this to the
Create table as, but I haven't quite found a sql statement that flows when doing this. Some examplesoption 1
AS SELECTcomes after table name (this means you need to know you columns before writing as select)option 2
PARTITIONED BYcomes after the select clause, which will most likely lead to confusion regarding when does the select statement end, and when do the iceberg definitions start?option 3 add a
SETto the create table & create table as statements.For create table
For Create table As
This may be the nicest as it follows cleanly from the alter table statement. It also keeps lakehouse options more recognizable. However, it will deviate from most other syntaxes