Skip to content

Apache DataFusion SQL Query Engine

cleanup parquet flag (#8563)

Jay Zhan1f4c14c7b942
diff --git a/datafusion/common/src/file_options/file_type.rs b/datafusion/common/src/file_options/file_type.rs
index b1d61b1a25..97362bdad3 100644
--- a/datafusion/common/src/file_options/file_type.rs
+++ b/datafusion/common/src/file_options/file_type.rs
@@ -103,13 +103,13 @@ impl FromStr for FileType {
}
#[cfg(test)]
+#[cfg(feature = "parquet")]
mod tests {
use crate::error::DataFusionError;
use crate::file_options::FileType;
use std::str::FromStr;
#[test]
- #[cfg(feature = "parquet")]
fn from_str() {
for (ext, file_type) in [
("csv", FileType::CSV),
diff --git a/datafusion/common/src/file_options/mod.rs b/datafusion/common/src/file_options/mod.rs
index f0e49dd855..1d661b17eb 100644
--- a/datafusion/common/src/file_options/mod.rs
+++ b/datafusion/common/src/file_options/mod.rs
@@ -296,10 +296,10 @@ impl Display for FileTypeWriterOptions {
}
#[cfg(test)]
+#[cfg(feature = "parquet")]
mod tests {
use std::collections::HashMap;
- #[cfg(feature = "parquet")]
use parquet::{
basic::{Compression, Encoding, ZstdLevel},
file::properties::{EnabledStatistics, WriterVersion},
@@ -314,11 +314,9 @@ mod tests {
use crate::Result;
- #[cfg(feature = "parquet")]
use super::{parquet_writer::ParquetWriterOptions, StatementOptions};
#[test]
- #[cfg(feature = "parquet")]
fn test_writeroptions_parquet_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("max_row_group_size".to_owned(), "123".to_owned());
@@ -389,7 +387,6 @@ mod tests {
}
#[test]
- #[cfg(feature = "parquet")]
fn test_writeroptions_parquet_column_specific() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
@@ -511,7 +508,6 @@ mod tests {
#[test]
// for StatementOptions
- #[cfg(feature = "parquet")]
fn test_writeroptions_csv_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("header".to_owned(), "true".to_owned());
@@ -540,7 +536,6 @@ mod tests {
#[test]
// for StatementOptions
- #[cfg(feature = "parquet")]
fn test_writeroptions_json_from_statement_options() -> Result<()> {
let mut option_map: HashMap<String, String> = HashMap::new();
option_map.insert("compression".to_owned(), "gzip".to_owned());