Skip to content

Commit

Permalink
Merge branch 'main' into return_type
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgao committed Jan 11, 2025
2 parents 8bd0719 + 17446ad commit f2b4f02
Show file tree
Hide file tree
Showing 24 changed files with 931 additions and 869 deletions.
2 changes: 1 addition & 1 deletion datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ url = "2.5.4"

[dev-dependencies]
assert_cmd = "2.0"
ctor = "0.2.0"
ctor = "0.2.9"
predicates = "3.0"
rstest = "0.22"

Expand Down
8 changes: 4 additions & 4 deletions datafusion-cli/src/print_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use arrow::datatypes::SchemaRef;
use arrow::json::{ArrayWriter, LineDelimitedWriter};
use arrow::record_batch::RecordBatch;
use arrow::util::pretty::pretty_format_batches_with_options;
use datafusion::common::format::DEFAULT_FORMAT_OPTIONS;
use datafusion::common::format::DEFAULT_CLI_FORMAT_OPTIONS;
use datafusion::error::Result;

/// Allow records to be printed in different formats
Expand Down Expand Up @@ -133,7 +133,7 @@ fn format_batches_with_maxrows<W: std::io::Write>(

let formatted = pretty_format_batches_with_options(
&filtered_batches,
&DEFAULT_FORMAT_OPTIONS,
&DEFAULT_CLI_FORMAT_OPTIONS,
)?;
if over_limit {
let mut formatted_str = format!("{}", formatted);
Expand All @@ -145,7 +145,7 @@ fn format_batches_with_maxrows<W: std::io::Write>(
}
MaxRows::Unlimited => {
let formatted =
pretty_format_batches_with_options(batches, &DEFAULT_FORMAT_OPTIONS)?;
pretty_format_batches_with_options(batches, &DEFAULT_CLI_FORMAT_OPTIONS)?;
writeln!(writer, "{}", formatted)?;
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ impl PrintFormat {
let empty_batch = RecordBatch::new_empty(schema);
let formatted = pretty_format_batches_with_options(
&[empty_batch],
&DEFAULT_FORMAT_OPTIONS,
&DEFAULT_CLI_FORMAT_OPTIONS,
)?;
writeln!(writer, "{}", formatted)?;
}
Expand Down
4 changes: 4 additions & 0 deletions datafusion/common/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ pub const DEFAULT_CAST_OPTIONS: CastOptions<'static> = CastOptions {
safe: false,
format_options: DEFAULT_FORMAT_OPTIONS,
};

pub const DEFAULT_CLI_FORMAT_OPTIONS: FormatOptions<'static> = FormatOptions::new()
.with_duration_format(DurationFormat::Pretty)
.with_null("NULL");
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
// specific language governing permissions and limitations
// under the License.

//! Tests for [`CombinePartialFinalAggregate`] physical optimizer rule
//!
//! Note these tests are not in the same module as the optimizer pass because
//! they rely on `ParquetExec` which is in the core crate.
use std::sync::Arc;

use arrow::datatypes::{DataType, Field, Schema, SchemaRef};
Expand Down
Loading

0 comments on commit f2b4f02

Please sign in to comment.