Skip to content

Commit dbe67c6

Browse files
committed
Import referenced modules at file scope and document page coordinates
Signed-off-by: Daniel King <dan@spiraldb.com>
1 parent e2f001f commit dbe67c6

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎encodings/pco/src/array.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ use crate::PcoLogicalPages;
6666
use crate::PcoMetadata;
6767
use crate::PcoPageInfo;
6868
use crate::page_index::PageIndex;
69+
use crate::take::slice as decode_slice;
6970

7071
// Overall approach here:
7172
// Chunk the array into Pco chunks (currently using the default recommended size
@@ -285,7 +286,7 @@ impl VTable for Pco {
285286
fn execute(array: Array<Self>, ctx: &mut ExecutionCtx) -> VortexResult<ExecutionResult> {
286287
if array.slice_start() != 0 || array.slice_stop() != array.unsliced_n_rows() {
287288
return Ok(ExecutionResult::done(
288-
crate::take::slice(array.as_view(), ctx)?.into_array(),
289+
decode_slice(array.as_view(), ctx)?.into_array(),
289290
));
290291
}
291292
let unsliced_validity = array.unsliced_validity();

‎encodings/pco/src/range_selection_tests.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use std::iter::repeat_n;
45
use std::sync::LazyLock;
56

7+
use pco::DEFAULT_MAX_PAGE_N;
68
use rstest::rstest;
79
use vortex_array::ArrayRef;
810
use vortex_array::IntoArray;
@@ -17,10 +19,11 @@ use vortex_error::VortexResult;
1719
use vortex_session::VortexSession;
1820

1921
use crate::Pco;
22+
use crate::initialize;
2023

2124
static SESSION: LazyLock<VortexSession> = LazyLock::new(|| {
2225
let session = VortexSession::empty();
23-
crate::initialize(&session);
26+
initialize(&session);
2427
session
2528
});
2629

@@ -97,7 +100,7 @@ fn rejects_invalid_indices_and_descriptors() -> VortexResult<()> {
97100
#[test]
98101
fn large_public_compressor_selections() -> VortexResult<()> {
99102
let mut ctx = SESSION.create_execution_ctx();
100-
let len = pco::DEFAULT_MAX_PAGE_N + 257;
103+
let len = DEFAULT_MAX_PAGE_N + 257;
101104
let input = PrimitiveArray::from_iter(
102105
(0..len).map(|i| u32::try_from(i).vortex_expect("fixture fits u32")),
103106
);
@@ -153,7 +156,7 @@ fn mixed_fragments_narrow_slices_and_compact_repeats() -> VortexResult<()> {
153156
)?
154157
.into_array();
155158
let expected = PrimitiveArray::from_option_iter(
156-
std::iter::repeat_n(Some(11i64), 500000).chain(std::iter::repeat_n(None, 500000)),
159+
repeat_n(Some(11i64), 500000).chain(repeat_n(None, 500000)),
157160
);
158161
assert_arrays_eq!(encoded.take(compact)?, expected, &mut ctx);
159162
let nulls = PrimitiveArray::new(vec![0i64; 100000], Validity::AllInvalid);

0 commit comments

Comments
 (0)