phillipleblanc commented on code in PR #12605:
URL: https://github.com/apache/datafusion/pull/12605#discussion_r1774288306


##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -542,10 +542,10 @@ impl Unparser<'_> {
                     right: Box::new(input_exprs[1].clone()),
                 };
 
-                query
-                    .as_mut()
-                    .expect("to have a query builder")
-                    .body(Box::new(union_expr));
+                let Some(query) = query.as_mut() else {
+                    return internal_err!("to have a query builder");

Review Comment:
   ```suggestion
                       return internal_err!("UNION ALL operator only valid in a 
statement context");
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to