Skip to main content

No project description provided

Project description

Deltalake2DB

This is a simple project that uses Metadata from deltalake package to provide methods to read Delta Lake Tables to either Polars or DuckDB with better Protocol Support as the main deltalake package.

Use with Duckdb

Install deltalake2db and duckdb using pip/poetry/whatever you use.

Then you can do like this:

from deltalake2db import get_sql_for_delta

with duckdb.connect() as con:
    dt = DeltaTable("tests/data/faker2")
    sql = get_sql_for_delta(dt, duck_con=con) # get select statement
    print(sql)
    con.execute("create view delta_table as " + sql)

    con.execute("select * from delta_table").fetch_all()

If you'd like to manipulate you can use get_sql_for_delta_expr which returns a SqlGlot Object

Use with Polars

Install deltalake2db and polars using pip/poetry/whatever you use.

dt = DeltaTable("tests/data/faker2")
from deltalake2db import polars_scan_delta
lazy_df = polars_scan_delta(dt)
df = lazy_df.collect()

Protocol Support

  • Column Mapping
  • Almost Data Types, including Structs/Lists, Map yet to be done
  • Test data types, including datetime
  • Deletion Vectors

In case there is an unsupported DeltaLake Feature, this will just throw DeltaProtocolError as does delta-rs

Cloud Support

For now, only az:// Url's for Azure are tested and supported in DuckDB. For polars it's a lot easier, since polars just uses object_store create, so it should just work.

Looking for something different? :)

We also have the following projects around deltalake:

Or projects from other people:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deltalake2db-0.1.6.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

deltalake2db-0.1.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file deltalake2db-0.1.6.tar.gz.

File metadata

  • Download URL: deltalake2db-0.1.6.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for deltalake2db-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7e3d8487e313d46fd5b7b69f7c5801f9e52f3afb65f9fdcba689ab79ec6be8da
MD5 c4a7e3e002b404dc1001a72969fcdee6
BLAKE2b-256 2a8e732194fb41acd4dc991becb9d451688cf29bbb4cc25ca497d7ddf1755225

See more details on using hashes here.

File details

Details for the file deltalake2db-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: deltalake2db-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for deltalake2db-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fc8833ea453e3b4998da94dd398496c9e7a7d00c62d9a17de2a091869540f180
MD5 1d19305244c0e56f16d78f8de0d20122
BLAKE2b-256 3979a3f0e58d2564fa7fa91fff340bd60d1dfbdafe39a54ab32376d5aae78b40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page