Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ibis-project/ibis-substrait
Ibis Substrait Compiler
https://github.com/ibis-project/ibis-substrait
analytics compiler expressions ibis relational-algebra substrait
Last synced: 6 days ago
JSON representation
Ibis Substrait Compiler
- Host: GitHub
- URL: https://github.com/ibis-project/ibis-substrait
- Owner: ibis-project
- License: apache-2.0
- Created: 2022-01-18T14:29:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-22T00:15:12.000Z (14 days ago)
- Last Synced: 2024-12-22T23:14:57.334Z (13 days ago)
- Topics: analytics, compiler, expressions, ibis, relational-algebra, substrait
- Language: Python
- Homepage:
- Size: 2.32 MB
- Stars: 96
- Watchers: 10
- Forks: 19
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# [Ibis](https://ibis-project.org) + [Substrait](https://substrait.io)
This repo houses the Substrait compiler for ibis.
We're just getting started here, so stay tuned!
# Usage
```python
>>> 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 int64r1 := Aggregation[r0]
metrics:
sum: Sum(r0.c)
by:
a: r0.a
b: r0.bSelection[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)
```