Skip to content

Commit 3b3c191

Browse files
committed
[REMOVE] revert field_operations.rs
1 parent 32c55ea commit 3b3c191

File tree

5 files changed

+5
-57
lines changed

5 files changed

+5
-57
lines changed

parquet-variant-compute/benches/variant_kernels.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ use arrow::array::{Array, ArrayRef, StringArray};
1919
use arrow::util::test_util::seedable_rng;
2020
use criterion::{criterion_group, criterion_main, Criterion};
2121
use parquet_variant::{Variant, VariantBuilder};
22-
use parquet_variant_compute::{batch_json_string_to_variant, variant_get, GetOptions, VariantArray, VariantArrayBuilder};
22+
use parquet_variant_compute::variant_get::{variant_get, GetOptions};
23+
use parquet_variant_compute::{batch_json_string_to_variant, VariantArray, VariantArrayBuilder};
2324
use rand::distr::Alphanumeric;
2425
use rand::rngs::StdRng;
2526
use rand::Rng;

parquet-variant-compute/src/field_operations.rs

Lines changed: 0 additions & 48 deletions
This file was deleted.

parquet-variant-compute/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
//! Parquet variant compute functions
1919
20-
pub mod field_operations;
2120
pub mod from_json;
2221
pub mod to_json;
2322
pub mod variant_array;

parquet-variant-compute/src/variant_parser.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,7 @@ impl VariantParser {
118118
let length = (header_byte >> 2) as usize;
119119

120120
// Short strings can be up to 64 bytes (6-bit value: 0-63)
121-
if length > 63 {
122-
return Err(ArrowError::InvalidArgumentError(format!(
123-
"Short string length {} exceeds maximum of 63",
124-
length
125-
)));
126-
}
121+
// Note: Since header_byte is u8, header_byte >> 2 can never exceed 63, so no bounds check needed
127122

128123
Ok(ShortStringHeader { length })
129124
}
@@ -335,7 +330,7 @@ mod tests {
335330
ShortStringHeader { length: 63 }
336331
);
337332

338-
// Test that all values 0-63 are valid
333+
// Test that all values 0-63 are valid (these are all possible values since u8 >> 2 max is 63)
339334
for length in 0..=63 {
340335
let header_byte = (length << 2) | 1; // short string type
341336
assert!(VariantParser::parse_short_string_header(header_byte as u8).is_ok());

parquet-variant/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ readme = "README.md"
3030
edition = { workspace = true }
3131
rust-version = { workspace = true }
3232

33+
3334
[dependencies]
3435
arrow-schema = { workspace = true }
3536
chrono = { workspace = true }

0 commit comments

Comments
 (0)