Yep, looks like is not jdbc driver issue, but hive-server2 itself. Setting platform's lang to utf8 might be a requirement for Hive-server2 in this scenario, as I am not aware of any hive-specific properties to control character encodings. Not sure if anyone else has any insight?
Thanks, Szehon On Mon, Dec 9, 2013 at 1:07 AM, ch huang <justlo...@gmail.com> wrote: > hi,i add the following code into /etc/init.d/hive-server2 script ,now the > character can be show normally,but i hope it can be handle with out any > change of the hive file > > export LANG="zh_CN.UTF-8" > > On Sat, Dec 7, 2013 at 1:07 PM, Szehon Ho <sze...@cloudera.com> wrote: > >> I took a closer look. I tried the new JDBC Driver >> (org.apache.hive.jdbc.HiveDriver) against Hive-Server2, and it displays >> Japanese characters properly without any special configurations. >> >> Can you take a look at >> HIVE-3245<https://issues.apache.org/jira/browse/HIVE-3245> for >> details, and see if that configuration works for you? Make sure your Jdbc >> application's encoding is set correctly to UTF8 like it describes. >> >> Thanks, >> Szehon >> >> >> On Fri, Dec 6, 2013 at 12:21 PM, Szehon Ho <sze...@cloudera.com> wrote: >> >>> Looks like the issue is tracked from HIVE-3245. I think we need to >>> support adding encoding parameter as part of jdbc url similar to mysql >>> jdbc's useUnicode/characterEncoding flags. >>> >>> I can take a look at it if nobody else has. For now, I think you can >>> manually encode the result value from jdbc. >>> >>> Thanks, >>> Szehon >>> >>> >>> On Thu, Dec 5, 2013 at 7:43 PM, ch huang <justlo...@gmail.com> wrote: >>> >>>> hi,maillist: >>>> we use hive to store UTF8 chinese character ,but query >>>> through hive jdbc ,it become some unreadable characters,it's normal to use >>>> hive shell.why? it's a bug in hive jdbc?how can i solve this? >>>> >>> >>> >> >