phillipleblanc commented on code in PR #19321:
URL: https://github.com/apache/datafusion/pull/19321#discussion_r2629625347


##########
datafusion/expr/src/expr.rs:
##########
@@ -2701,6 +2785,20 @@ fn rewrite_placeholder(expr: &mut Expr, other: &Expr, 
schema: &DFSchema) -> Resu
     Ok(())
 }
 
+/// Sets the [`DataType`] of a [`Placeholder`] expression if it is currently 
`None`.
+///
+/// This is used during placeholder type inference to assign a specific data 
type
+/// to untyped placeholders based on context (e.g., the expected type from a 
function signature).
+fn rewrite_placeholder_type(expr: &mut Expr, dt: &DataType) -> Result<()> {
+    if let Expr::Placeholder(Placeholder { id: _, field }) = expr
+        && field.is_none()
+        && !dt.is_null()
+    {
+        *field = Some(Arc::new(Field::new("", dt.clone(), true)));

Review Comment:
   I've changed `rewrite_placeholder` to set the field name to empty.



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