Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Improved error message for missing feature in compressed parquet #632

Merged
merged 2 commits into from
Nov 24, 2021
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ futures = { version = "0.3", optional = true }
ahash = { version = "0.7", optional = true }

# parquet support
parquet2 = { version = "0.7", optional = true, default_features = false, features = ["stream"] }
parquet2 = { version = "0.8", optional = true, default_features = false, features = ["stream"] }

# avro
avro-rs = { version = "0.13", optional = true, default_features = false }
Expand Down
10 changes: 9 additions & 1 deletion src/io/parquet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ const ARROW_SCHEMA_META_KEY: &str = "ARROW:schema";

impl From<parquet2::error::ParquetError> for ArrowError {
fn from(error: parquet2::error::ParquetError) -> Self {
ArrowError::External("".to_string(), Box::new(error))
match error {
parquet2::error::ParquetError::FeatureNotActive(_, _) => {
let message = "Failed to read a compressed parquet file. \
Use the cargo feature \"io_parquet_compression\" to read compressed parquet files."
.to_string();
ArrowError::ExternalFormat(message)
}
_ => ArrowError::ExternalFormat(error.to_string()),
}
}
}

Expand Down