# [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 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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ibis-project/ibis-substrait",
"name": "ibis-substrait",
"maintainer": "Ibis Contributors",
"docs_url": null,
"requires_python": ">=3.9,<4",
"maintainer_email": "",
"keywords": "",
"author": "Ibis Contributors",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/49/00/56d078ae2912d0906a116250485ae43de8297efab9196fb90a06b80dfccd/ibis_substrait-3.2.0.tar.gz",
"platform": null,
"description": "# [Ibis](https://ibis-project.org) + [Substrait](https://substrait.io)\n\nThis repo houses the Substrait compiler for ibis.\n\nWe're just getting started here, so stay tuned!\n\n# Usage\n\n```python\n>>> import ibis\n\n>>> t = ibis.table(\n [(\"a\", \"string\"), (\"b\", \"float\"), (\"c\", \"int32\"), (\"d\", \"int64\"), (\"e\", \"int64\")],\n \"t\",\n)\n\n>>> expr = t.group_by([\"a\", \"b\"]).aggregate([t.c.sum().name(\"sum\")]).select(\"b\", \"sum\")\n>>> expr\nr0 := UnboundTable: t\n a string\n b float64\n c int32\n d int64\n e int64\n\nr1 := Aggregation[r0]\n metrics:\n sum: Sum(r0.c)\n by:\n a: r0.a\n b: r0.b\n\nSelection[r1]\n selections:\n b: r1.b\n sum: r1.sum\n\n\n>>> ibis.show_sql(expr)\nSELECT\n t0.b,\n t0.sum\nFROM (\n SELECT\n t1.a AS a,\n t1.b AS b,\n SUM(t1.c) AS sum\n FROM t AS t1\n GROUP BY\n t1.a,\n t1.b\n) AS t0\n\n>>> from ibis_substrait.compiler.core import SubstraitCompiler\n\n>>> compiler = SubstraitCompiler()\n\n>>> proto = compiler.compile(expr)\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Subtrait compiler for ibis",
"version": "3.2.0",
"project_urls": {
"Homepage": "https://github.com/ibis-project/ibis-substrait",
"Repository": "https://github.com/ibis-project/ibis-substrait"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf62f0aa5bec3868cccaa8c731ae9c67fcd62cac4e8be46f48de499d7e76e4a1",
"md5": "a65e0a893440add4e74acad0a637d8f5",
"sha256": "d694a1ffc93a657839081b876e97f91156d281325c4869ba49816c5c6b934d77"
},
"downloads": -1,
"filename": "ibis_substrait-3.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a65e0a893440add4e74acad0a637d8f5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4",
"size": 105178,
"upload_time": "2024-02-06T22:29:00",
"upload_time_iso_8601": "2024-02-06T22:29:00.940293Z",
"url": "https://files.pythonhosted.org/packages/bf/62/f0aa5bec3868cccaa8c731ae9c67fcd62cac4e8be46f48de499d7e76e4a1/ibis_substrait-3.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "490056d078ae2912d0906a116250485ae43de8297efab9196fb90a06b80dfccd",
"md5": "0664962f8fde96a493185a2a30bdb76c",
"sha256": "b7f31b578bbffc87df0c3a503b7cacbda88e0c5fdeb0d0148be5e7d2a70e25e1"
},
"downloads": -1,
"filename": "ibis_substrait-3.2.0.tar.gz",
"has_sig": false,
"md5_digest": "0664962f8fde96a493185a2a30bdb76c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4",
"size": 81660,
"upload_time": "2024-02-06T22:29:03",
"upload_time_iso_8601": "2024-02-06T22:29:03.104285Z",
"url": "https://files.pythonhosted.org/packages/49/00/56d078ae2912d0906a116250485ae43de8297efab9196fb90a06b80dfccd/ibis_substrait-3.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-06 22:29:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ibis-project",
"github_project": "ibis-substrait",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "ibis-substrait"
}