You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by dm...@apache.org on 2019/11/08 22:30:22 UTC

[hive] branch master updated: HIVE-22445: LazySimpleSerDe toString Prints Memory Address instead of Value (David Mollitor, reviewed by Miklos Gergely)

This is an automated email from the ASF dual-hosted git repository.

dmollitor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d4ab36  HIVE-22445: LazySimpleSerDe toString Prints Memory Address instead of Value (David Mollitor, reviewed by Miklos Gergely)
4d4ab36 is described below

commit 4d4ab36847b81f551130a7aec343bcf8cda85e28
Author: David Mollitor <dm...@apache.org>
AuthorDate: Fri Nov 8 17:29:44 2019 -0500

    HIVE-22445: LazySimpleSerDe toString Prints Memory Address instead of Value (David Mollitor, reviewed by Miklos Gergely)
---
 .../hadoop/hive/serde2/lazy/LazySimpleSerDe.java   | 25 +++++++++++++++-------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazySimpleSerDe.java b/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazySimpleSerDe.java
index c166d73..1a2266e 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazySimpleSerDe.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazySimpleSerDe.java
@@ -86,14 +86,23 @@ public class LazySimpleSerDe extends AbstractEncodingAwareSerDe {
 
   @Override
   public String toString() {
-    return getClass().toString()
-        + "["
-        + Arrays.asList(serdeParams.getSeparators())
-        + ":"
-        + ((StructTypeInfo) serdeParams.getRowTypeInfo()).getAllStructFieldNames()
-        + ":"
-        + ((StructTypeInfo) serdeParams.getRowTypeInfo())
-            .getAllStructFieldTypeInfos() + "]";
+    StringBuilder sb = new StringBuilder(128);
+    sb.append(getClass() + " [serdeParams=" + serdeParams + ", cachedObjectInspector=" + cachedObjectInspector
+        + ", serializedSize=" + serializedSize + ", stats=" + stats + ", lastOperationSerialize="
+        + lastOperationSerialize + ", lastOperationDeserialize=" + lastOperationDeserialize);
+
+    if (serdeParams != null) {
+      sb.append(' ').append(Arrays.toString(serdeParams.getSeparators()));
+      if (serdeParams.getRowTypeInfo() != null) {
+        sb.append(" : ");
+        sb.append(((StructTypeInfo) serdeParams.getRowTypeInfo()).getAllStructFieldNames());
+        sb.append(" : ");
+        sb.append(((StructTypeInfo) serdeParams.getRowTypeInfo()).getAllStructFieldTypeInfos());
+      }
+    }
+
+    sb.append(']');
+    return sb.toString();
   }
 
   public LazySimpleSerDe() throws SerDeException {