[ 
https://issues.apache.org/jira/browse/HIVE-2905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiaozhe Wang updated HIVE-2905:
-------------------------------

    Labels: patch  (was: )
    Status: Patch Available  (was: Open)

The problem is 
org.apache.hadoop.hive.ql.metadata.formatting.TextMetaDataFormatter.describeTable()
 use DataOutputStream.writeBytes() to output column info string. Unfortunately, 
DataOutputStream.writeBytes() will only write out lower byte of each character 
in the String, which cause garbling problem when column comment contains 
non-latin1 characters.

This simple patch solved Unicode character garbling problem when describe table 
in Hive client.
                
> Desc table can't read Chinese (UTF-8 character code)
> ----------------------------------------------------
>
>                 Key: HIVE-2905
>                 URL: https://issues.apache.org/jira/browse/HIVE-2905
>             Project: Hive
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 0.10.0, 0.7.0
>         Environment: hive 0.7.0, mysql 5.1.45
> hive 0.10.0, mysql 5.5.30
>            Reporter: Sheng Zhou
>              Labels: patch
>
> When desc a table with command line or hive jdbc way, the table's comment 
> can't be read.
> 1. I have updated javax.jdo.option.ConnectionURL parameter in hive-site.xml 
> file.
>    jdbc:mysql://*.*.*.*:3306/hive?characterEncoding=UTF-8
> 2. In mysql database, the comment field of COLUMNS table can be read normally.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to