Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Exclude all DDL statements from Ray scheduling #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 4 additions & 8 deletions datafusion_ray/context.py
Original file line number Diff line number Diff line change
@@ -133,15 +133,11 @@ def register_data_lake(self, table_name: str, paths: List[str]):
self.ctx.register_datalake_table(table_name, paths)

def sql(self, sql: str) -> pa.RecordBatch:
# TODO we should parse sql and inspect the plan rather than
# perform a string comparison here
sql_str = sql.lower()
if "create view" in sql_str or "drop view" in sql_str:
self.ctx.sql(sql)
return []

df = self.df_ctx.sql(sql)
return self.plan(df.execution_plan())
execution_plan = df.execution_plan()
if execution_plan.display().strip() == "EmptyExec":
return [] # No ray scheduling for DDL statements
return self.plan(execution_plan)

def plan(self, execution_plan: Any) -> pa.RecordBatch: