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-3.0.0.tar.gz
(79.3 kB
view details)
Built Distribution
File details
Details for the file ibis_substrait-3.0.0.tar.gz
.
File metadata
- Download URL: ibis_substrait-3.0.0.tar.gz
- Upload date:
- Size: 79.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb85960dceda6bcd6ed44e177e7b899a5f4214f16b3337f3cf9a4f01114c9841 |
|
MD5 | 8987c9760bf7aaf00a04d387e69841b7 |
|
BLAKE2b-256 | 8864f59b2f7a4e2cab4724abd343389ab602c2b5beb76630b591dc7c6c7ca244 |
File details
Details for the file ibis_substrait-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: ibis_substrait-3.0.0-py3-none-any.whl
- Upload date:
- Size: 98.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.0 CPython/3.10.12 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08518b6f39e79fd1b952d83feba03bf0c4859ad1cb35d87cab7675bc096c5ea6 |
|
MD5 | 62ce0738eaafb1c5d32be07cbf4e03fd |
|
BLAKE2b-256 | f650b8642806665197f5ff0d24238e3648557b424af8fca470523098877d3d81 |