Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 112 additions & 58 deletions datafusion-cli/Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions datafusion/expr/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ use arrow::datatypes::{DataType, Field, Schema};
use datafusion_common::Result;
use std::sync::Arc;

#[derive(Debug, Clone, Copy)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually it would be great to add some more comments here, but maybe as a follow on PR

pub enum Hint {
/// Indicates the argument needs to be padded if it is scalar
Pad,
/// Indicates the argument can be converted to an array of length 1
AcceptsSingular,
}

/// Scalar function
///
/// The Fn param is the wrapped function but be aware that the function will
Expand Down
1 change: 0 additions & 1 deletion datafusion/functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ chrono = { workspace = true }
datafusion-common = { workspace = true }
datafusion-execution = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-physical-expr = { workspace = true, default-features = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

hashbrown = { workspace = true, optional = true }
hex = { version = "0.4", optional = true }
itertools = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/regex/regexpreplace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ use datafusion_common::ScalarValue;
use datafusion_common::{
cast::as_generic_string_array, internal_err, DataFusionError, Result,
};
use datafusion_expr::function::Hint;
use datafusion_expr::ColumnarValue;
use datafusion_expr::TypeSignature::*;
use datafusion_expr::{ScalarUDFImpl, Signature, Volatility};
use datafusion_physical_expr::functions::Hint;
use regex::Regex;
use std::any::Any;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/string/btrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use std::any::Any;
use arrow::datatypes::DataType;

use datafusion_common::{exec_err, Result};
use datafusion_expr::function::Hint;
use datafusion_expr::TypeSignature::*;
use datafusion_expr::{ColumnarValue, Volatility};
use datafusion_expr::{ScalarUDFImpl, Signature};
use datafusion_physical_expr::functions::Hint;

use crate::string::common::*;
use crate::utils::{make_scalar_function, utf8_to_str_type};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/string/ltrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use arrow::array::{ArrayRef, OffsetSizeTrait};
use arrow::datatypes::DataType;

use datafusion_common::{exec_err, Result};
use datafusion_expr::function::Hint;
use datafusion_expr::TypeSignature::*;
use datafusion_expr::{ColumnarValue, Volatility};
use datafusion_expr::{ScalarUDFImpl, Signature};
use datafusion_physical_expr::functions::Hint;

use crate::string::common::*;
use crate::utils::{make_scalar_function, utf8_to_str_type};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/string/rtrim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use std::any::Any;
use arrow::datatypes::DataType;

use datafusion_common::{exec_err, Result};
use datafusion_expr::function::Hint;
use datafusion_expr::TypeSignature::*;
use datafusion_expr::{ColumnarValue, Volatility};
use datafusion_expr::{ScalarUDFImpl, Signature};
use datafusion_physical_expr::functions::Hint;

use crate::string::common::*;
use crate::utils::{make_scalar_function, utf8_to_str_type};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use arrow::array::ArrayRef;
use arrow::datatypes::DataType;
use datafusion_common::{Result, ScalarValue};
use datafusion_expr::function::Hint;
use datafusion_expr::{ColumnarValue, ScalarFunctionImplementation};
use datafusion_physical_expr::functions::Hint;
use std::sync::Arc;

/// Creates a function to identify the optimal return type of a string function given
Expand Down
10 changes: 2 additions & 8 deletions datafusion/physical-expr/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ use datafusion_common::{Result, ScalarValue};
use datafusion_expr::{ColumnarValue, ScalarFunctionImplementation};

pub use crate::scalar_function::create_physical_expr;

#[derive(Debug, Clone, Copy)]
pub enum Hint {
/// Indicates the argument needs to be padded if it is scalar
Pad,
/// Indicates the argument can be converted to an array of length 1
AcceptsSingular,
}
// For backward compatibility
pub use datafusion_expr::function::Hint;

#[deprecated(since = "36.0.0", note = "Use ColumarValue::values_to_arrays instead")]
pub fn columnar_values_to_array(args: &[ColumnarValue]) -> Result<Vec<ArrayRef>> {
Expand Down