You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ferhatelmas (via GitHub)" <gi...@apache.org> on 2026/08/25 12:09:35 UTC
[PR] fix(literals): reject out-of-range int64-date conversion [iceberg-go]
ferhatelmas opened a new pull request, #1877:
URL: https://github.com/apache/iceberg-go/pull/1877
`Int64Literal.To(DateType)` narrowed with a plain `DateLiteral(i)` conversion, silently wrapping out-of-range values so `Eq`/`In` predicates could match rows the user never asked for.
Return `Int32AboveMaxLiteral()`/`Int32BelowMinLiteral()` instead, similar to int64 -> int32 narrowing. Binding already handles the sentinels: unary predicates simplify to `AlwaysFalse`/`AlwaysTrue`, and set predicates drop the impossible members (#1870).
related to #1870 and #1872
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(literals): reject out-of-range int64-date conversion [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #1877:
URL: https://github.com/apache/iceberg-go/pull/1877#discussion_r3864517206
##########
exprs_test.go:
##########
@@ -999,6 +999,38 @@ func TestBindAboveBelowIntMax(t *testing.T) {
}
}
+func TestBindOutOfRangeDate(t *testing.T) {
+ sc := iceberg.NewSchema(1,
+ iceberg.NestedField{ID: 1, Name: "d", Type: iceberg.PrimitiveTypes.Date},
+ )
+
+ ref := iceberg.Reference("d")
+ above, below := int64(math.MaxInt32)+1, int64(math.MinInt32)-1
+
+ tests := []struct {
+ name string
+ pred iceberg.BooleanExpression
+ expected iceberg.BooleanExpression
+ }{
+ {"eq above max", iceberg.EqualTo(ref, above), iceberg.AlwaysFalse{}},
+ {"eq below min", iceberg.EqualTo(ref, below), iceberg.AlwaysFalse{}},
+ {"neq above max", iceberg.NotEqualTo(ref, above), iceberg.AlwaysTrue{}},
+ {"in mixed range", iceberg.IsIn(ref, int64(34), above, below), iceberg.EqualTo(ref, iceberg.Date(34))},
Review Comment:
This case (along with the two set cases below it) currently fails because the branch does not contain PR #1872's sentinel filtering for `IN`/`NOT IN`, and #1872 is still open rather than present on `main`. The sentinels remain in the bound set instead of simplifying to the expected predicate. Please rebase after #1872 merges, stack this PR on it, or include the required set-binding change so the PR is independently green.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(literals): reject out-of-range int64-date conversion [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #1877:
URL: https://github.com/apache/iceberg-go/pull/1877
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org