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


##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -2871,6 +2872,118 @@ mod tests {
         Ok(())
     }
 
+    #[test]
+    fn test_from_unixtime() -> Result<()> {
+        let default_dialect: Arc<dyn Dialect> = Arc::new(DefaultDialect {});
+        let sqlite_dialect: Arc<dyn Dialect> = Arc::new(SqliteDialect {});
+
+        for (dialect, expected) in [
+            (default_dialect, "from_unixtime(date_col)"),
+            (sqlite_dialect, "datetime(`date_col`, 'unixepoch')"),
+        ] {
+            let unparser = Unparser::new(dialect.as_ref());
+            let expr = Expr::ScalarFunction(ScalarFunction {
+                func: Arc::new(ScalarUDF::from(
+                    
datafusion_functions::datetime::from_unixtime::FromUnixtimeFunc::new(
+                    ),

Review Comment:
   ```suggestion
                       
datafusion_functions::datetime::from_unixtime::FromUnixtimeFunc::new(),
   ```



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