You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2026/10/01 18:41:34 UTC

[I] IsIn/NotIn with two or more VariantLiterals panics: hash of unhashable type iceberg.VariantLiteral [iceberg-go]

zeroshade opened a new issue, #2093:
URL: https://github.com/apache/iceberg-go/issues/2093

   **Problem**
   
   `literalSet.addliteral` keys most literals by the literal itself (utils.go:141 on main: `l[v] = struct{ orig Literal }{}`). `VariantLiteral` is a `variant.Value`, which holds `[]byte`, so it isn't comparable and the map insert panics. `SetPredicate` builds that set whenever it gets two or more literals (exprs.go:911), so `IsIn`/`NotIn` with variant values panic at construction, even though `LiteralType` admits `variant.Value`. A single value only works because `SetPredicate` folds it into `EqualTo`/`NotEqualTo`.
   
   Binary, fixed and geo literals already avoid this by keying on `maphash.Bytes` (utils.go:131-139, and the matching cases in `Contains`).
   
   **Reproduction**
   
   ```go
   build := func(v any) variant.Value {
   	var b variant.Builder
   	_ = b.Append(v)
   	val, _ := b.Build()
   	return val
   }
   
   iceberg.IsIn(iceberg.Reference("x"), build(int64(1)), build(int64(2)))
   ```
   
   On main (dd935d8):
   
   ```
   panic: runtime error: hash of unhashable type iceberg.VariantLiteral
   github.com/apache/iceberg-go.literalSet.addliteral(...)
   	utils.go:141
   github.com/apache/iceberg-go.newLiteralSet(...)
   	utils.go:125
   github.com/apache/iceberg-go.SetPredicate(...)
   	exprs.go:911
   github.com/apache/iceberg-go.IsIn[...](...)
   	predicates.go:61
   ```
   
   Expected: an unbound set predicate. With #2088, binding it against a primitive column converts each value the same way `EqualTo` does.
   
   **Proposed fix**
   
   Add a `VariantLiteral` case to `addliteral` and `Contains` that keys on a hash of the metadata and value bytes (the bytes `VariantLiteral.Equals` compares) and confirms with `Equals`, like the binary/fixed/geo cases. Hashing only the value bytes isn't enough, since object field IDs index into the metadata dictionary. Add a test that builds and binds `IsIn` with two variant values.
   
   **Related**
   
   - #2088 / #2081: `VariantLiteral.To` now converts primitive variants, so set predicates over variant values become usable
   


-- 
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.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: [I] IsIn/NotIn with two or more VariantLiterals panics: hash of unhashable type iceberg.VariantLiteral [iceberg-go]

Posted by "Revanth14 (via GitHub)" <gi...@apache.org>.
Revanth14 commented on issue #2093:
URL: https://github.com/apache/iceberg-go/issues/2093#issuecomment-5943416848

   opened #2097 to fix this


-- 
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: [I] IsIn/NotIn with two or more VariantLiterals panics: hash of unhashable type iceberg.VariantLiteral [iceberg-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #2093: IsIn/NotIn with two or more VariantLiterals panics: hash of unhashable type iceberg.VariantLiteral
URL: https://github.com/apache/iceberg-go/issues/2093


-- 
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: [I] IsIn/NotIn with two or more VariantLiterals panics: hash of unhashable type iceberg.VariantLiteral [iceberg-go]

Posted by "Revanth14 (via GitHub)" <gi...@apache.org>.
Revanth14 commented on issue #2093:
URL: https://github.com/apache/iceberg-go/issues/2093#issuecomment-5942490442

   will work on this issue and raise PR soon.
   @zeroshade 


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