hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "alex kim (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-5974) chinese character can not display normally when use hive jdbc 0.10.0
Date Fri, 06 Dec 2013 06:15:36 GMT

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

alex kim commented on HIVE-5974:
--------------------------------

use beeline test result is same

# beeline
Beeline version 0.10.0-cdh4.4.0 by Apache Hive
beeline> !connect jdbc:hive2://192.168.10.223:10000
scan complete in 2ms
Connecting to jdbc:hive2://192.168.10.223:10000
Enter username for jdbc:hive2://192.168.10.223:10000:
Enter password for jdbc:hive2://192.168.10.223:10000:
Connected to: Hive (version 0.10.0)
Driver: Hive (version 0.10.0-cdh4.4.0)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://192.168.10.223:10000> select * from test_alex;
+-----+-------+--------+
| id  | name  | email  |
+-----+-------+--------+
| 1   | ????  | ??     |
+-----+-------+--------+
1 row selected (0.377 seconds)


> chinese character can not display normally when use hive jdbc 0.10.0
> --------------------------------------------------------------------
>
>                 Key: HIVE-5974
>                 URL: https://issues.apache.org/jira/browse/HIVE-5974
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 0.10.0
>         Environment: OS : redhat6.2     hadoop CDH4.4  hive 0.10.0 hive-server2
>            Reporter: alex kim
>            Priority: Critical
>
> when i query table using hive jdbc which content contains chinese characters ,it can
not be display normally
> # hive -S -e "select * from test_alex"
> 1       我的测试        测试
> run java code using hive jdbc output 
> 1:????:??
> here is my test code
> import java.sql.Connection;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.sql.Statement;
>   
>   public class DemoHive {
> 	        
>             public static void main(String[] args) throws  Exception {
>        
>                 Class.forName("org.apache.hive.jdbc.HiveDriver");
>                 
>                 Connection hiveConn  =  DriverManager.getConnection("jdbc:hive2://192.168.10.223:10000/default",""
,"");
>                 
>                 Statement stat =hiveConn.createStatement(); 
>                 ResultSet rs = stat.executeQuery( "select * from test_alex" );
>                 int i=1;
>                 while(rs.next())
>                 {
>                     System.out.println(i+":"+rs.getString("name")+":"+rs.getString("email"));
>                     i++;
>                 }
>             }
>         }



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message