From ad219f27c10d061f37d67e9dbf2f33ce25d9f5f9 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Thu, 30 Jul 2026 22:30:10 +0100 Subject: [PATCH 1/2] Remove stale strategy override in vortex-jni Signed-off-by: Robert Kruszewski --- vortex-jni/src/writer.rs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/vortex-jni/src/writer.rs b/vortex-jni/src/writer.rs index 9ed175d7e60..7f0de688896 100644 --- a/vortex-jni/src/writer.rs +++ b/vortex-jni/src/writer.rs @@ -42,7 +42,6 @@ use vortex::array::stream::ArrayStreamAdapter; use vortex::dtype::DType; use vortex::dtype::Field as DTypeField; use vortex::dtype::FieldPath; -use vortex::editions::EditionSessionExt; use vortex::error::VortexError; use vortex::error::VortexResult; use vortex::error::vortex_err; @@ -50,7 +49,6 @@ use vortex::expr::stats::Stat; use vortex::expr::stats::StatsProvider; use vortex::file::CountingVortexWrite; use vortex::file::WriteOptionsSessionExt; -use vortex::file::WriteStrategyBuilder; use vortex::file::WriteSummary; use vortex::file::multi::parse_uri_or_path; use vortex::io::VortexWrite; @@ -60,7 +58,6 @@ use vortex::io::runtime::BlockingRuntime; use vortex::io::runtime::Task; use vortex::io::session::RuntimeSessionExt; use vortex::layout::BufferedBytesTracker; -use vortex::layout::LayoutStrategy; use vortex::session::VortexSession; use vortex::utils::aliases::hash_map::HashMap; use vortex_arrow::ArrowSessionExt; @@ -101,20 +98,6 @@ fn resolve_store( } } -fn write_strategy_for_schema( - session: &VortexSession, - write_schema: &DType, -) -> Arc { - let variant_paths = variant_field_paths(write_schema); - if variant_paths.is_empty() { - return WriteStrategyBuilder::default().build(); - } - - WriteStrategyBuilder::default() - .with_allow_encodings(session.enabled_encoding_ids().into_iter().collect()) - .build() -} - fn variant_field_paths(dtype: &DType) -> Vec { let mut paths = Vec::new(); collect_variant_field_paths(dtype, FieldPath::root(), &mut paths); @@ -422,11 +405,7 @@ pub extern "system" fn Java_dev_vortex_jni_NativeWriter_create( let resolved = resolve_store(&file_path, &properties)?; let (tx, rx) = mpsc::channel(WRITE_CHANNEL_CAPACITY); let stream = ArrayStreamAdapter::new(write_schema.clone(), rx); - let strategy = write_strategy_for_schema(session, &write_schema); - let write_options = session - .write_options() - .with_strategy(strategy) - .with_metadata_segments(metadata); + let write_options = session.write_options().with_metadata_segments(metadata); // The same check runs inside `write`, but only once the write task is under way, where // it would surface as an opaque send failure on the first batch. write_options.validate_metadata()?; @@ -512,11 +491,7 @@ pub extern "system" fn Java_dev_vortex_jni_NativeWriter_createStream( let writable = Arc::new(env.new_global_ref(&writable)?); let (tx, rx) = mpsc::channel(WRITE_CHANNEL_CAPACITY); let stream = ArrayStreamAdapter::new(write_schema.clone(), rx); - let strategy = write_strategy_for_schema(session, &write_schema); - let write_options = session - .write_options() - .with_strategy(strategy) - .with_metadata_segments(metadata); + let write_options = session.write_options().with_metadata_segments(metadata); // See the note in `create`: validate before the write task can start. write_options.validate_metadata()?; let buffered_bytes = write_options.buffered_bytes_tracker(); From fb17898311ded5b5bf88eec42f54914a0d6e140f Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 31 Jul 2026 00:19:30 +0100 Subject: [PATCH 2/2] dead Signed-off-by: Robert Kruszewski --- vortex-jni/src/writer.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/vortex-jni/src/writer.rs b/vortex-jni/src/writer.rs index 7f0de688896..18c6a5fa101 100644 --- a/vortex-jni/src/writer.rs +++ b/vortex-jni/src/writer.rs @@ -40,8 +40,6 @@ use vortex::array::scalar::ScalarValue; use vortex::array::stats::StatsSet; use vortex::array::stream::ArrayStreamAdapter; use vortex::dtype::DType; -use vortex::dtype::Field as DTypeField; -use vortex::dtype::FieldPath; use vortex::error::VortexError; use vortex::error::VortexResult; use vortex::error::vortex_err; @@ -98,28 +96,6 @@ fn resolve_store( } } -fn variant_field_paths(dtype: &DType) -> Vec { - let mut paths = Vec::new(); - collect_variant_field_paths(dtype, FieldPath::root(), &mut paths); - paths -} - -fn collect_variant_field_paths(dtype: &DType, path: FieldPath, paths: &mut Vec) { - match dtype { - DType::Variant(_) => paths.push(path), - DType::Struct(fields, _) => { - for (name, field_dtype) in fields.names().iter().zip(fields.fields()) { - collect_variant_field_paths( - &field_dtype, - path.clone().push(DTypeField::from(name.clone())), - paths, - ); - } - } - _ => {} - } -} - /// Native writer holding a write-task handle and a sender that Java pushes batches into. pub struct NativeWriter { handle: Option>>,