alamb commented on code in PR #8093:
URL: https://github.com/apache/arrow-datafusion/pull/8093#discussion_r1389951459
##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -880,6 +886,42 @@ pub async fn from_substrait_rex(
ScalarFunctionType::ILike => {
make_datafusion_like(true, f, input_schema,
extensions).await
}
+ ScalarFunctionType::IsNull => {
+ let arg = f.arguments.first().ok_or_else(|| {
Review Comment:
I don't know if it matters, but this code doesn't check for
`f.arguments.len() > 1` so I think it will silently ignore any arguments after
the first.
The same comment applies to `IsNotNull`
##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -1025,7 +1025,53 @@ pub fn to_substrait_rex(
col_ref_offset,
extension_info,
),
- _ => not_impl_err!("Unsupported expression: {expr:?}"),
+ Expr::IsNull(arg) => {
+ let arguments: Vec<FunctionArgument> = vec![FunctionArgument {
+ arg_type: Some(ArgType::Value(to_substrait_rex(
+ arg,
+ schema,
+ col_ref_offset,
+ extension_info,
+ )?)),
+ }];
+
+ let function_name = "is_null".to_string();
+ let function_anchor = _register_function(function_name,
extension_info);
Review Comment:
Very minor, but why not call this `function_reference` to match the field
name used below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]