Skip to content
6 changes: 6 additions & 0 deletions datafusion/execution/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,12 @@ impl SessionConfig {
self.options.execution.enforce_batch_size_in_joins
}

/// Toggle SQL ANSI mode for expressions, casting, and error handling
pub fn with_enable_ansi_mode(mut self, enable_ansi_mode: bool) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this function? If so it needs a docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need it eventually. I also refer to this config in datafusion/sqllogictest/test_files/spark/README.md‎ now.

self.options_mut().execution.enable_ansi_mode = enable_ansi_mode;
self
}

/// Convert configuration options to name-value pairs with values
/// converted to strings.
///
Expand Down
4 changes: 3 additions & 1 deletion datafusion/functions/src/math/abs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ macro_rules! make_abs_function {
}};
}

#[macro_export]
macro_rules! make_try_abs_function {
($ARRAY_TYPE:ident) => {{
|input: &ArrayRef| {
Expand All @@ -62,7 +63,8 @@ macro_rules! make_try_abs_function {
x
))
})
})?;
})
.and_then(|v| Ok(v.with_data_type(input.data_type().clone())))?; // maintain decimal's precision and scale
Ok(Arc::new(res) as ArrayRef)
}
}};
Expand Down
Loading