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.25.1.tar.gz
(104.1 kB
view details)
Built Distribution
File details
Details for the file ibis_substrait-2.25.1.tar.gz
.
File metadata
- Download URL: ibis_substrait-2.25.1.tar.gz
- Upload date:
- Size: 104.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.10 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfe51b61b334fd1aee1ad66c8b6dbf82b074b700488accbabf6d5c7c063970bb |
|
MD5 | e008099ac12f96c17e2a73a0c4d226cc |
|
BLAKE2b-256 | e8c18cf9bd2ebe4f944c55b0e9849d1d6c1765362be6013d246b023ce13ec6b8 |
File details
Details for the file ibis_substrait-2.25.1-cp310-cp310-manylinux_2_35_x86_64.whl
.
File metadata
- Download URL: ibis_substrait-2.25.1-cp310-cp310-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 123.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.10 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b45b91cec6fbbdda77412d3c348dc6b91441d9572f8736f9001b75e21e14358 |
|
MD5 | 72728d9c507c919af74ba5e37e56ffaa |
|
BLAKE2b-256 | 875eba78196ea4ba45c2376a8ac2f70f0e8b8f8f9d34f5ecfd6beb5a4585432c |