davisp commented on code in PR #12104:
URL: https://github.com/apache/datafusion/pull/12104#discussion_r1735098039


##########
datafusion/sql/src/values.rs:
##########
@@ -41,6 +41,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
                     .collect::<Result<Vec<_>>>()
             })
             .collect::<Result<Vec<_>>>()?;
-        LogicalPlanBuilder::values(values)?.build()
+        let column_types = planner_context.values_column_data_types();
+        if column_types.is_empty() {
+            LogicalPlanBuilder::values(values)?.build()
+        } else {
+            LogicalPlanBuilder::values_with_types(values, 
column_types)?.build()

Review Comment:
   I'm definitely on board in making this more general. It didn't feel super 
awesome to be fixing things this specifically in the first place, it was just 
the first thing that came to mind.
   
   @alamb You mentioned in your comment on #12103 that there are other coercion 
patterns to follow, can you point me at anything vaguely similar to reference? 
Skimming the DataType docs, I'm not immediately seeing how I'd handle the 
expansion correctly.



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