Subtrait compiler for ibis
Project description
Ibis + Substrait
This repo houses the Substrait compiler for ibis.
We're just getting started here, so stay tuned!
Usage
>>> import ibis
>>> t = ibis.table(
[("a", "string"), ("b", "float"), ("c", "int32"), ("d", "int64"), ("e", "int64")],
"t",
)
>>> expr = t.group_by(["a", "b"]).aggregate([t.c.sum().name("sum")]).select("b", "sum")
>>> expr
r0 := UnboundTable: t
a string
b float64
c int32
d int64
e int64
r1 := Aggregation[r0]
metrics:
sum: Sum(r0.c)
by:
a: r0.a
b: r0.b
Selection[r1]
selections:
b: r1.b
sum: r1.sum
>>> ibis.show_sql(expr)
SELECT
t0.b,
t0.sum
FROM (
SELECT
t1.a AS a,
t1.b AS b,
SUM(t1.c) AS sum
FROM t AS t1
GROUP BY
t1.a,
t1.b
) AS t0
>>> from ibis_substrait.compiler.core import SubstraitCompiler
>>> compiler = SubstraitCompiler()
>>> proto = compiler.compile(expr)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ibis_substrait-2.29.1.tar.gz
(141.4 kB
view details)
Built Distribution
File details
Details for the file ibis_substrait-2.29.1.tar.gz
.
File metadata
- Download URL: ibis_substrait-2.29.1.tar.gz
- Upload date:
- Size: 141.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.12 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14beca0b04e648543e3aefa132a40f6f6fd8ef370e85d10b969c209e6d8e9e38 |
|
MD5 | d75b55d438b0a2d74998daa71a39234d |
|
BLAKE2b-256 | 8e1ddead3380e9335ad662fa852959cd311cef912e22f78e3377ad492ad736e1 |
File details
Details for the file ibis_substrait-2.29.1-cp310-cp310-manylinux_2_37_x86_64.whl
.
File metadata
- Download URL: ibis_substrait-2.29.1-cp310-cp310-manylinux_2_37_x86_64.whl
- Upload date:
- Size: 173.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.37+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.12 Linux/5.15.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8912120b01211200b259e820f09c6ffdf76933b0923a65b60be574479f21c18c |
|
MD5 | 6b9d4fda21fcdc476f00b15b6feb4023 |
|
BLAKE2b-256 | 40f75bea9d1b83b57ed50916a7c1273cd557ba4d88293e57d780f3b441b5d774 |