ibis-substrait


Nameibis-substrait JSON
Version 4.0.1 PyPI version JSON
download
home_pagehttps://github.com/ibis-project/ibis-substrait
SummarySubtrait compiler for ibis
upload_time2024-07-29 14:31:57
maintainerIbis Contributors
docs_urlNone
authorIbis Contributors
requires_python<4,>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # [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": "<4,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Ibis Contributors",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/1f/c7/311e42dfd84712cb8ac728bdc0b530a0933b79d23f530731863ad3ee42a2/ibis_substrait-4.0.1.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": "4.0.1",
    "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": "b453959881915048b09cf54852d08f13ad8706bd680205df8b17e9898e0eb63c",
                "md5": "04a35f87f3bea3477453a54621daaaeb",
                "sha256": "107ca49383a3cca2fdc88f67ea2f0172620c16fa8f39c9c52305af85dd6180b4"
            },
            "downloads": -1,
            "filename": "ibis_substrait-4.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "04a35f87f3bea3477453a54621daaaeb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.9",
            "size": 116550,
            "upload_time": "2024-07-29T14:31:55",
            "upload_time_iso_8601": "2024-07-29T14:31:55.606305Z",
            "url": "https://files.pythonhosted.org/packages/b4/53/959881915048b09cf54852d08f13ad8706bd680205df8b17e9898e0eb63c/ibis_substrait-4.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1fc7311e42dfd84712cb8ac728bdc0b530a0933b79d23f530731863ad3ee42a2",
                "md5": "4a6a7bb60c85f1ba7c5ca858a299bc79",
                "sha256": "614810a173d096fbc49d87a9b419e2162a3c25d8efda1a4d57a389ce56b9041f"
            },
            "downloads": -1,
            "filename": "ibis_substrait-4.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4a6a7bb60c85f1ba7c5ca858a299bc79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.9",
            "size": 94571,
            "upload_time": "2024-07-29T14:31:57",
            "upload_time_iso_8601": "2024-07-29T14:31:57.621866Z",
            "url": "https://files.pythonhosted.org/packages/1f/c7/311e42dfd84712cb8ac728bdc0b530a0933b79d23f530731863ad3ee42a2/ibis_substrait-4.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-29 14:31:57",
    "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"
}
        
Elapsed time: 0.26872s