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


##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########


Review Comment:
   I think that is ok -- maybe you could just add a comment to test with this 
information



##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -1005,6 +1035,55 @@ pub async fn from_substrait_rex(
                 },
             })))
         }
+        Some(RexType::Subquery(subquery)) => match 
&subquery.as_ref().subquery_type {
+            Some(subquery_type) => match subquery_type {
+                SubqueryType::InPredicate(in_predicate) => {
+                    if in_predicate.needles.len() != 1 {
+                        Err(DataFusionError::Substrait(
+                            "InPredicate Subquery type must have exactly one 
Needle expression"
+                                .to_string(),
+                        ))

Review Comment:
   I think you can use 
https://docs.rs/datafusion/latest/datafusion/common/macro.substrait_err.html to 
make the code less verbose
   
   ```suggestion
                          substrait_err!("InPredicate Subquery type must have 
exactly one Needle expression")
   ```
   



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