Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parquet support optional for datafusion-common crate #1886

Merged
merged 2 commits into from
Feb 25, 2022
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 datafusion-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jit = ["cranelift-module"]

[dependencies]
arrow = { version = "9.0.0", features = ["prettyprint"] }
parquet = { version = "9.0.0", features = ["arrow"] }
parquet = { version = "9.0.0", features = ["arrow"], optional = true }
avro-rs = { version = "0.13", features = ["snappy"], optional = true }
pyo3 = { version = "0.15", optional = true }
sqlparser = "0.14"
Expand Down
4 changes: 4 additions & 0 deletions datafusion-common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use arrow::error::ArrowError;
use avro_rs::Error as AvroError;
#[cfg(feature = "jit")]
use cranelift_module::ModuleError;
#[cfg(feature = "parquet")]
use parquet::errors::ParquetError;
use sqlparser::parser::ParserError;

Expand All @@ -42,6 +43,7 @@ pub enum DataFusionError {
/// Error returned by arrow.
ArrowError(ArrowError),
/// Wraps an error from the Parquet crate
#[cfg(feature = "parquet")]
ParquetError(ParquetError),
/// Wraps an error from the Avro crate
#[cfg(feature = "avro")]
Expand Down Expand Up @@ -98,6 +100,7 @@ impl From<DataFusionError> for ArrowError {
}
}

#[cfg(feature = "parquet")]
impl From<ParquetError> for DataFusionError {
fn from(e: ParquetError) -> Self {
DataFusionError::ParquetError(e)
Expand Down Expand Up @@ -134,6 +137,7 @@ impl Display for DataFusionError {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
match *self {
DataFusionError::ArrowError(ref desc) => write!(f, "Arrow error: {}", desc),
#[cfg(feature = "parquet")]
DataFusionError::ParquetError(ref desc) => {
write!(f, "Parquet error: {}", desc)
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ row = []
jit = ["datafusion-jit"]

[dependencies]
datafusion-common = { path = "../datafusion-common", version = "7.0.0" }
datafusion-common = { path = "../datafusion-common", version = "7.0.0", features = ["parquet"] }
datafusion-expr = { path = "../datafusion-expr", version = "7.0.0" }
datafusion-jit = { path = "../datafusion-jit", version = "7.0.0", optional = true }
datafusion-physical-expr = { path = "../datafusion-physical-expr", version = "7.0.0" }
Expand Down