Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions BodoSQL/bodosql/plan_conversion.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from __future__ import annotations

import pandas as pd
import pyarrow as pa

import bodo
import bodo.pandas as bd
import bodosql
from bodo.pandas.plan import (
ArithOpExpression,
LogicalProjection,
Expand Down Expand Up @@ -34,8 +37,20 @@ def java_plan_to_python_plan(ctx, java_plan):
if java_class_name == "PandasTableScan":
# TODO: support other table types and check table details
table_name = JavaEntryPoint.getLocalTableName(java_plan)
df = ctx.tables[table_name]
return bodo.pandas.from_pandas(df)._plan
table = ctx.tables[table_name]
if isinstance(table, bodosql.TablePath):
if table._file_type == "pq":
return bd.read_parquet(table._file_path)._plan
else:
raise NotImplementedError(
f"TablePath with file type {table._file_type} not supported in C++ backend yet"
)
elif isinstance(table, pd.DataFrame):
return bodo.pandas.from_pandas(table)._plan
else:
raise NotImplementedError(
f"Table type {type(table)} not supported in C++ backend yet"
)

if java_class_name in ("PandasProject", "BodoPhysicalProject"):
input_plan = java_plan_to_python_plan(ctx, java_plan.getInput())
Expand Down
1 change: 1 addition & 0 deletions BodoSQL/bodosql/tests/test_types/test_table_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def impl():
@pytest.mark.parametrize("reorder_io", [True, False, None])
@pytest.mark.slow
@pytest.mark.parquet
@pytest.mark.bodosql_cpp
def test_table_path_pq_bodosqlContext_python(
reorder_io, parquet_filepaths, memory_leak_check
):
Expand Down