Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions parquet-variant/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@
// TODO: dead code removal
#[allow(dead_code)]
mod decoder;
// TODO: dead code removal
#[allow(dead_code)]
mod variant;
// TODO: dead code removal
#[allow(dead_code)]
mod utils;

#[cfg(test)]
mod test_variant;
pub use variant::*;
8 changes: 7 additions & 1 deletion parquet-variant/src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl OffsetSizeBytes {
}

#[derive(Clone, Debug, Copy, PartialEq)]
pub(crate) struct VariantMetadataHeader {
pub struct VariantMetadataHeader {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this in the public API, it needs to be pub as well

version: u8,
is_sorted: bool,
/// Note: This is `offset_size_minus_one` + 1
Expand Down Expand Up @@ -323,10 +323,16 @@ pub struct VariantArray<'m, 'v> {
}

impl<'m, 'v> VariantArray<'m, 'v> {
/// Return the length of this array
pub fn len(&self) -> usize {
todo!()
}

/// Is the array of zero length
pub fn is_empty(&self) -> bool {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is required by clippy

self.len() == 0
}

pub fn values(&self) -> Result<impl Iterator<Item = Variant<'m, 'v>>, ArrowError> {
todo!();
#[allow(unreachable_code)] // Just to infer the return type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
use std::fs;
use std::path::{Path, PathBuf};

use crate::variant::{Variant, VariantMetadata};
use arrow_schema::ArrowError;
use parquet_variant::{Variant, VariantMetadata};
Comment thread
alamb marked this conversation as resolved.
Outdated

fn cases_dir() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
Expand All @@ -42,15 +42,14 @@ fn load_case(name: &str) -> Result<(Vec<u8>, Vec<u8>), ArrowError> {

fn get_primitive_cases() -> Vec<(&'static str, Variant<'static, 'static>)> {
vec![
("primitive_boolean_false", Variant::BooleanFalse),
("primitive_boolean_true", Variant::BooleanTrue),
("primitive_int8", Variant::Int8(42)),
// Using the From<String> trait
("primitive_string", Variant::from("This string is longer than 64 bytes and therefore does not fit in a short_string and it also includes several non ascii characters such as 🐢, 💖, ♥\u{fe0f}, 🎣 and 🤦!!")),
// Using the From<String> trait
("short_string", Variant::from("Less than 64 bytes (❤\u{fe0f} with utf8)")),
// TODO Reenable when https://github.com/apache/parquet-testing/issues/81 is fixed
// ("primitive_null", Variant::Null),
("primitive_null", Variant::Null),
("primitive_boolean_false", Variant::BooleanFalse),
("primitive_boolean_true", Variant::BooleanTrue),
("primitive_int8", Variant::Int8(42)),
// Using the From<String> trait
("primitive_string", Variant::from("This string is longer than 64 bytes and therefore does not fit in a short_string and it also includes several non ascii characters such as 🐢, 💖, ♥\u{fe0f}, 🎣 and 🤦!!")),
// Using the From<String> trait
("short_string", Variant::from("Less than 64 bytes (❤\u{fe0f} with utf8)")),
]
}

Expand Down
Loading