Skip to main content

Native polars deltalake reader

Project description

A native deltalake reader built with Pola-rs and Delta-RS crates.

Example

import polars as pl
import polars_deltalake as pldl

df = pl.DataFrame(
    [
        pl.Series("foo", [1, 2, 3], dtype=pl.Int64),
        pl.Series("bar", ['1', '2', '3'], dtype=pl.String),
        pl.Series("datetime", [datetime(2010, 1, 1, 0, 0)]*3, dtype=pl.Datetime(time_unit='us', time_zone=None)),
        pl.Series("datetime_tz", [datetime(2010, 1, 1, 0, 0, tzinfo=timezone.utc)]*3, dtype=pl.Datetime(time_unit='us', time_zone='UTC')),
        pl.Series("date_month", [201001, 201002, 201003], dtype=pl.Int32),
        pl.Series("static_part", ['A', 'A', 'A'], dtype=pl.String),
        pl.Series("list", [['5', 'B'], ['5', 'B'], ['5', 'B']], dtype=pl.List(pl.String)),
    ]
)

df.write_delta("test_table", delta_write_options={"partition_by":["foo"]})

table = pldl.scan_delta("test_table")

table.filter(pl.col("foo") == 1).collect()

shape: (1, 7)
┌─────┬─────────────────────┬─────────────────────┬────────────┬─────────────┬────────────┬─────┐
 bar  datetime             datetime_tz          date_month  static_part  list        foo 
 ---  ---                  ---                  ---         ---          ---         --- 
 str  datetime[μs]         datetime[μs, UTC]    i32         str          list[str]   i64 
╞═════╪═════════════════════╪═════════════════════╪════════════╪═════════════╪════════════╪═════╡
 1    2010-01-01 00:00:00  2010-01-01 00:00:00  201001      A            ["5", "B"]  1   
                           UTC                                                           
└─────┴─────────────────────┴─────────────────────┴────────────┴─────────────┴────────────┴─────┘

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

polars_deltalake-0.2.0.tar.gz (31.4 kB view hashes)

Uploaded Source

Built Distributions

polars_deltalake-0.2.0-cp38-abi3-win_amd64.whl (11.7 MB view hashes)

Uploaded CPython 3.8+ Windows x86-64

polars_deltalake-0.2.0-cp38-abi3-win32.whl (10.5 MB view hashes)

Uploaded CPython 3.8+ Windows x86

polars_deltalake-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.5 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

polars_deltalake-0.2.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (16.0 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ i686

polars_deltalake-0.2.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (14.9 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_deltalake-0.2.0-cp38-abi3-macosx_11_0_arm64.whl (11.7 MB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_deltalake-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl (12.7 MB view hashes)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

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