-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Execute plans during plan tests to make sure plans are valid and executable. #8230
Comments
May I take a try at it? Since I am new here, maybe one week should be enough. |
Sure. |
I tried to do this by appending the following at the end of @@ -399,10 +405,17 @@ mod tests {
let actual = get_plan_string(&optimized_physical_plan);
assert_eq!(
expected_optimized_lines, actual,
"\n**Optimized Plan Mismatch\n\nexpected:\n\n{expected_optimized_lines:#?}\nactual:\n\n{actual:#?}\n\n"
);
+
+ let ctx = SessionContext::new();
+ let object_store = InMemory::new();
+ object_store.put(&object_store::path::Path::from("file_path"), bytes::Bytes::from("").into()).await?;
+ ctx.register_object_store(&Url::parse("test://").unwrap(), Arc::new(object_store));
+ let task_ctx = Arc::new(TaskContext::from(&ctx));
+ collect(optimized_physical_plan, task_ctx).await?;
};
} but this leads to datafusion/datafusion/core/src/test/mod.rs Line 300 in 5501e8e
and partition not used yet errors from
Clearly the context setup is not sufficient to execute the plans. @mustafasrepo would you be willing to give me a hand and suggest what I am doing wrong? |
I think, the reason for these bugs is that. Source doesn't emit any data (Or doesn't expect to be called.). I think, we might need to update sources to support generating data. For doing so we need to update However, corresponding change might be a bit tricky for |
Is your feature request related to a problem or challenge?
In the link, @alamb suggested that adding a run pass to the plans would be better to make sure that plan is indeed runnable. I think this feature is really nice. We can add this support to the tests under following files:
Describe the solution you'd like
I think, we can execute optimized
ExecutionPlan
s, insideassert_optimized!
macro after checking that plan is as expected. After collecting all the result (preferably with single row) withcollect(plan, task_ctx).await?
we would expect success at the output. If there is any inconsistency in the schema, execution will show errors.I think for this task we can use
EmptyExec
with single row at the source.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: