Skip to content

Commit

Permalink
Merge remote-tracking branch 'apache/main' into string-view-trim
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Sep 23, 2024
2 parents 840ec46 + 2e274bf commit 307850a
Show file tree
Hide file tree
Showing 61 changed files with 852 additions and 195 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,3 @@ large_futures = "warn"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin)"] }
unused_imports = "deny"
1 change: 1 addition & 0 deletions datafusion-examples/examples/optimizer_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub async fn main() -> Result<()> {

/// An example OptimizerRule that replaces all `col = <const>` predicates with a
/// user defined function
#[derive(Default, Debug)]
struct MyOptimizerRule {}

impl OptimizerRule for MyOptimizerRule {
Expand Down
13 changes: 1 addition & 12 deletions datafusion/common/src/dfschema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,7 @@ impl DFSchema {
// qualifier and name.
(Some(q), Some(field_q)) => q.resolved_eq(field_q) && f.name() == name,
// field to lookup is qualified but current field is unqualified.
(Some(qq), None) => {
// the original field may now be aliased with a name that matches the
// original qualified name
let column = Column::from_qualified_name(f.name());
match column {
Column {
relation: Some(r),
name: column_name,
} => &r == qq && column_name == name,
_ => false,
}
}
(Some(_), None) => false,
// field to lookup is unqualified, no need to compare qualifier
(None, Some(_)) | (None, None) => f.name() == name,
})
Expand Down
24 changes: 22 additions & 2 deletions datafusion/common/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ use std::{error::Error, path::PathBuf};
/// Expects to be called about like this:
///
/// `assert_batch_eq!(expected_lines: &[&str], batches: &[RecordBatch])`
///
/// # Example
/// ```
/// # use std::sync::Arc;
/// # use arrow::record_batch::RecordBatch;
/// # use arrow_array::{ArrayRef, Int32Array};
/// # use datafusion_common::assert_batches_eq;
/// let col: ArrayRef = Arc::new(Int32Array::from(vec![1, 2]));
/// let batch = RecordBatch::try_from_iter([("column", col)]).unwrap();
/// // Expected output is a vec of strings
/// let expected = vec![
/// "+--------+",
/// "| column |",
/// "+--------+",
/// "| 1 |",
/// "| 2 |",
/// "+--------+",
/// ];
/// // compare the formatted output of the record batch with the expected output
/// assert_batches_eq!(expected, &[batch]);
/// ```
#[macro_export]
macro_rules! assert_batches_eq {
($EXPECTED_LINES: expr, $CHUNKS: expr) => {
Expand Down Expand Up @@ -56,8 +77,7 @@ macro_rules! assert_batches_eq {
/// vector of strings in a way that order does not matter.
/// This is a macro so errors appear on the correct line
///
/// Designed so that failure output can be directly copy/pasted
/// into the test code as expected results.
/// See [`assert_batches_eq`] for more details and example.
///
/// Expects to be called about like this:
///
Expand Down
Loading

0 comments on commit 307850a

Please sign in to comment.