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