Skip to content

Commit

Permalink
Support dynamic layouts with io batching
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 committed Aug 6, 2024
1 parent f0c63df commit 8dd21a5
Show file tree
Hide file tree
Showing 29 changed files with 1,167 additions and 701 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

26 changes: 14 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vortex-array/src/array/primitive/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ impl ArrayCompute for PrimitiveArray {
fn fill_forward(&self) -> Option<&dyn FillForwardFn> {
Some(self)
}

fn filter_indices(&self) -> Option<&dyn FilterIndicesFn> {
Some(self)
}
Expand Down
4 changes: 2 additions & 2 deletions vortex-datafusion/examples/table_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use vortex::validity::Validity;
use vortex::IntoArray;
use vortex_datafusion::persistent::config::{VortexFile, VortexTableConfig};
use vortex_datafusion::persistent::provider::VortexFileTableProvider;
use vortex_serde::file::file_writer::FileWriter;
use vortex_serde::layout::writer::layout_writer::LayoutWriter;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down Expand Up @@ -48,7 +48,7 @@ async fn main() -> anyhow::Result<()> {
.open(&filepath)
.await?;

let writer = FileWriter::new(f);
let writer = LayoutWriter::new(f);
let writer = writer.write_array_columns(st.into_array()).await?;
writer.finalize().await?;

Expand Down
15 changes: 11 additions & 4 deletions vortex-datafusion/src/persistent/opener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ use datafusion_common::Result as DFResult;
use datafusion_physical_expr::PhysicalExpr;
use futures::{FutureExt as _, TryStreamExt};
use object_store::ObjectStore;
use vortex::IntoCanonical;
use vortex_serde::file::reader::projections::Projection;
use vortex_serde::file::reader::VortexBatchReaderBuilder;
use vortex::{Context, IntoCanonical};
use vortex_serde::io::ObjectStoreReadAt;
use vortex_serde::layout::reader::projections::Projection;
use vortex_serde::layout::reader::VortexLayoutReaderBuilder;
use vortex_serde::layout::{LayoutContext, LayoutReader};

pub struct VortexFileOpener {
pub object_store: Arc<dyn ObjectStore>,
Expand All @@ -24,7 +25,13 @@ impl FileOpener for VortexFileOpener {
let read_at =
ObjectStoreReadAt::new(self.object_store.clone(), file_meta.location().clone());

let mut builder = VortexBatchReaderBuilder::new(read_at);
let mut builder = VortexLayoutReaderBuilder::new(
read_at,
LayoutReader::new(
Arc::new(Context::default()),
Arc::new(LayoutContext::default()),
),
);

if let Some(batch_size) = self.batch_size {
builder = builder.with_batch_size(batch_size);
Expand Down
2 changes: 2 additions & 0 deletions vortex-serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ edition = { workspace = true }
rust-version = { workspace = true }

[dependencies]
ahash = { workspace = true }
bytes = { workspace = true }
flatbuffers = { workspace = true }
futures = { workspace = true }
Expand All @@ -25,6 +26,7 @@ vortex-array = { workspace = true }
vortex-buffer = { workspace = true }
vortex-dtype = { workspace = true }
vortex-error = { workspace = true, features = ["object_store"] }
vortex-expr = { workspace = true }
vortex-flatbuffers = { workspace = true }
vortex-scalar = { workspace = true }

Expand Down
9 changes: 0 additions & 9 deletions vortex-serde/src/file/mod.rs

This file was deleted.

72 changes: 0 additions & 72 deletions vortex-serde/src/file/reader/batch.rs

This file was deleted.

112 changes: 0 additions & 112 deletions vortex-serde/src/file/reader/column.rs

This file was deleted.

20 changes: 0 additions & 20 deletions vortex-serde/src/file/reader/filtering.rs

This file was deleted.

Loading

0 comments on commit 8dd21a5

Please sign in to comment.