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-4.0.1.tar.gz
(94.6 kB
view details)
Built Distribution
File details
Details for the file ibis_substrait-4.0.1.tar.gz
.
File metadata
- Download URL: ibis_substrait-4.0.1.tar.gz
- Upload date:
- Size: 94.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614810a173d096fbc49d87a9b419e2162a3c25d8efda1a4d57a389ce56b9041f |
|
MD5 | 4a6a7bb60c85f1ba7c5ca858a299bc79 |
|
BLAKE2b-256 | 1fc7311e42dfd84712cb8ac728bdc0b530a0933b79d23f530731863ad3ee42a2 |
File details
Details for the file ibis_substrait-4.0.1-py3-none-any.whl
.
File metadata
- Download URL: ibis_substrait-4.0.1-py3-none-any.whl
- Upload date:
- Size: 116.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107ca49383a3cca2fdc88f67ea2f0172620c16fa8f39c9c52305af85dd6180b4 |
|
MD5 | 04a35f87f3bea3477453a54621daaaeb |
|
BLAKE2b-256 | b453959881915048b09cf54852d08f13ad8706bd680205df8b17e9898e0eb63c |