nssalian commented on code in PR #932:
URL: https://github.com/apache/iceberg-go/pull/932#discussion_r3191466668
##########
exprs.go:
##########
@@ -526,6 +528,49 @@ func (b *boundRef[T]) evalIsNull(st StructLike) bool {
return !v.Valid
}
+type boundVariantRef struct {
+ field NestedField
+ acc accessor
+}
+
+func (*boundVariantRef) isTerm() {}
+func (b *boundVariantRef) Ref() BoundReference { return b }
+func (b *boundVariantRef) Field() NestedField { return b.field }
+func (b *boundVariantRef) Type() Type { return b.field.Type }
+func (b *boundVariantRef) Pos() int { return b.acc.pos }
+func (b *boundVariantRef) Equals(other BoundTerm) bool {
+ rhs, ok := other.(*boundVariantRef)
+ if !ok {
+ return false
+ }
+
+ return b.field.Equals(rhs.field)
+}
+
+func (b *boundVariantRef) PosPath() []int {
+ out, inner := []int{b.acc.pos}, &b.acc
+ for inner.inner != nil {
+ inner = inner.inner
+ out = append(out, inner.pos)
+ }
+
+ return out
+}
+
+func (b *boundVariantRef) String() string {
+ return fmt.Sprintf("BoundReference(field=%s, accessor=%s)", b.field,
&b.acc)
+}
+
+func (b *boundVariantRef) evalToLiteral(StructLike) Optional[Literal] {
+ return Optional[Literal]{}
Review Comment:
Fixed this too. Created a VariantLiteral
--
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]