Skip to content

Commit 11bb86c

Browse files
committed
clean up
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent ad6949b commit 11bb86c

1 file changed

Lines changed: 15 additions & 112 deletions

File tree

encodings/parquet-variant/src/vtable.rs

Lines changed: 15 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,6 @@ mod tests {
344344
use crate::ParquetVariant;
345345
use crate::array::ParquetVariantArrayExt;
346346

347-
fn debug_step(test: &str, step: &str) {
348-
use std::io::Write as _;
349-
350-
println!(
351-
"[parquet_variant::{test}] {step} thread={:?}",
352-
std::thread::current().id()
353-
);
354-
drop(std::io::stdout().flush());
355-
}
356-
357347
fn roundtrip(array: ArrayRef) -> VortexResult<ArrayRef> {
358348
let dtype = array.dtype().clone();
359349
let len = array.len();
@@ -376,7 +366,6 @@ mod tests {
376366

377367
#[fixture]
378368
fn typed_value_variant_array() -> VortexResult<ArrayRef> {
379-
debug_step("typed_value_variant_array", "building fixture");
380369
let mut metadata = BinaryViewBuilder::new();
381370
for _ in 0..3 {
382371
metadata.append_value(b"\x01\x00");
@@ -393,35 +382,27 @@ mod tests {
393382
None,
394383
)?;
395384

396-
let array =
397-
ParquetVariant::from_arrow_variant(&ArrowVariantArray::try_new(&arrow_storage)?);
398-
debug_step("typed_value_variant_array", "built fixture");
399-
array
385+
ParquetVariant::from_arrow_variant(&ArrowVariantArray::try_new(&arrow_storage)?)
400386
}
401387

402388
#[fixture]
403389
fn parquet_variant_file_session() -> VortexSession {
404-
debug_step("parquet_variant_file_session", "building session");
405390
let session = VortexSession::empty()
406391
.with::<ArraySession>()
407392
.with::<LayoutSession>()
408393
.with::<RuntimeSession>();
409394
vortex_file::register_default_encodings(&session);
410395
session.arrays().register(ParquetVariant);
411-
debug_step("parquet_variant_file_session", "built session");
412396
session
413397
}
414398

415399
#[fixture]
416400
fn write_strategy() -> Arc<dyn LayoutStrategy> {
417-
debug_step("write_strategy", "building zoned write strategy");
418401
let mut allowed = vortex_file::ALLOWED_ENCODINGS.clone();
419402
allowed.insert(ParquetVariant.id());
420-
let strategy = vortex_file::WriteStrategyBuilder::default()
403+
vortex_file::WriteStrategyBuilder::default()
421404
.with_allow_encodings(allowed)
422-
.build();
423-
debug_step("write_strategy", "built zoned write strategy");
424-
strategy
405+
.build()
425406
}
426407

427408
#[test]
@@ -470,63 +451,24 @@ mod tests {
470451
#[from(typed_value_variant_array)] expected: VortexResult<ArrayRef>,
471452
parquet_variant_file_session: VortexSession,
472453
) -> VortexResult<()> {
473-
debug_step(
474-
"test_file_roundtrip_typed_value_variant_with_statistics",
475-
"start",
476-
);
477454
let expected = expected?;
478-
debug_step(
479-
"test_file_roundtrip_typed_value_variant_with_statistics",
480-
"resolved expected array",
481-
);
482455

483456
let mut bytes = ByteBufferMut::empty();
484-
debug_step(
485-
"test_file_roundtrip_typed_value_variant_with_statistics",
486-
"starting flat write",
487-
);
488457
parquet_variant_file_session
489458
.write_options()
490459
.with_strategy(Arc::new(FlatLayoutStrategy::default()))
491460
.write(&mut bytes, expected.to_array_stream())
492461
.await?;
493-
debug_step(
494-
"test_file_roundtrip_typed_value_variant_with_statistics",
495-
&format!("finished flat write bytes_len={}", bytes.len()),
496-
);
497462

498-
debug_step(
499-
"test_file_roundtrip_typed_value_variant_with_statistics",
500-
"opening buffer",
501-
);
502-
let opened = parquet_variant_file_session
463+
let actual = parquet_variant_file_session
503464
.open_options()
504-
.open_buffer(bytes)?;
505-
debug_step(
506-
"test_file_roundtrip_typed_value_variant_with_statistics",
507-
"opened buffer",
508-
);
509-
let scan = opened.scan()?;
510-
debug_step(
511-
"test_file_roundtrip_typed_value_variant_with_statistics",
512-
"created scan",
513-
);
514-
let stream = scan.into_array_stream()?;
515-
debug_step(
516-
"test_file_roundtrip_typed_value_variant_with_statistics",
517-
"created array stream",
518-
);
519-
let actual = stream.read_all().await?;
520-
debug_step(
521-
"test_file_roundtrip_typed_value_variant_with_statistics",
522-
"read all arrays",
523-
);
465+
.open_buffer(bytes)?
466+
.scan()?
467+
.into_array_stream()?
468+
.read_all()
469+
.await?;
524470

525471
assert_arrays_eq!(expected, actual);
526-
debug_step(
527-
"test_file_roundtrip_typed_value_variant_with_statistics",
528-
"done",
529-
);
530472
Ok(())
531473
}
532474

@@ -537,63 +479,24 @@ mod tests {
537479
parquet_variant_file_session: VortexSession,
538480
write_strategy: Arc<dyn LayoutStrategy>,
539481
) -> VortexResult<()> {
540-
debug_step(
541-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
542-
"start",
543-
);
544482
let expected = expected?;
545-
debug_step(
546-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
547-
"resolved expected array",
548-
);
549483

550484
let mut bytes = ByteBufferMut::empty();
551-
debug_step(
552-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
553-
"starting zoned write",
554-
);
555485
parquet_variant_file_session
556486
.write_options()
557487
.with_strategy(write_strategy)
558488
.write(&mut bytes, expected.to_array_stream())
559489
.await?;
560-
debug_step(
561-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
562-
&format!("finished zoned write bytes_len={}", bytes.len()),
563-
);
564490

565-
debug_step(
566-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
567-
"opening buffer",
568-
);
569-
let opened = parquet_variant_file_session
491+
let actual = parquet_variant_file_session
570492
.open_options()
571-
.open_buffer(bytes)?;
572-
debug_step(
573-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
574-
"opened buffer",
575-
);
576-
let scan = opened.scan()?;
577-
debug_step(
578-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
579-
"created scan",
580-
);
581-
let stream = scan.into_array_stream()?;
582-
debug_step(
583-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
584-
"created array stream",
585-
);
586-
let actual = stream.read_all().await?;
587-
debug_step(
588-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
589-
"read all arrays",
590-
);
493+
.open_buffer(bytes)?
494+
.scan()?
495+
.into_array_stream()?
496+
.read_all()
497+
.await?;
591498

592499
assert_arrays_eq!(expected, actual);
593-
debug_step(
594-
"test_file_roundtrip_typed_value_variant_with_zoned_strategy",
595-
"done",
596-
);
597500
Ok(())
598501
}
599502

0 commit comments

Comments
 (0)