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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibis_substrait-2.24.0-cp310-cp310-manylinux_2_35_x86_64.whl (102.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

File details

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

File metadata

  • Download URL: ibis_substrait-2.24.0.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.0 CPython/3.10.9 Linux/5.15.0-1033-azure

File hashes

Hashes for ibis_substrait-2.24.0.tar.gz
Algorithm Hash digest
SHA256 57249bf3e34d5018964aa7f8f18c189c598e853a56509a06504b6e22c92ef494
MD5 5d88fc81fbc299c346dc3493e3992717
BLAKE2b-256 ba5eca47783eaa82ca7ed188765c358e7b9d59953913bd9c87bc672cb2934a4a

See more details on using hashes here.

File details

Details for the file ibis_substrait-2.24.0-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ibis_substrait-2.24.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 80f804e1e5069386b241ab96d032e4e771a2213b331d74c3613c1dfe7c745ecf
MD5 e555ba110c53af1a04cdd299ead82e8f
BLAKE2b-256 380af3ef3300b0dfcb3987976044a4494ee8ef3961462f9db6201b4090346527

See more details on using hashes here.

Supported by

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