Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions parquet/src/arrow/push_decoder/reader_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod filter;

use crate::DecodeResult;
use crate::arrow::ProjectionMask;
use crate::arrow::array_reader::{ArrayReaderBuilder, RowGroupCache};
use crate::arrow::array_reader::{ArrayReaderBuilder, CacheOptions, RowGroupCache};
use crate::arrow::arrow_reader::metrics::ArrowReaderMetrics;
use crate::arrow::arrow_reader::selection::RowSelectionStrategy;
use crate::arrow::arrow_reader::{
Expand Down Expand Up @@ -604,7 +604,7 @@ impl RowGroupReaderBuilder {
let array_reader_builder = ArrayReaderBuilder::new(&row_group, &self.metrics)
.with_parquet_metadata(&self.metadata);
let array_reader = if let Some(cache_info) = cache_info.as_ref() {
let cache_options = cache_info.builder().consumer();
let cache_options: CacheOptions = cache_info.builder().consumer();
array_reader_builder
.with_cache_options(Some(&cache_options))
.build_array_reader(self.fields.as_deref(), &self.projection)
Expand Down
12 changes: 7 additions & 5 deletions parquet/src/arrow/schema/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Arrow Extension Type Support for Parquet
//!
//! This module contains mapping code to map Parquet [`LogicalType`]s to/from
//! Arrow [`ExtensionType`]s.
//! Arrow [`arrow_schema::extension::ExtensionType`]s.
Comment thread
brunal marked this conversation as resolved.
Outdated
//!
//! Extension types are represented using the metadata from Arrow [`Field`]s
//! with the key "ARROW:extension:name".
Expand All @@ -27,7 +27,6 @@ use crate::basic::LogicalType;
use crate::errors::ParquetError;
use crate::schema::types::Type;
use arrow_schema::Field;
use arrow_schema::extension::ExtensionType;

/// Adds extension type metadata, if necessary, based on the Parquet field's
/// [`LogicalType`]
Expand All @@ -36,7 +35,8 @@ use arrow_schema::extension::ExtensionType;
/// Arrow DataType, and instead are represented by an Arrow ExtensionType.
/// Extension types are attached to Arrow Fields via metadata.
pub(crate) fn try_add_extension_type(
mut arrow_field: Field,
// `mut` is needed when some features are enabled.
#[allow(unused_mut)] mut arrow_field: Field,
parquet_type: &Type,
) -> Result<Field, ParquetError> {
let Some(parquet_logical_type) = parquet_type.get_basic_info().logical_type_ref() else {
Expand Down Expand Up @@ -97,6 +97,7 @@ pub(crate) fn has_extension_type(parquet_type: &Type) -> bool {
/// Return the Parquet logical type to use for the specified Arrow Struct field, if any.
#[cfg(feature = "variant_experimental")]
pub(crate) fn logical_type_for_struct(field: &Field) -> Option<LogicalType> {
use arrow_schema::extension::ExtensionType;
use parquet_variant_compute::VariantType;
// Check the name (= quick and cheap) and only try_extension_type if the name matches
// to avoid unnecessary String allocations in ArrowError
Expand Down Expand Up @@ -151,6 +152,7 @@ pub(crate) fn logical_type_for_string(_field: &Field) -> Option<LogicalType> {

#[cfg(feature = "geospatial")]
pub(crate) fn logical_type_for_binary(field: &Field) -> Option<LogicalType> {
use arrow_schema::extension::ExtensionType;
use parquet_geospatial::WkbType;
use parquet_geospatial::WkbTypeHint;

Expand All @@ -172,7 +174,7 @@ pub(crate) fn logical_type_for_binary(field: &Field) -> Option<LogicalType> {
}

#[cfg(not(feature = "geospatial"))]
pub(crate) fn logical_type_for_binary(field: &Field) -> Option<LogicalType> {
pub(crate) fn logical_type_for_binary(_field: &Field) -> Option<LogicalType> {
None
}

Expand All @@ -182,6 +184,6 @@ pub(crate) fn logical_type_for_binary_view(field: &Field) -> Option<LogicalType>
}

#[cfg(not(feature = "geospatial"))]
pub(crate) fn logical_type_for_binary_view(field: &Field) -> Option<LogicalType> {
pub(crate) fn logical_type_for_binary_view(_field: &Field) -> Option<LogicalType> {
None
}
8 changes: 8 additions & 0 deletions parquet/tests/arrow_reader/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ struct TestParquetFile {
/// The operation log for IO operations performed on this file
ops: Arc<OperationLog>,
/// The (pre-parsed) parquet metadata for this file
// TODO: this is unused; consider removing it.
#[allow(dead_code)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe for this dead code we can use it in a test somewhere to assert something useful? 🤔

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.

I lack context to be the one to tackle it!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can probably replace it with cfg(feature(async)) or something

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took the liberty of fixing this locally and pushing to this branch

parquet_metadata: Arc<ParquetMetaData>,
}

Expand Down Expand Up @@ -303,6 +305,8 @@ impl TestParquetFile {
}

/// Return the parquet metadata for this file
// TODO: this is unused; consider removing it.
#[allow(dead_code)]
fn parquet_metadata(&self) -> &Arc<ParquetMetaData> {
&self.parquet_metadata
}
Expand Down Expand Up @@ -477,10 +481,12 @@ enum LogEntry {
/// Read the metadata of the parquet file
ReadMetadata(Range<usize>),
/// Access previously parsed metadata
#[allow(dead_code)]
GetProvidedMetadata,
/// Read a single logical data object
ReadData(ReadInfo),
/// Read one or more logical data objects in a single operation
#[allow(dead_code)]
ReadMultipleData(Vec<LogEntry>),
/// Not known where the read came from
Unknown(Range<usize>),
Expand Down Expand Up @@ -572,6 +578,8 @@ impl OperationLog {
/// accessed by the specified range
///
/// It behaves the same as [`add_entry_for_range`] but for multiple ranges.
// TODO: this is unused; consider removing it.
Comment thread
brunal marked this conversation as resolved.
Outdated
#[allow(dead_code)]
fn add_entry_for_ranges<'a>(&self, ranges: impl IntoIterator<Item = &'a Range<usize>>) {
let entries = ranges
.into_iter()
Expand Down
Loading