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

Alamb/test parquet #13820

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,18 @@ large_futures = "warn"
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin)"] }
unused_qualifications = "deny"

# Temp patch to main of arrow-rs
[patch.crates-io]
arrow = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-array = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-buffer = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-cast = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-data = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-ipc = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-schema = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-select = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-string = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-ord = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-flight = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
parquet = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
74 changes: 28 additions & 46 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,18 @@ assert_cmd = "2.0"
ctor = "0.2.0"
predicates = "3.0"
rstest = "0.22"

# Temp patch to main of arrow-rs
[patch.crates-io]
arrow = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-array = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-buffer = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-cast = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-data = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-ipc = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-schema = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-select = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-string = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-ord = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
arrow-flight = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
parquet = { git = "https://github.com/alamb/arrow-rs.git", rev = "78994df5316106b4db2601ba4f641359b2b8084c" }
2 changes: 1 addition & 1 deletion datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ libc = "0.2.140"
object_store = { workspace = true, optional = true }
parquet = { workspace = true, optional = true, default-features = true }
paste = "1.0.15"
pyo3 = { version = "0.22.0", optional = true }
pyo3 = { version = "0.23.3", optional = true }
recursive = { workspace = true }
sqlparser = { workspace = true }
tokio = { workspace = true }
Expand Down
8 changes: 0 additions & 8 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,6 @@ config_namespace! {
/// default parquet writer setting
pub statistics_enabled: Option<String>, default = Some("page".into())

/// (writing) Sets max statistics size for any column. If NULL, uses
/// default parquet writer setting
pub max_statistics_size: Option<usize>, default = Some(4096)

/// (writing) Target maximum number of rows in each row group (defaults to 1M
/// rows). Writing larger row groups requires more memory to write, but
/// can get better compression and be faster to read.
Expand Down Expand Up @@ -1621,10 +1617,6 @@ config_namespace_with_hashmap! {
/// Sets bloom filter number of distinct values. If NULL, uses
/// default parquet options
pub bloom_filter_ndv: Option<u64>, default = None

/// Sets max statistics size for the column path. If NULL, uses
/// default parquet options
pub max_statistics_size: Option<usize>, default = None
}
}

Expand Down
15 changes: 1 addition & 14 deletions datafusion/common/src/file_options/parquet_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use parquet::{
basic::{BrotliLevel, GzipLevel, ZstdLevel},
file::properties::{
EnabledStatistics, WriterProperties, WriterPropertiesBuilder, WriterVersion,
DEFAULT_MAX_STATISTICS_SIZE, DEFAULT_STATISTICS_ENABLED,
DEFAULT_STATISTICS_ENABLED,
},
format::KeyValue,
schema::types::ColumnPath,
Expand Down Expand Up @@ -129,11 +129,6 @@ impl TryFrom<&TableParquetOptions> for WriterPropertiesBuilder {
builder =
builder.set_column_bloom_filter_ndv(path.clone(), bloom_filter_ndv);
}

if let Some(max_statistics_size) = options.max_statistics_size {
builder =
builder.set_column_max_statistics_size(path, max_statistics_size);
}
}

Ok(builder)
Expand All @@ -154,7 +149,6 @@ impl ParquetOptions {
dictionary_enabled,
dictionary_page_size_limit,
statistics_enabled,
max_statistics_size,
max_row_group_size,
created_by,
column_index_truncate_length,
Expand Down Expand Up @@ -190,9 +184,6 @@ impl ParquetOptions {
.and_then(|s| parse_statistics_string(s).ok())
.unwrap_or(DEFAULT_STATISTICS_ENABLED),
)
.set_max_statistics_size(
max_statistics_size.unwrap_or(DEFAULT_MAX_STATISTICS_SIZE),
)
.set_max_row_group_size(*max_row_group_size)
.set_created_by(created_by.clone())
.set_column_index_truncate_length(*column_index_truncate_length)
Expand Down Expand Up @@ -395,7 +386,6 @@ mod tests {
compression: Some("zstd(22)".into()),
dictionary_enabled: src_col_defaults.dictionary_enabled.map(|v| !v),
statistics_enabled: Some("none".into()),
max_statistics_size: Some(72),
encoding: Some("RLE".into()),
bloom_filter_enabled: Some(true),
bloom_filter_fpp: Some(0.72),
Expand All @@ -419,7 +409,6 @@ mod tests {
dictionary_enabled: Some(!defaults.dictionary_enabled.unwrap_or(false)),
dictionary_page_size_limit: 42,
statistics_enabled: Some("chunk".into()),
max_statistics_size: Some(42),
max_row_group_size: 42,
created_by: "wordy".into(),
column_index_truncate_length: Some(42),
Expand Down Expand Up @@ -473,7 +462,6 @@ mod tests {
),
bloom_filter_fpp: bloom_filter_default_props.map(|p| p.fpp),
bloom_filter_ndv: bloom_filter_default_props.map(|p| p.ndv),
max_statistics_size: Some(props.max_statistics_size(&col)),
}
}

Expand Down Expand Up @@ -523,7 +511,6 @@ mod tests {
compression: default_col_props.compression,
dictionary_enabled: default_col_props.dictionary_enabled,
statistics_enabled: default_col_props.statistics_enabled,
max_statistics_size: default_col_props.max_statistics_size,
bloom_filter_on_write: default_col_props
.bloom_filter_enabled
.unwrap_or_default(),
Expand Down
Loading
Loading