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 244E610707 for ; Thu, 5 Dec 2013 22:52:36 +0000 (UTC) Received: (qmail 9660 invoked by uid 500); 5 Dec 2013 22:52:35 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 9584 invoked by uid 500); 5 Dec 2013 22:52:35 -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 9519 invoked by uid 500); 5 Dec 2013 22:52:35 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 9500 invoked by uid 99); 5 Dec 2013 22:52:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Dec 2013 22:52:35 +0000 Date: Thu, 5 Dec 2013 22:52:35 +0000 (UTC) From: "Eric Chu (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-5623) ORC accessing array column that's empty will fail with java out of bound exception 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-5623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eric Chu updated HIVE-5623: --------------------------- Labels: orcfile (was: ) > ORC accessing array column that's empty will fail with java out of bound exception > ---------------------------------------------------------------------------------- > > Key: HIVE-5623 > URL: https://issues.apache.org/jira/browse/HIVE-5623 > Project: Hive > Issue Type: Bug > Components: File Formats > Affects Versions: 0.11.0 > Reporter: Eric Chu > Priority: Critical > Labels: orcfile > > In our ORC tests we saw that queries that work on RCFile failed on the corresponding ORC version with Java IndexOutOfBoundsException in OrcStruct.java. The queries failed b/c the table has an array type column and there are rows with an empty array. We noticed that the getList(Object list, int i) method in OrcStruct.java simply returns the i-th element from list without checking if list is not null or if i is within valid range. After fixing that the queries run fine. The fix is really simple, but maybe there are other similar cases that need to be handled. > The fix is to check if listObj is null and if i falls within range: > public Object getListElement(Object listObj, int i) { > if (listObj == null) { > return null; > } > List list = ((List) listObj); > if (i < 0 || i >= list.size()) { > return null; > } > return list.get(i); > } -- This message was sent by Atlassian JIRA (v6.1#6144)