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

Update to arrow and parquet 27.0.0 #4199

Merged
merged 6 commits into from Nov 15, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmarks/Cargo.toml
Expand Up @@ -33,14 +33,14 @@ simd = ["datafusion/simd"]
snmalloc = ["snmalloc-rs"]

[dependencies]
arrow = "26.0.0"
arrow = "27.0.0"
datafusion = { path = "../datafusion/core", version = "14.0.0" }
env_logger = "0.9"
futures = "0.3"
mimalloc = { version = "0.1", optional = true, default-features = false }
num_cpus = "1.13.0"
object_store = "0.5.0"
parquet = "26.0.0"
parquet = "27.0.0"
parquet-test-utils = { path = "../parquet-test-utils/", version = "0.1.0" }
rand = "0.8.4"
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
6 changes: 2 additions & 4 deletions benchmarks/expected-plans/q6.txt
@@ -1,6 +1,4 @@
Projection: SUM(lineitem.l_extendedprice * lineitem.l_discount) AS revenue
Aggregate: groupBy=[[]], aggr=[[SUM(lineitem.l_extendedprice * lineitem.l_discount)]]
Projection: lineitem.l_extendedprice, lineitem.l_discount
Filter: lineitem.l_shipdate >= Date32("8766") AND lineitem.l_shipdate < Date32("9131") AND CAST(lineitem.l_discount AS Decimal128(30, 15))lineitem.l_discount >= Decimal128(Some(49999999999999),30,15) AND CAST(lineitem.l_discount AS Decimal128(30, 15))lineitem.l_discount <= Decimal128(Some(69999999999999),30,15) AND lineitem.l_quantity < Decimal128(Some(2400),15,2)
Projection: CAST(lineitem.l_discount AS Decimal128(30, 15)) AS CAST(lineitem.l_discount AS Decimal128(30, 15))lineitem.l_discount, lineitem.l_quantity, lineitem.l_extendedprice, lineitem.l_discount, lineitem.l_shipdate
TableScan: lineitem projection=[l_quantity, l_extendedprice, l_discount, l_shipdate]
Filter: lineitem.l_shipdate >= Date32("8766") AND lineitem.l_shipdate < Date32("9131") AND lineitem.l_discount >= Decimal128(Some(5),15,2) AND lineitem.l_discount <= Decimal128(Some(7),15,2) AND lineitem.l_quantity < Decimal128(Some(2400),15,2)
Copy link
Contributor

@alamb alamb Nov 15, 2022

Choose a reason for hiding this comment

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

This plan has improved -- the projections are gone and the exprs are simpler

I believe the improvement stem from better casting support in Arrow, but I can't honestly find the specific improvement in https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md#2700-2022-11-11

As a reminder the query is

select
    sum(l_extendedprice * l_discount) as revenue
from
    lineitem
where
        l_shipdate >= date '1994-01-01'
  and l_shipdate < date '1995-01-01'
  and l_discount between 0.06 - 0.01 and 0.06 + 0.01
  and l_quantity < 24;

Copy link
Member

Choose a reason for hiding this comment

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

This looks much better to me

TableScan: lineitem projection=[l_quantity, l_extendedprice, l_discount, l_shipdate]
135 changes: 105 additions & 30 deletions datafusion-cli/Cargo.lock

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

2 changes: 1 addition & 1 deletion datafusion-cli/Cargo.toml
Expand Up @@ -29,7 +29,7 @@ rust-version = "1.62"
readme = "README.md"

[dependencies]
arrow = "26.0.0"
arrow = "27.0.0"
clap = { version = "3", features = ["derive", "cargo"] }
datafusion = { path = "../datafusion/core", version = "14.0.0" }
dirs = "4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions datafusion-examples/Cargo.toml
Expand Up @@ -34,8 +34,8 @@ path = "examples/avro_sql.rs"
required-features = ["datafusion/avro"]

[dev-dependencies]
arrow = "26.0.0"
arrow-flight = "26.0.0"
arrow = "27.0.0"
arrow-flight = "27.0.0"
async-trait = "0.1.41"
datafusion = { path = "../datafusion/core" }
datafusion-common = { path = "../datafusion/common" }
Expand Down
4 changes: 2 additions & 2 deletions datafusion/common/Cargo.toml
Expand Up @@ -40,10 +40,10 @@ pyarrow = ["pyo3", "arrow/pyarrow"]

[dependencies]
apache-avro = { version = "0.14", default-features = false, features = ["snappy"], optional = true }
arrow = { version = "26.0.0", default-features = false }
arrow = { version = "27.0.0", default-features = false }
chrono = { version = "0.4", default-features = false }
cranelift-module = { version = "0.89.0", optional = true }
object_store = { version = "0.5.0", default-features = false, optional = true }
parquet = { version = "26.0.0", default-features = false, optional = true }
parquet = { version = "27.0.0", default-features = false, optional = true }
pyo3 = { version = "0.17.1", optional = true }
sqlparser = "0.26"
6 changes: 3 additions & 3 deletions datafusion/core/Cargo.toml
Expand Up @@ -56,7 +56,7 @@ unicode_expressions = ["datafusion-physical-expr/regex_expressions", "datafusion
[dependencies]
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
apache-avro = { version = "0.14", optional = true }
arrow = { version = "26.0.0", features = ["prettyprint"] }
arrow = { version = "27.0.0", features = ["prettyprint"] }
async-compression = { version = "0.3.14", features = ["bzip2", "gzip", "futures-io", "tokio"] }
async-trait = "0.1.41"
bytes = "1.1"
Expand All @@ -81,7 +81,7 @@ num-traits = { version = "0.2", optional = true }
num_cpus = "1.13.0"
object_store = "0.5.0"
parking_lot = "0.12"
parquet = { version = "26.0.0", features = ["arrow", "async"] }
parquet = { version = "27.0.0", features = ["arrow", "async"] }
paste = "^1.0"
percent-encoding = "2.2.0"
pin-project-lite = "^0.2.7"
Expand All @@ -98,7 +98,7 @@ url = "2.2"
uuid = { version = "1.0", features = ["v4"] }

[dev-dependencies]
arrow = { version = "26.0.0", features = ["prettyprint", "dyn_cmp_dict"] }
arrow = { version = "27.0.0", features = ["prettyprint", "dyn_cmp_dict"] }
async-trait = "0.1.53"
criterion = "0.4"
csv = "1.1.6"
Expand Down
Expand Up @@ -356,7 +356,7 @@ impl SortPreservingMergeStream {
Ok(SortField::new_with_options(data_type, expr.options))
})
.collect::<Result<Vec<_>>>()?;
let row_converter = RowConverter::new(sort_fields);
let row_converter = RowConverter::new(sort_fields)?;

Ok(Self {
schema,
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/tests/sort_key_cursor.rs
Expand Up @@ -26,7 +26,7 @@ use datafusion::physical_plan::sorts::{RowIndex, SortKeyCursor};

#[test]
fn test_single_column() {
let mut converter = RowConverter::new(vec![SortField::new(DataType::Int64)]);
let mut converter = RowConverter::new(vec![SortField::new(DataType::Int64)]).unwrap();
let batch1 = int64_batch(vec![Some(1), Some(2), Some(5), Some(6)]);
let batch2 = int64_batch(vec![Some(3), Some(4), Some(8), Some(9)]);

Expand Down Expand Up @@ -56,7 +56,7 @@ fn test_single_column() {

#[test]
fn test_stable_compare() {
let mut converter = RowConverter::new(vec![SortField::new(DataType::Int64)]);
let mut converter = RowConverter::new(vec![SortField::new(DataType::Int64)]).unwrap();
// Validate ties are broken by the lower stream idx to ensure stable sort
let batch1 = int64_batch(vec![Some(3), Some(4)]);
let batch2 = int64_batch(vec![Some(3)]);
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/Cargo.toml
Expand Up @@ -36,7 +36,7 @@ path = "src/lib.rs"

[dependencies]
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
arrow = { version = "26.0.0", default-features = false }
arrow = { version = "27.0.0", default-features = false }
datafusion-common = { path = "../common", version = "14.0.0" }
log = "^0.4"
sqlparser = "0.26"
2 changes: 1 addition & 1 deletion datafusion/jit/Cargo.toml
Expand Up @@ -36,7 +36,7 @@ path = "src/lib.rs"
jit = []

[dependencies]
arrow = { version = "26.0.0", default-features = false }
arrow = { version = "27.0.0", default-features = false }
cranelift = "0.89.0"
cranelift-jit = "0.89.0"
cranelift-module = "0.89.0"
Expand Down
2 changes: 1 addition & 1 deletion datafusion/optimizer/Cargo.toml
Expand Up @@ -37,7 +37,7 @@ default = ["unicode_expressions"]
unicode_expressions = []

[dependencies]
arrow = { version = "26.0.0", features = ["prettyprint"] }
arrow = { version = "27.0.0", features = ["prettyprint"] }
async-trait = "0.1.41"
chrono = { version = "0.4.23", default-features = false }
datafusion-common = { path = "../common", version = "14.0.0" }
Expand Down