alamb commented on code in PR #9113:
URL: https://github.com/apache/arrow-datafusion/pull/9113#discussion_r1481660670


##########
datafusion/physical-expr/src/array_expressions.rs:
##########
@@ -1870,27 +1830,6 @@ pub fn array_replace_all(args: &[ArrayRef]) -> 
Result<ArrayRef> {
     }
 }
 
-macro_rules! to_string {

Review Comment:
   moved to the datafusion-functions-array crate



##########
datafusion/functions-array/src/udf.rs:
##########
@@ -0,0 +1,85 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! [`ScalarUDFImpl`] definitions for array functions.

Review Comment:
   This is the API defined for the function definitions



##########
datafusion/proto/proto/datafusion.proto:
##########
@@ -641,7 +641,7 @@ enum ScalarFunction {
   ArrayPrepend = 94;
   ArrayRemove = 95;
   ArrayReplace = 96;
-  ArrayToString = 97;
+  // 97 was ArrayToString

Review Comment:
   This is one of the nice things about making these functions UDF -- they can 
be serialized / deserialized without any special code. 
   
   Here is a test showing it working for `encode`/`decode`: 
https://github.com/apache/arrow-datafusion/blob/8413da8803665c07c2250a0d015f6b67fb7ef743/datafusion/proto/tests/cases/roundtrip_logical_plan.rs#L573
   
   I will add a test case for round tripping array functions too



##########
datafusion/proto/src/logical_plan/from_proto.rs:
##########
@@ -1462,10 +1460,6 @@ pub fn parse_expr(
                     parse_expr(&args[2], registry)?,
                     parse_expr(&args[3], registry)?,
                 )),
-                ScalarFunction::ArrayToString => Ok(array_to_string(

Review Comment:
   The point of this PR is to remove this enum (and set the pattern on how to 
do so for the rest of the array functionality



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