Hive
  1. Hive
  2. HIVE-5974

chinese character can not display normally when use hive jdbc 0.10.0

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: HiveServer2
    • Labels:
      None
    • Environment:

      OS : redhat6.2 hadoop CDH4.4 hive 0.10.0 hive-server2

      Description

      when i query table using hive jdbc which content contains chinese characters ,it can not be display normally

      1. 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++; }

      }
      }

        Activity

        alex kim created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            alex kim
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development