rdblue commented on code in PR #8149:
URL: https://github.com/apache/iceberg/pull/8149#discussion_r1277846249


##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java:
##########
@@ -176,6 +223,28 @@ public static String describe(Term term) {
     }
   }
 
+  public static <T> UnboundTerm<T> unbind(BoundTerm<T> term) {
+    if (term instanceof BoundTransform) {
+      BoundTransform<?, T> bound = (BoundTransform<?, T>) term;
+      return Expressions.transform(bound.ref().name(), bound.transform());
+    } else if (term instanceof BoundReference) {
+      return Expressions.ref(((BoundReference<T>) term).name());
+    }
+
+    throw new UnsupportedOperationException("Cannot unbind unsupported term: " 
+ term);
+  }
+
+  @SuppressWarnings("unchecked")
+  public static <T> UnboundTerm<T> unbind(Term term) {

Review Comment:
   I think it's useful so I'd probably keep it. Since we are adding the ability 
to unbind terms, it seems like doing both versions at once is the right thing 
to do.



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