Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4C2410352 for ; Fri, 18 Apr 2014 08:22:23 +0000 (UTC) Received: (qmail 83560 invoked by uid 500); 18 Apr 2014 08:22:19 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 83047 invoked by uid 500); 18 Apr 2014 08:22:17 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 83017 invoked by uid 500); 18 Apr 2014 08:22:15 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 83012 invoked by uid 99); 18 Apr 2014 08:22:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2014 08:22:15 +0000 Date: Fri, 18 Apr 2014 08:22:15 +0000 (UTC) From: "Jason Dere (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-6843) INSTR for UTF-8 returns incorrect position MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-6843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13973880#comment-13973880 ] Jason Dere commented on HIVE-6843: ---------------------------------- The string literal does interpret "\uD801" as a single character, and "\uD801\uDC00" as a single code point (got the example character from http://www.oracle.com/technetwork/articles/javase/supplementary-142654.html): {noformat} String str1 = "123\uD801\uDC00456"; System.out.println("str1 length=" + str1.length() + ", codePointCount=" + str1.codePointCount(0, str1.length())); str1 length=8, codePointCount=7 {noformat} So if we count things by unicode code points, the "4" would be at index 4 (for 0-based index). > INSTR for UTF-8 returns incorrect position > ------------------------------------------ > > Key: HIVE-6843 > URL: https://issues.apache.org/jira/browse/HIVE-6843 > Project: Hive > Issue Type: Bug > Components: UDF > Affects Versions: 0.11.0, 0.12.0 > Reporter: Clif Kranish > Assignee: Szehon Ho > Priority: Minor > Attachments: HIVE-6843.patch > > -- This message was sent by Atlassian JIRA (v6.2#6252)