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

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


The following commit(s) were added to refs/heads/main by this push:
     new b3689e47 fix(flight/flightsql/driver): fix `time.Time` params (#666)
b3689e47 is described below

commit b3689e47aa6e7d2ffddffec436d8a3b40897874c
Author: Evan Todd <[email protected]>
AuthorDate: Wed Feb 18 15:56:42 2026 -0800

    fix(flight/flightsql/driver): fix `time.Time` params (#666)
    
    ### Rationale for this change
    
    Parameters passed as `time.Time` were being interpreted incorrectly.
    `Nanosecond()` returns the nanosecond portion of the timestamp within a
    one-second interval, not the number of nanoseconds since the Unix epoch.
    
    ### What changes are included in this PR?
    
    Just a one-liner!
    
    ### Are these changes tested?
    
    Yes, tested locally with a real FlightSQL server.
    
    ### Are there any user-facing changes?
    
    `time.Time` parameters should work now!
---
 arrow/flight/flightsql/driver/utils.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arrow/flight/flightsql/driver/utils.go 
b/arrow/flight/flightsql/driver/utils.go
index 8f502865..f8624698 100644
--- a/arrow/flight/flightsql/driver/utils.go
+++ b/arrow/flight/flightsql/driver/utils.go
@@ -276,7 +276,7 @@ func setFieldValue(builder array.Builder, arg interface{}) 
error {
                                b.Append(arrow.Time64(x))
                        }
                case time.Time:
-                       b.Append(arrow.Time64(v.Nanosecond()))
+                       b.Append(arrow.Time64(v.UnixNano()))
                default:
                        return fmt.Errorf("invalid value type %T for builder 
%T", arg, builder)
                }

Reply via email to