pub struct SparkStrToMap { /* private fields */ }Expand description
Spark-compatible str_to_map expression
https://spark.apache.org/docs/latest/api/sql/index.html#str_to_map
Creates a map from a string by splitting on delimiters. str_to_map(text[, pairDelim[, keyValueDelim]]) -> Map<String, String>
- text: The input string
- pairDelim: Delimiter between key-value pairs (default: ‘,’)
- keyValueDelim: Delimiter between key and value (default: ‘:’)
§Duplicate Key Handling
Uses EXCEPTION behavior (Spark 3.0+ default): errors on duplicate keys.
See spark.sql.mapKeyDedupPolicy:
https://github.com/apache/spark/blob/v4.0.0/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala#L4502-L4511
TODO: Support configurable spark.sql.mapKeyDedupPolicy (LAST_WIN) in a follow-up PR.
Implementations§
Source§impl SparkStrToMap
impl SparkStrToMap
Trait Implementations§
Source§impl Debug for SparkStrToMap
impl Debug for SparkStrToMap
Source§impl Default for SparkStrToMap
impl Default for SparkStrToMap
Source§impl Hash for SparkStrToMap
impl Hash for SparkStrToMap
Source§impl PartialEq for SparkStrToMap
impl PartialEq for SparkStrToMap
Source§impl ScalarUDFImpl for SparkStrToMap
impl ScalarUDFImpl for SparkStrToMap
Source§fn signature(&self) -> &Signature
fn signature(&self) -> &Signature
Signature describing the argument types for which this
function has an implementation, and the function’s Volatility. Read moreSource§fn return_field_from_args(&self, args: ReturnFieldArgs<'_>) -> Result<FieldRef>
fn return_field_from_args(&self, args: ReturnFieldArgs<'_>) -> Result<FieldRef>
Source§fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue>
fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue>
Source§fn aliases(&self) -> &[String]
fn aliases(&self) -> &[String]
Source§fn display_name(&self, args: &[Expr]) -> Result<String, DataFusionError>
fn display_name(&self, args: &[Expr]) -> Result<String, DataFusionError>
This method is unused and will be removed in a future release
Source§fn schema_name(&self, args: &[Expr]) -> Result<String, DataFusionError>
fn schema_name(&self, args: &[Expr]) -> Result<String, DataFusionError>
Source§fn with_updated_config(&self, _config: &ConfigOptions) -> Option<ScalarUDF>
fn with_updated_config(&self, _config: &ConfigOptions) -> Option<ScalarUDF>
Source§fn is_nullable(&self, _args: &[Expr], _schema: &dyn ExprSchema) -> bool
fn is_nullable(&self, _args: &[Expr], _schema: &dyn ExprSchema) -> bool
Use return_field_from_args instead. if you use is_nullable that returns non-nullable with return_type, you would need to switch to return_field_from_args, you might have error
Source§fn simplify(
&self,
args: Vec<Expr>,
_info: &SimplifyContext,
) -> Result<ExprSimplifyResult, DataFusionError>
fn simplify( &self, args: Vec<Expr>, _info: &SimplifyContext, ) -> Result<ExprSimplifyResult, DataFusionError>
Source§fn preimage(
&self,
_args: &[Expr],
_lit_expr: &Expr,
_info: &SimplifyContext,
) -> Result<PreimageResult, DataFusionError>
fn preimage( &self, _args: &[Expr], _lit_expr: &Expr, _info: &SimplifyContext, ) -> Result<PreimageResult, DataFusionError>
Source§fn short_circuits(&self) -> bool
fn short_circuits(&self) -> bool
exprs subexpressions may not be evaluated
and thus any side effects (like divide by zero) may not be encountered. Read moreSource§fn conditional_arguments<'a>(
&self,
args: &'a [Expr],
) -> Option<(Vec<&'a Expr>, Vec<&'a Expr>)>
fn conditional_arguments<'a>( &self, args: &'a [Expr], ) -> Option<(Vec<&'a Expr>, Vec<&'a Expr>)>
Source§fn evaluate_bounds(
&self,
_input: &[&Interval],
) -> Result<Interval, DataFusionError>
fn evaluate_bounds( &self, _input: &[&Interval], ) -> Result<Interval, DataFusionError>
Source§fn propagate_constraints(
&self,
_interval: &Interval,
_inputs: &[&Interval],
) -> Result<Option<Vec<Interval>>, DataFusionError>
fn propagate_constraints( &self, _interval: &Interval, _inputs: &[&Interval], ) -> Result<Option<Vec<Interval>>, DataFusionError>
Source§fn output_ordering(
&self,
inputs: &[ExprProperties],
) -> Result<SortProperties, DataFusionError>
fn output_ordering( &self, inputs: &[ExprProperties], ) -> Result<SortProperties, DataFusionError>
SortProperties of this function based on its children’s properties.Source§fn preserves_lex_ordering(
&self,
_inputs: &[ExprProperties],
) -> Result<bool, DataFusionError>
fn preserves_lex_ordering( &self, _inputs: &[ExprProperties], ) -> Result<bool, DataFusionError>
Source§fn coerce_types(
&self,
_arg_types: &[DataType],
) -> Result<Vec<DataType>, DataFusionError>
fn coerce_types( &self, _arg_types: &[DataType], ) -> Result<Vec<DataType>, DataFusionError>
Source§fn documentation(&self) -> Option<&Documentation>
fn documentation(&self) -> Option<&Documentation>
Source§fn placement(&self, _args: &[ExpressionPlacement]) -> ExpressionPlacement
fn placement(&self, _args: &[ExpressionPlacement]) -> ExpressionPlacement
impl Eq for SparkStrToMap
impl StructuralPartialEq for SparkStrToMap
Auto Trait Implementations§
impl Freeze for SparkStrToMap
impl !RefUnwindSafe for SparkStrToMap
impl Send for SparkStrToMap
impl Sync for SparkStrToMap
impl Unpin for SparkStrToMap
impl UnsafeUnpin for SparkStrToMap
impl !UnwindSafe for SparkStrToMap
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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