jayzhan211 commented on code in PR #14032:
URL: https://github.com/apache/datafusion/pull/14032#discussion_r1907051681


##########
datafusion/physical-plan/src/memory.rs:
##########
@@ -174,6 +177,93 @@ impl MemoryExec {
         })
     }
 
+    /// Create a new execution plan from a list of constant values 
(`ValuesExec`)
+    pub fn try_new_as_values(
+        schema: SchemaRef,
+        data: Vec<Vec<Arc<dyn PhysicalExpr>>>,
+    ) -> Result<Self> {
+        if data.is_empty() {
+            return plan_err!("Values list cannot be empty");
+        }
+
+        let n_row = data.len();
+        let n_col = schema.fields().len();
+
+        let placeholder_schema = Arc::new(Schema::empty());

Review Comment:
   ```suggestion
           // We have this single row batch as a placeholder to satisfy 
evaluation argument
           // and generate a single output row
           let placeholder_schema = Arc::new(Schema::empty());
   ```
   
   better keep the old comment here so we know why not empty batch



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