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

Uploaded Source

Built Distribution

ibis_substrait-2.28.1-cp310-cp310-manylinux_2_37_x86_64.whl (165.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.37+ x86-64

File details

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

File metadata

  • Download URL: ibis_substrait-2.28.1.tar.gz
  • Upload date:
  • Size: 134.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.0 CPython/3.10.10 Linux/5.15.0-1035-azure

File hashes

Hashes for ibis_substrait-2.28.1.tar.gz
Algorithm Hash digest
SHA256 1b198f840533722f6cc48c7f0a60605aa7c8981cec7c0662ec77929aab44cf58
MD5 4acae3a0ed8b0bf0ab267c09961eb2fc
BLAKE2b-256 637d914b167679b47c3886322bb56fd37b6e867054448b26980734120e9b4864

See more details on using hashes here.

File details

Details for the file ibis_substrait-2.28.1-cp310-cp310-manylinux_2_37_x86_64.whl.

File metadata

File hashes

Hashes for ibis_substrait-2.28.1-cp310-cp310-manylinux_2_37_x86_64.whl
Algorithm Hash digest
SHA256 dab0fb9ad710da3ca29afa4d7d88e0802ca616396233bd0d58265fd363e357bf
MD5 83b6dd4215a89ae4cc061507b7b5a8ca
BLAKE2b-256 d53efa24e42d1666be193aaf3d27ff26017d78b3ede4bc1a4b9262071ae82a48

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