Sevenannn commented on code in PR #12609:
URL: https://github.com/apache/datafusion/pull/12609#discussion_r1774295145


##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -952,13 +952,25 @@ impl Unparser<'_> {
                 Ok(ast::Expr::Value(ast::Value::Number(f.to_string(), false)))
             }
             ScalarValue::Float16(None) => 
Ok(ast::Expr::Value(ast::Value::Null)),
-            ScalarValue::Float32(Some(f)) => {
-                Ok(ast::Expr::Value(ast::Value::Number(f.to_string(), false)))
-            }
+            ScalarValue::Float32(Some(f)) => Ok(ast::Expr::Cast {
+                kind: ast::CastKind::Cast,
+                expr: Box::new(ast::Expr::Value(ast::Value::Number(
+                    f.to_string(),
+                    false,
+                ))),
+                data_type: self.arrow_dtype_to_ast_dtype(&DataType::Float32)?,
+                format: None,
+            }),

Review Comment:
   Yeah this would work instead of casting, let me update the PR to include the 
feedback



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