You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/12/22 13:19:44 UTC

[GitHub] [iceberg] xiaotianzhang01 commented on a change in pull request #3728: Spark: Generate Spark's SQL literal format for binary and update the toString representation of binary/fixed literals.

xiaotianzhang01 commented on a change in pull request #3728:
URL: https://github.com/apache/iceberg/pull/3728#discussion_r773880957



##########
File path: api/src/main/java/org/apache/iceberg/expressions/Literals.java
##########
@@ -126,7 +127,17 @@ public final ByteBuffer toByteBuffer() {
 
     @Override
     public String toString() {
-      return String.valueOf(value);
+      if (value == null) {
+        return "null";
+      }
+
+      switch (typeId()) {
+        case FIXED:
+        case BINARY:
+          return "0x" + BaseEncoding.base16().encode((toByteBuffer().array()));
+        default:
+          return String.valueOf(value);
+      }

Review comment:
       ok, thanks for your reply




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