alamb opened a new issue, #8098:
URL: https://github.com/apache/arrow-datafusion/issues/8098

   ### Describe the bug
   
   Inspired by https://github.com/apache/arrow-datafusion/pull/8089/files from 
@Syleechan  I checked if there were other functions not covered by our 
serialization logic. It turns out that yes there are:
   
   
   
   ### To Reproduce
   
   Remove the catchall in parse_expr:
   ```diff
   diff --git a/datafusion/proto/src/logical_plan/from_proto.rs 
b/datafusion/proto/src/logical_plan/from_proto.rs
   index cdb0fe9bda..52a8480146 100644
   --- a/datafusion/proto/src/logical_plan/from_proto.rs
   +++ b/datafusion/proto/src/logical_plan/from_proto.rs
   @@ -1645,9 +1645,6 @@ pub fn parse_expr(
                    )),
                    ScalarFunction::Isnan => Ok(isnan(parse_expr(&args[0], 
registry)?)),
                    ScalarFunction::Iszero => Ok(iszero(parse_expr(&args[0], 
registry)?)),
   -                _ => Err(proto_error(
   -                    "Protobuf deserialization error: Unsupported scalar 
function",
   -                )),
                }
            }
            ExprType::ScalarUdfExpr(protobuf::ScalarUdfExprNode { fun_name, 
args }) => {
   ```
   
   The compiler will tell you there are several more functions not covered 
*like `ToTimestamp` and `ArrowTypeOf`:
   
   ```
   error[E0004]: non-exhaustive patterns: 
`datafusion::ScalarFunction::ToTimestamp`, 
`datafusion::ScalarFunction::StructFun`, 
`datafusion::ScalarFunction::ArrowTypeof` and 2 more not covered
       --> datafusion/proto/src/logical_plan/from_proto.rs:1303:19
        |
   1303 |             match scalar_function {
        |                   ^^^^^^^^^^^^^^^ patterns 
`datafusion::ScalarFunction::ToTimestamp`, 
`datafusion::ScalarFunction::StructFun`, 
`datafusion::ScalarFunction::ArrowTypeof` and 2 more not covered
        |
   note: `datafusion::ScalarFunction` defined here
   ```
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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]

Reply via email to