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

WIP: Update to arrow-rs / parquet 54.1.0 #14328

Draft
wants to merge 4 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
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,17 @@ large_futures = "warn"
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin)"] }
unused_qualifications = "deny"

[patch.crates-io]
arrow = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh arrow-rs doesn't plan to publish the official patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah -- it isn't officially released yet (I expect it to be done in a day or two)

Sorry -- I should have maked this PR as draft

arrow-array = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-buffer = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-cast = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-data = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-ipc = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-schema = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-select = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-string = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-ord = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-flight = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
parquet = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
57 changes: 27 additions & 30 deletions datafusion-cli/Cargo.lock

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

14 changes: 14 additions & 0 deletions datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,17 @@ debug = false
debug-assertions = false
strip = "debuginfo"
incremental = false

[patch.crates-io]
arrow = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-array = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-buffer = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-cast = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-data = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-ipc = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-schema = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-select = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-string = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-ord = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
arrow-flight = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
parquet = { git = "https://github.com/apache/arrow-rs.git", rev = "b1bfa0f5852536ef2edb43ac8ddb66c39e8a7233" }
11 changes: 3 additions & 8 deletions datafusion/core/src/datasource/physical_plan/arrow_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ impl FileOpener for ArrowOpener {
for (dict_block, dict_result) in
footer.dictionaries().iter().flatten().zip(dict_results)
{
decoder.read_dictionary(
dict_block,
&Buffer::from_bytes(dict_result.into()),
)?;
decoder
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.read_dictionary(dict_block, &Buffer::from(dict_result))?;
}

// filter recordbatches according to range
Expand Down Expand Up @@ -348,10 +346,7 @@ impl FileOpener for ArrowOpener {
.zip(recordbatch_results)
.filter_map(move |(block, data)| {
decoder
.read_record_batch(
&block,
&Buffer::from_bytes(data.into()),
)
.read_record_batch(&block, &Buffer::from(data))
.transpose()
}),
)
Expand Down
7 changes: 4 additions & 3 deletions datafusion/optimizer/src/unwrap_cast_in_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ use crate::{OptimizerConfig, OptimizerRule};

use crate::utils::NamePreserver;
use arrow::datatypes::{
DataType, TimeUnit, MAX_DECIMAL_FOR_EACH_PRECISION, MIN_DECIMAL_FOR_EACH_PRECISION,
DataType, TimeUnit, MAX_DECIMAL128_FOR_EACH_PRECISION,
MIN_DECIMAL128_FOR_EACH_PRECISION,
};
use arrow::temporal_conversions::{MICROSECONDS, MILLISECONDS, NANOSECONDS};
use datafusion_common::tree_node::{Transformed, TreeNode, TreeNodeRewriter};
Expand Down Expand Up @@ -369,8 +370,8 @@ fn try_cast_numeric_literal(
// Different precision for decimal128 can store different range of value.
// For example, the precision is 3, the max of value is `999` and the min
// value is `-999`
MIN_DECIMAL_FOR_EACH_PRECISION[*precision as usize - 1],
MAX_DECIMAL_FOR_EACH_PRECISION[*precision as usize - 1],
MIN_DECIMAL128_FOR_EACH_PRECISION[*precision as usize],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAX_DECIMAL128_FOR_EACH_PRECISION[*precision as usize],
),
_ => return None,
};
Expand Down