Struct datafusion::functions::core::arrow_cast::ArrowCastFunc
source · pub struct ArrowCastFunc { /* private fields */ }
Expand description
Implements casting to arbitrary arrow types (rather than SQL types)
Note that the arrow_cast
function is somewhat special in that its
return depends only on the value of its second argument (not its type)
It is implemented by calling the same underlying arrow cast
kernel as
normal SQL casts.
For example to cast to int
using SQL (which is then mapped to the arrow
type Int32
)
select cast(column_x as int) ...
You can use the arrow_cast
functiont to cast to a specific arrow type
For example
select arrow_cast(column_x, 'Float64')
Implementations§
source§impl ArrowCastFunc
impl ArrowCastFunc
pub fn new() -> ArrowCastFunc
Trait Implementations§
source§impl Debug for ArrowCastFunc
impl Debug for ArrowCastFunc
source§impl Default for ArrowCastFunc
impl Default for ArrowCastFunc
source§fn default() -> ArrowCastFunc
fn default() -> ArrowCastFunc
Returns the “default value” for a type. Read more
source§impl ScalarUDFImpl for ArrowCastFunc
impl ScalarUDFImpl for ArrowCastFunc
source§fn signature(&self) -> &Signature
fn signature(&self) -> &Signature
Returns the function’s
Signature
for information about what input
types are accepted and the function’s Volatility.source§fn return_type(
&self,
_arg_types: &[DataType]
) -> Result<DataType, DataFusionError>
fn return_type( &self, _arg_types: &[DataType] ) -> Result<DataType, DataFusionError>
source§fn return_type_from_exprs(
&self,
args: &[Expr],
_schema: &dyn ExprSchema,
_arg_types: &[DataType]
) -> Result<DataType, DataFusionError>
fn return_type_from_exprs( &self, args: &[Expr], _schema: &dyn ExprSchema, _arg_types: &[DataType] ) -> Result<DataType, DataFusionError>
source§fn invoke(
&self,
_args: &[ColumnarValue]
) -> Result<ColumnarValue, DataFusionError>
fn invoke( &self, _args: &[ColumnarValue] ) -> Result<ColumnarValue, DataFusionError>
Invoke the function on
args
, returning the appropriate result Read moresource§fn simplify(
&self,
args: Vec<Expr>,
info: &dyn SimplifyInfo
) -> Result<ExprSimplifyResult, DataFusionError>
fn simplify( &self, args: Vec<Expr>, info: &dyn SimplifyInfo ) -> Result<ExprSimplifyResult, DataFusionError>
Optionally apply per-UDF simplification / rewrite rules. Read more
source§fn aliases(&self) -> &[String]
fn aliases(&self) -> &[String]
Returns any aliases (alternate names) for this function. Read more
source§fn monotonicity(&self) -> Result<Option<Vec<Option<bool>>>, DataFusionError>
fn monotonicity(&self) -> Result<Option<Vec<Option<bool>>>, DataFusionError>
This function specifies monotonicity behaviors for User defined scalar functions.
Auto Trait Implementations§
impl Freeze for ArrowCastFunc
impl RefUnwindSafe for ArrowCastFunc
impl Send for ArrowCastFunc
impl Sync for ArrowCastFunc
impl Unpin for ArrowCastFunc
impl UnwindSafe for ArrowCastFunc
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more