Skip to content

[python] Introduce DataFusion SQL to PyPaimon#7599

Open
JingsongLi wants to merge 1 commit intoapache:masterfrom
JingsongLi:python_sql
Open

[python] Introduce DataFusion SQL to PyPaimon#7599
JingsongLi wants to merge 1 commit intoapache:masterfrom
JingsongLi:python_sql

Conversation

@JingsongLi
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi commented Apr 6, 2026

Purpose

PR has introduced PyPaimon with SQL query capabilities based on PyPaimon-rust + DataFusion.

Tests

sql_context_test.py.

@JingsongLi JingsongLi changed the title [WIP][python] Introduce Python SQL to PyPaimon [python] Introduce Python SQL to PyPaimon Apr 6, 2026
@JingsongLi JingsongLi changed the title [python] Introduce Python SQL to PyPaimon [python] Introduce DataFusion SQL to PyPaimon Apr 6, 2026
@JingsongLi JingsongLi force-pushed the python_sql branch 5 times, most recently from ff6849c to 303a078 Compare April 6, 2026 09:20
'sql': [
'pypaimon-rust',
'datafusion>=52',
],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"""Execute a SQL query and return the result as a PyArrow Table."""
df = self._ctx.sql(query)
batches = df.collect()
return pa.Table.from_batches(batches)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may raise ValueError when the query returns empty results. Could you please add a case to cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants