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


##########
datafusion/sql/src/values.rs:
##########
@@ -31,8 +33,9 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
             rows,
         } = values;
 
-        // Values should not be based on any other schema
-        let schema = DFSchema::empty();
+        let schema = planner_context
+            .table_schema()
+            .unwrap_or(Arc::new(DFSchema::empty()));

Review Comment:
   schema is used in `self.sql_to_expr(v, &schema, planner_context)` too, so I 
think it is better to have empty schema if table schema is not exist



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