Skip to content

Commit 837c4d9

Browse files
committed
Exclude all DDL statements from Ray scheduling
1 parent 74ec45c commit 837c4d9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

datafusion_ray/context.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,11 @@ def register_data_lake(self, table_name: str, paths: List[str]):
219219
self.ctx.register_datalake_table(table_name, paths)
220220

221221
def sql(self, sql: str) -> pa.RecordBatch:
222-
# TODO we should parse sql and inspect the plan rather than
223-
# perform a string comparison here
224-
sql_str = sql.lower()
225-
if "create view" in sql_str or "drop view" in sql_str:
226-
self.ctx.sql(sql)
227-
return []
228-
229222
df = self.df_ctx.sql(sql)
230223
execution_plan = df.execution_plan()
224+
if execution_plan.display().strip() == "EmptyExec":
225+
# No ray scheduling for DDL statements
226+
return []
231227

232228
graph = self.ctx.plan(execution_plan)
233229
final_stage_id = graph.get_final_query_stage().id()

0 commit comments

Comments
 (0)