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

feat: Add delta_scan function #1345

Merged
merged 4 commits into from
Jul 19, 2023
Merged

feat: Add delta_scan function #1345

merged 4 commits into from
Jul 19, 2023

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented Jul 18, 2023

〉select * from delta_scan('./testdata/delta/table1/') order by a;
+---+-------+
| a | b     |
+---+-------+
| 1 | hello |
| 2 | world |
+---+-------+

Supports querying delta tables from local paths, s3, and gcs. I kept the implementation separate from the other object store functions since constructing the accessor is a bit different for delta. Delta tables also only exist at one path, it doesn't make sense to support passing in more than one url.

Test data uploaded to s3 and gcs as appropriate. Currently the test data for delta consists of a single table made up of two parquet files and 3 json metadata logs.

scsmithr added 2 commits July 18, 2023 16:37
```
〉select * from delta_scan('./testdata/delta/table1/') order by a
〉;
+---+-------+
| a | b     |
+---+-------+
| 1 | hello |
| 2 | world |
+---+-------+
```
Copy link
Contributor

@vrongmeal vrongmeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments. Looks good to 🚀

Comment on lines +17 to +22
# # Relative path
# query IT
# select * from delta_scan('./testdata/delta/table1/') order by a;
# ----
# 1 hello
# 2 world
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not work yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it works outside the slt tests, but for whatever reason, these sorts of relative paths don't seem to be working when running in an slt.

crates/sqlbuiltins/src/functions/delta.rs Outdated Show resolved Hide resolved
crates/sqlbuiltins/src/functions/delta.rs Outdated Show resolved Hide resolved
@scsmithr scsmithr enabled auto-merge (squash) July 19, 2023 13:00
@scsmithr scsmithr merged commit 14c3a77 into main Jul 19, 2023
@scsmithr scsmithr deleted the sean/delta-scan branch July 19, 2023 13:09
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

Successfully merging this pull request may close these issues.

3 participants