This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 30e5f4286d Fix CI failures on `to_timestamp()` calls (#7941)
30e5f4286d is described below

commit 30e5f4286dffaed3533a5dc6348dd91e98cf461a
Author: comphead <[email protected]>
AuthorDate: Thu Oct 26 12:11:25 2023 -0700

    Fix CI failures on `to_timestamp()` calls (#7941)
    
    * Change input for `to_timestamp` function
    
    * docs
    
    * fix examples
    
    * output `to_timestamp` signature as ns
    
    * Fix CI `to_timestamp()` failed
    
    * Update datafusion/expr/src/built_in_function.rs
    
    Co-authored-by: Andrew Lamb <[email protected]>
    
    * fix typo
    
    * fix
    
    ---------
    
    Co-authored-by: Andrew Lamb <[email protected]>
---
 datafusion/expr/src/built_in_function.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datafusion/expr/src/built_in_function.rs 
b/datafusion/expr/src/built_in_function.rs
index 9edee7649f..4db565abfc 100644
--- a/datafusion/expr/src/built_in_function.rs
+++ b/datafusion/expr/src/built_in_function.rs
@@ -755,7 +755,10 @@ impl BuiltinScalarFunction {
                     return plan_err!("The to_hex function can only accept 
integers.");
                 }
             }),
-            BuiltinScalarFunction::ToTimestamp => Ok(Timestamp(Nanosecond, 
None)),
+            BuiltinScalarFunction::ToTimestamp => Ok(match 
&input_expr_types[0] {
+                Int64 => Timestamp(Second, None),
+                _ => Timestamp(Nanosecond, None),
+            }),
             BuiltinScalarFunction::ToTimestampMillis => 
Ok(Timestamp(Millisecond, None)),
             BuiltinScalarFunction::ToTimestampMicros => 
Ok(Timestamp(Microsecond, None)),
             BuiltinScalarFunction::ToTimestampNanos => 
Ok(Timestamp(Nanosecond, None)),

Reply via email to