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

scheduler now verifies that file:// ListingTable URLs are accessible #414

Merged
merged 7 commits into from
Oct 23, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
fix
  • Loading branch information
andygrove committed Oct 21, 2022
commit 693348d27ea9d64aa73003cc3152a0ac6571187c
17 changes: 12 additions & 5 deletions ballista/scheduler/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,21 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> SchedulerState<T,
// mounted in the container). There could be thousands of files so we
// just check the first one.
let url = &local_paths[0].as_str();
let test_url = url.strip_prefix("file://").unwrap();
ListingTableUrl::parse(test_url).map_err(|e| {
BallistaError::General(format!(
// the unwraps are safe here because we checked that the url starts with file:///
// we need to check both versions here to support Linux & Windows
ListingTableUrl::parse(url.strip_prefix("file://").unwrap())
.or_else(|_| {
ListingTableUrl::parse(
url.strip_prefix("file:///").unwrap(),
)
})
.map_err(|e| {
BallistaError::General(format!(
"logical plan refers to path on local file system \
that is not accessible in the scheduler: {}: {:?}",
url, e
))
})?;
})?;
}
}
}
Expand All @@ -310,7 +317,7 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> SchedulerState<T,
let mut verify_paths_exist = VerifyPathsExist {};
plan.accept(&mut verify_paths_exist)?;

let plan = session_ctx.create_physical_plan(&plan).await?;
let plan = session_ctx.create_physical_plan(plan).await?;
debug!(
"Physical plan: {}",
DisplayableExecutionPlan::new(plan.as_ref()).indent()
Expand Down