xudong963 commented on a change in pull request #1202:
URL: https://github.com/apache/arrow-datafusion/pull/1202#discussion_r741626089



##########
File path: datafusion/src/logical_plan/expr.rs
##########
@@ -1935,10 +1935,32 @@ fn create_name(e: &Expr, input_schema: &DFSchema) -> 
Result<String> {
                 Ok(format!("{} IN ({:?})", expr, list))
             }
         }
-        other => Err(DataFusionError::NotImplemented(format!(
+        Expr::Between {
+            expr,
+            negated,
+            low,
+            high,
+        } => {
+            let expr = create_name(expr, input_schema)?;
+            let low = create_name(low, input_schema)?;
+            let high = create_name(high, input_schema)?;
+            if *negated {
+                Ok(format!("{} NOT BETWEEN {} AND {}", expr, low, high))
+            } else {
+                Ok(format!("{} BETWEEN {} AND {}", expr, low, high))
+            }
+        }
+        Expr::Sort {
+            expr,
+            asc: _,
+            nulls_first: _,
+        } => Err(DataFusionError::Internal(format!(

Review comment:
       We can directly add `Err(DataFusionError::Internal(
               "Create name does not support sort expr".to_string()`)




-- 
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...@arrow.apache.org

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


Reply via email to