izchen commented on a change in pull request #3460:
URL: https://github.com/apache/iceberg/pull/3460#discussion_r750612304



##########
File path: api/src/main/java/org/apache/iceberg/expressions/Literals.java
##########
@@ -639,5 +647,12 @@ Object writeReplace() throws ObjectStreamException {
     protected Type.TypeID typeId() {
       return Type.TypeID.BINARY;
     }
+
+    @Override
+    public String toString() {
+      byte[] binary = new byte[value().remaining()];
+      value().duplicate().get(binary);
+      return "0x" + BaseEncoding.base16().encode(binary);

Review comment:
       This should just be for debugging.
   
   In the base class, the toString method is `String.valueOf(value)` (In 
StringLiteral, it is `"\"" + value() + "\""`).
   
   For other types of literals, the return value of toString is clear. But for 
ByteBuffer, the return value is `java.nio.HeapByteBuffer[pos=0 lim=16 cap=16]`.
   
   So I implemented the literal toString method of  ByteBuffer type, for 
logging.




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