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] Read from LanceDB #2195

Merged
merged 18 commits into from
May 1, 2024
Merged

[FEAT] Read from LanceDB #2195

merged 18 commits into from
May 1, 2024

Conversation

jaychia
Copy link
Contributor

@jaychia jaychia commented Apr 29, 2024

Adds the ability to read a Lance dataset: https://lancedb.github.io/lance/read_and_write.html

@github-actions github-actions bot added the enhancement New feature or request label Apr 29, 2024
@jaychia jaychia changed the title [FEAT] Raed from LanceDB [FEAT] Read from LanceDB Apr 29, 2024
@@ -165,68 +159,3 @@ def can_absorb_limit(self) -> bool:

def can_absorb_select(self) -> bool:
return True


def _storage_config_to_storage_options(storage_config: StorageConfig, table_uri: str) -> dict[str, str] | None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I realized that this stuff is shared between Python libraries that leverage the object_store crate, so I pulled it out to a shared utility that is now used for both DeltaLake and Lance

return [
Table.from_arrow_record_batches([rb], rb.schema)._table
for rb in fragment.to_batches(columns=required_columns)
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted to return a list of Tables, instead of creating one Table for all the record batches to avoid concatenation costs. I think this is fine?

Copy link
Member

Choose a reason for hiding this comment

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

commented on this below, you should instead return an Iterator[Tables] so we can terminate early but also have the ability to skip the concat.

src/daft-scan/src/lib.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 18 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@ce7cec5). Click here to learn what that means.
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2195   +/-   ##
=======================================
  Coverage        ?   85.42%           
=======================================
  Files           ?       71           
  Lines           ?     7514           
  Branches        ?        0           
=======================================
  Hits            ?     6419           
  Misses          ?     1095           
  Partials        ?        0           
Files Coverage Δ
daft/__init__.py 24.24% <ø> (ø)
daft/delta_lake/delta_lake_scan.py 95.34% <100.00%> (ø)
daft/io/__init__.py 95.83% <100.00%> (ø)
daft/io/_lance.py 92.85% <92.85%> (ø)
daft/io/object_store_options.py 69.56% <69.56%> (ø)

daft/io/_lance.py Outdated Show resolved Hide resolved
daft/io/_lance.py Show resolved Hide resolved
src/daft-micropartition/src/micropartition.rs Outdated Show resolved Hide resolved
src/daft-micropartition/src/micropartition.rs Outdated Show resolved Hide resolved
daft/io/_lance.py Outdated Show resolved Hide resolved
src/daft-scan/src/lib.rs Outdated Show resolved Hide resolved
src/daft-scan/src/lib.rs Outdated Show resolved Hide resolved
src/daft-scan/src/python.rs Outdated Show resolved Hide resolved
daft/__init__.py Show resolved Hide resolved
@samster25 samster25 merged commit c4928f8 into main May 1, 2024
29 checks passed
@samster25 samster25 deleted the jay/lance branch May 1, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants