Skip to content

Commit 351ba68

Browse files
committed
Exclude all DDL statements from Ray scheduling
1 parent 31f8833 commit 351ba68

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

datafusion_ray/context.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,11 @@ def register_data_lake(self, table_name: str, paths: List[str]):
133133
self.ctx.register_datalake_table(table_name, paths)
134134

135135
def sql(self, sql: str) -> pa.RecordBatch:
136-
# TODO we should parse sql and inspect the plan rather than
137-
# perform a string comparison here
138-
sql_str = sql.lower()
139-
if "create view" in sql_str or "drop view" in sql_str:
140-
self.ctx.sql(sql)
141-
return []
142-
143136
df = self.df_ctx.sql(sql)
144-
return self.plan(df.execution_plan())
137+
execution_plan = df.execution_plan()
138+
if execution_plan.display().strip() == "EmptyExec":
139+
return [] # No ray scheduling for DDL statements
140+
return self.plan(execution_plan)
145141

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

0 commit comments

Comments
 (0)