You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Peter Vary (JIRA)" <ji...@apache.org> on 2016/06/15 13:35:09 UTC

[jira] [Commented] (HIVE-14013) Describe table doesn't show unicode properly

    [ https://issues.apache.org/jira/browse/HIVE-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331761#comment-15331761 ] 

Peter Vary commented on HIVE-14013:
-----------------------------------

Hi,

I have stumbled upon your patch, and I think it would be useful to apply your escaping to every comment field, like:

+++ ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatUtils.java	(revision )
@@ -231,7 +233,7 @@
         appendColumnStatsNoFormatting(colBuffer, "", "", "", "", "", "", "", "");
       }
     }
-    colBuffer.append(comment == null ? "" : comment);
+    colBuffer.append(comment == null ? "" : HiveStringUtils.escapeJava(comment));
     colBuffer.append(LINE_DELIM);
   }
 
@@ -266,7 +268,7 @@
     IndexType indexType = HiveIndex.getIndexTypeByClassName(indexHandlerClass);
     indexColumns.add(indexType.getName());
 
-    indexColumns.add(index.getParameters().get("comment"));
+    indexColumns.add(HiveStringUtils.escapeJava(index.getParameters().get("comment")));
 
     formatOutput(indexColumns.toArray(new String[0]), indexInfo);
 
Regards,
Peter

> Describe table doesn't show unicode properly
> --------------------------------------------
>
>                 Key: HIVE-14013
>                 URL: https://issues.apache.org/jira/browse/HIVE-14013
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>    Affects Versions: 2.2.0
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>         Attachments: HIVE-14013.1.patch
>
>
> Describe table output will show comments incorrectly rather than the unicode itself.
> {noformat}
> hive> desc formatted t1;
> # Detailed Table Information             
> Table Type:             MANAGED_TABLE            
> Table Parameters:                
>         COLUMN_STATS_ACCURATE   {\"BASIC_STATS\":\"true\"}
>         comment                 \u8868\u4E2D\u6587\u6D4B\u8BD5
>         numFiles                0                   
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)