Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BE4E210E71 for ; Mon, 9 Dec 2013 22:56:49 +0000 (UTC) Received: (qmail 28953 invoked by uid 500); 9 Dec 2013 22:56:47 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 28897 invoked by uid 500); 9 Dec 2013 22:56:47 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 28880 invoked by uid 99); 9 Dec 2013 22:56:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:56:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of szehon@cloudera.com designates 74.125.82.45 as permitted sender) Received: from [74.125.82.45] (HELO mail-wg0-f45.google.com) (74.125.82.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:56:41 +0000 Received: by mail-wg0-f45.google.com with SMTP id y10so4182188wgg.12 for ; Mon, 09 Dec 2013 14:56:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=N+QZxM3FGK+IIpJUKQKDj22zFrOppec9XTWQPLZH4JA=; b=M2hhsv8kU7jl/GD2pLgFtCrZkYcL4OsLaGTe0V25cq//Vw2/368DhY+Ng0LzPlVog6 8GZLl+422+p1OM38idnFBlgjVrq09L5Gj/aCR5zQMFPVJJi9X15zHVBufS0GrfDMF12E vExMdFIbiXWilXcYdvK+JYmGatisBitIJwrI7l8qJA8xBtjWRCmi3ElPhMY/sUgUdpGs i/at4z3oHyXX1B2TKbCKEbpIpZ6w/fFe4uEIkqPSEU+uWHYBCYXYecgtPcy2PhDr0Upg DTysdzJAprqwTA174iXHg2TOIdg5UhLbr+Q9ugspN9AluXnNLy1AUtBKwMCjUKot3W4M //sw== X-Gm-Message-State: ALoCoQlb75NwCZnR5L1CuEwNkkIYyZmiGvC4bGG/rzP9DWvorMjZDX1S8R/Djr5gLYyGc76zwici X-Received: by 10.180.109.201 with SMTP id hu9mr16285984wib.59.1386629780912; Mon, 09 Dec 2013 14:56:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.139.72 with HTTP; Mon, 9 Dec 2013 14:56:00 -0800 (PST) In-Reply-To: References: From: Szehon Ho Date: Mon, 9 Dec 2013 14:56:00 -0800 Message-ID: Subject: Re: query though hive jdbc cause chinese character become unrecognizable characters To: "user@hive.apache.org" Content-Type: multipart/alternative; boundary=e89a8f2356bd86e7d604ed21e726 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f2356bd86e7d604ed21e726 Content-Type: text/plain; charset=ISO-8859-1 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 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 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 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 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 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? >>>> >>> >>> >> > --e89a8f2356bd86e7d604ed21e726 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yep, looks like is not jdbc driver issue, but hive-se= rver2 itself. =A0Setting 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. =A0Not sure if anyone else has a= ny insight?

Thanks,
Szehon


On Mon, Dec 9, 2013 at 1:07= AM, ch huang <justlooks@gmail.com> wrote:
hi,i add the following code into /etc/i= nit.d/hive-server2 script ,now the character can be show normally,but i hop= e it can be handle with out any change of the hive file
=A0
export LANG=3D"zh_CN.UTF-8"

On Sat, Dec 7, 2013 at 1:07 PM, Szehon Ho <sz= ehon@cloudera.com> wrote:
I took a closer look. =A0I 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=A0for details, and see if that= configuration works for you? =A0Make sure your Jdbc application's enco= ding is set correctly to UTF8 like it describes.

Thanks,
Szehon


On Fri, Dec 6, 2013 at 12:21 PM, Szehon Ho <s= zehon@cloudera.com> wrote:
Looks like the issue is tracked from HIVE-3245. = =A0I 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. =A0F= or now, I think you can manually encode the result value from jdbc.

Thanks,
Szehon=20


On Thu, Dec 5, 2013 at 7:43 PM, ch huang <jus= tlooks@gmail.com> wrote:
hi,maillist:
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 we use hive to store UTF8 chinese ch= aracter ,but query through hive jdbc ,it become some=A0unreadable character= s,it's normal to use hive shell.why? it's a bug in hive jdbc?how ca= n i solve this?




--e89a8f2356bd86e7d604ed21e726--