badalprasadsingh commented on code in PR #2508:
URL: https://github.com/apache/iceberg-go/pull/2508#discussion_r4534016757


##########
literals.go:
##########
@@ -951,6 +951,18 @@ func (s StringLiteral) Type() Type                   { 
return PrimitiveTypes.Str
 func (s StringLiteral) Value() string                { return string(s) }
 func (s StringLiteral) Any() any                     { return s.Value() }
 func (s StringLiteral) String() string               { return string(s) }
+
+// timestampNanoFromTime checks the signed 64-bit nanosecond range before
+// UnixNano, which otherwise silently wraps out-of-range timestamps.
+func timestampNanoFromTime(tm time.Time, source StringLiteral, typ Type) 
(Literal, error) {
+       if tm.Before(time.Unix(0, math.MinInt64)) || tm.After(time.Unix(0, 
math.MaxInt64)) {
+               return nil, fmt.Errorf("%w: casting '%s' to %s - timestamp is 
outside the nanosecond range",
+                       ErrBadCast, source, typ)
+       }

Review Comment:
   bind now fails on these strings, so scans and ExpressionEvaluator do too, a 
filter like `ts >= '0001-01-01T00:00:00'`, which matched modern rows by chance, 
now errors
   
   better: add a bullet under "Unreleased compatibility notes" in 
`website/src/releases.md`



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