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

feat: add parquet source to python ffi #749

Merged
merged 19 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
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
gs
  • Loading branch information
jordanrfrazier committed Sep 17, 2023
commit 438a3e770b56e0153ed295c9cbceb0b32795ac55
34 changes: 15 additions & 19 deletions crates/sparrow-compiler/src/data_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,25 +324,21 @@ impl FileSets {
&self,
requested_slice: &Option<v1alpha::slice_plan::Slice>,
) -> anyhow::Result<parking_lot::MappedMutexGuard<'_, Vec<PreparedFile>>> {
Ok(parking_lot::MutexGuard::map(self.file_sets.lock(), |fs| {
let file_set = fs
.iter_mut()
.find(|set| {
set.slice_plan
.iter()
.all(|slice| &slice.slice == requested_slice)
})
.unwrap();
// .with_context(|| {
// context_code!(
// tonic::Code::InvalidArgument,
// "Table '{}' missing file set with requested slice {:?}",
// "asdf",
// requested_slice
// )
// }).unwrap();
&mut file_set.prepared_files
}))
parking_lot::MutexGuard::try_map(self.file_sets.lock(), |fs| {
let file_set = fs.iter_mut().find(|set| {
set.slice_plan
.iter()
.all(|slice| &slice.slice == requested_slice)
});
file_set.map(|f| &mut f.prepared_files)
})
.map_err(|_| {
anyhow::anyhow!(context_code!(
tonic::Code::InvalidArgument,
"Table missing file set with requested slice {:?}",
requested_slice
))
})
}

pub fn metadata_for_files(&self) -> Vec<String> {
Expand Down
4 changes: 4 additions & 0 deletions crates/sparrow-runtime/src/key_hash_inverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ impl KeyHashInverse {
primary_grouping: GroupId,
registry: &ObjectStoreRegistry,
) -> error_stack::Result<(), Error> {
// TODO: Do we need to get all metadata files, or only ones for a specific slice?
// Investigate this -- it seems for a specific query we may only need to use
// the entities that are going to be a part of the query, which means only the
// entities for a specific slice.
let metadata_files = data_context
.tables_for_grouping(primary_grouping)
.flat_map(|table| table.metadata_for_files());
Expand Down