2. 2
Ibis produces Expressions or Strings for
execution on SQL backends
t.groupby('region')
.aggregate(topk=t.funding_rounds.count())
.sort_by(ibis.desc('topk'))
.head()
Produces
SELECT region
,count(funding_rounds) AS topk
FROM companies
GROUP BY region
ORDER BY topk
SQL Strings generated for
Execution Engine
SQL
Backends
<sqlalchemy.sql.selectable.S
elect object>
SQLAlchemy Expression
3. 3
String Execution Backend
Ibis API Operations Compile SQL String
Backend Specific SQL Flavor and Support
Type Check and Optimize
Rewrite
Build Ibis Expression
4. 4
Expression Generating Backends
API Operation Compile
SA
Expression
Backend Specific Expressions or SQLAlchemy
Type Check and Optimize
Rewrite
Build Ibis Expression
12. 12
Takeaways
● Ibis as a substrait producer, decouples the execution
engines and expression building
● Check out Gil Forsyth’s gist that explains the duckdb and
ibis substrait integration:
https://gist.github.com/gforsyth/496d680e1e29f0876df937e
e5091e1b8