Skip to main content

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


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.1.1.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

ibis_substrait-3.1.1-py3-none-any.whl (99.8 kB view details)

Uploaded Python 3

File details

Details for the file ibis_substrait-3.1.1.tar.gz.

File metadata

  • Download URL: ibis_substrait-3.1.1.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure

File hashes

Hashes for ibis_substrait-3.1.1.tar.gz
Algorithm Hash digest
SHA256 329376ef4082b8a6a7104d5ab037182232927c9fbb226f7d8c1b95f68d7f6bae
MD5 2d945467480d87df9f2822dcd0dca84f
BLAKE2b-256 4d9964d50d7c16d58a18391c7b6742424d05fa1a95d16aa4f0649d5778fa2b1e

See more details on using hashes here.

File details

Details for the file ibis_substrait-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: ibis_substrait-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 99.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure

File hashes

Hashes for ibis_substrait-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad65920cb851a6af0ac867d0ebb2a6d7700f4a90f79a4727dbcc500173a4756c
MD5 094e098b20ae653389f8b2bf9b011f66
BLAKE2b-256 e87ef2926df051bbf8cc7c5133647f5b1f5ca0ad0451a398f5706fdb7ee04c87

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page