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.2.0.tar.gz
(81.7 kB
view details)
Built Distribution
File details
Details for the file ibis_substrait-3.2.0.tar.gz
.
File metadata
- Download URL: ibis_substrait-3.2.0.tar.gz
- Upload date:
- Size: 81.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f31b578bbffc87df0c3a503b7cacbda88e0c5fdeb0d0148be5e7d2a70e25e1 |
|
MD5 | 0664962f8fde96a493185a2a30bdb76c |
|
BLAKE2b-256 | 490056d078ae2912d0906a116250485ae43de8297efab9196fb90a06b80dfccd |
File details
Details for the file ibis_substrait-3.2.0-py3-none-any.whl
.
File metadata
- Download URL: ibis_substrait-3.2.0-py3-none-any.whl
- Upload date:
- Size: 105.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1019-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d694a1ffc93a657839081b876e97f91156d281325c4869ba49816c5c6b934d77 |
|
MD5 | a65e0a893440add4e74acad0a637d8f5 |
|
BLAKE2b-256 | bf62f0aa5bec3868cccaa8c731ae9c67fcd62cac4e8be46f48de499d7e76e4a1 |