Skip to content

Commit 27c7ae8

Browse files
tustvoldalamb
andauthored
Update Arrow 45.0.0 And Datum Arithmetic, change Decimal Division semantics (#6832)
* Datum based arithmetic * Update scalar timestamp arithmetic tests * Clippy * Update negation * Update sqllogictests * Update arrow 44.0.0 * Update for fixed size binary comparisons * Clippy * Update pin * Override formatting * Make test stable * Remove temporary file * Update datafusion-cli lockfile * Update pin * Format * Move DEFAULT_FORMAT_OPTIONS to datafusion_common --------- Co-authored-by: Andrew Lamb <[email protected]>
1 parent c577890 commit 27c7ae8

File tree

33 files changed

+365
-4140
lines changed

33 files changed

+365
-4140
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ rust-version = "1.70"
3232
version = "28.0.0"
3333

3434
[workspace.dependencies]
35-
arrow = { version = "43.0.0", features = ["prettyprint", "dyn_cmp_dict"] }
36-
arrow-array = { version = "43.0.0", default-features = false, features = ["chrono-tz"] }
37-
arrow-buffer = { version = "43.0.0", default-features = false }
38-
arrow-flight = { version = "43.0.0", features = ["flight-sql-experimental"] }
39-
arrow-schema = { version = "43.0.0", default-features = false }
40-
parquet = { version = "43.0.0", features = ["arrow", "async", "object_store"] }
35+
arrow = { version = "45.0.0", features = ["prettyprint", "dyn_cmp_dict"] }
36+
arrow-array = { version = "45.0.0", default-features = false, features = ["chrono-tz"] }
37+
arrow-buffer = { version = "45.0.0", default-features = false }
38+
arrow-flight = { version = "45.0.0", features = ["flight-sql-experimental"] }
39+
arrow-schema = { version = "45.0.0", default-features = false }
40+
parquet = { version = "45.0.0", features = ["arrow", "async", "object_store"] }
4141
sqlparser = { version = "0.36.1", features = ["visitor"] }
4242

4343
[profile.release]

datafusion-cli/Cargo.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rust-version = "1.70"
2929
readme = "README.md"
3030

3131
[dependencies]
32-
arrow = "43.0.0"
32+
arrow = "45.0.0"
3333
async-trait = "0.1.41"
3434
aws-config = "0.55"
3535
aws-credential-types = "0.55"

datafusion-cli/src/print_format.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
//! Print format variants
1919
use arrow::csv::writer::WriterBuilder;
2020
use arrow::json::{ArrayWriter, LineDelimitedWriter};
21+
use arrow::util::pretty::pretty_format_batches_with_options;
2122
use datafusion::arrow::record_batch::RecordBatch;
22-
use datafusion::arrow::util::pretty;
23+
use datafusion::common::format::DEFAULT_FORMAT_OPTIONS;
2324
use datafusion::error::{DataFusionError, Result};
2425
use std::str::FromStr;
2526

@@ -75,7 +76,12 @@ impl PrintFormat {
7576
match self {
7677
Self::Csv => println!("{}", print_batches_with_sep(batches, b',')?),
7778
Self::Tsv => println!("{}", print_batches_with_sep(batches, b'\t')?),
78-
Self::Table => pretty::print_batches(batches)?,
79+
Self::Table => {
80+
println!(
81+
"{}",
82+
pretty_format_batches_with_options(batches, &DEFAULT_FORMAT_OPTIONS)?
83+
)
84+
}
7985
Self::Json => println!("{}", batches_to_json!(ArrayWriter, batches)),
8086
Self::NdJson => {
8187
println!("{}", batches_to_json!(LineDelimitedWriter, batches))

datafusion/common/src/format.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
use arrow::util::display::{DurationFormat, FormatOptions};
19+
20+
/// The default [`FormatOptions`] to use within DataFusion
21+
pub const DEFAULT_FORMAT_OPTIONS: FormatOptions<'static> =
22+
FormatOptions::new().with_duration_format(DurationFormat::Pretty);

datafusion/common/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub mod delta;
2323
mod dfschema;
2424
pub mod display;
2525
mod error;
26+
pub mod format;
2627
mod functional_dependencies;
2728
mod join_type;
2829
pub mod parsers;

0 commit comments

Comments
 (0)