alamb commented on code in PR #10653:
URL: https://github.com/apache/datafusion/pull/10653#discussion_r1617227806


##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -42,7 +42,7 @@ use datafusion::logical_expr::expr::{
 };
 use datafusion::logical_expr::{expr, Between, JoinConstraint, LogicalPlan, 
Operator};
 use datafusion::prelude::Expr;
-use prost_types::Any as ProtoAny;
+use pbjson_types::Any as ProtoAny;

Review Comment:
   WHy do we need to change to `pbjson_types` here? It seems like the json 
support is only for testing...



##########
datafusion/substrait/tests/cases/logical_plans.rs:
##########
@@ -0,0 +1,61 @@
+// 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.
+
+#[cfg(test)]
+mod tests {

Review Comment:
   In general the idea of having checked in substrait plans (as json protobuf) 
is actually likely a pretty good way to build up a library of test cases "from 
the wild" (not round tripped)
   
   This is quite cool @Blizzara 



##########
datafusion/substrait/Cargo.toml:
##########
@@ -37,11 +37,13 @@ chrono = { workspace = true }
 datafusion = { workspace = true, default-features = true }
 itertools = { workspace = true }
 object_store = { workspace = true }
+pbjson-types = "0.6"

Review Comment:
   does this need to be a actual dependency or can it be a dev dependency?



##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -122,6 +122,14 @@ fn scalar_function_type_from_str(
     name: &str,
 ) -> Result<ScalarFunctionType> {
     let s = ctx.state();
+    let name = match name.rsplit_once(':') {
+        // Since 0.32.0, Substrait requires the function names to be in a 
compound format
+        // https://substrait.io/extensions/#function-signature-compound-names
+        // On the consumer side, we don't really care about the signature 
though, just the name.

Review Comment:
   ```suggestion
           // for example, `add:i8_i8`.
           // On the consumer side, we don't really care about the signature 
though, just the name.
   ```



##########
datafusion/substrait/tests/cases/logical_plans.rs:
##########
@@ -0,0 +1,61 @@
+// 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.
+
+#[cfg(test)]

Review Comment:
   ```suggestion
   //! Tests for reading substrait plans produced by other systems
   
   #[cfg(test)]
   ```



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to