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 5897110F8D for ; Sat, 8 Mar 2014 00:01:25 +0000 (UTC) Received: (qmail 71108 invoked by uid 500); 8 Mar 2014 00:01:22 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 71044 invoked by uid 500); 8 Mar 2014 00:01:21 -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 70968 invoked by uid 99); 8 Mar 2014 00:01:19 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Mar 2014 00:01:19 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 28F8F1D4C79; Sat, 8 Mar 2014 00:01:17 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2860868280866032623==" MIME-Version: 1.0 Subject: Re: Review Request 18925: HIVE-6575 select * fails on parquet table with map datatype From: "Szehon Ho" To: "justin coffey" , "Xuefu Zhang" , "Brock Noland" Cc: "Szehon Ho" , "hive" Date: Sat, 08 Mar 2014 00:01:16 -0000 Message-ID: <20140308000116.2625.55936@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Szehon Ho" X-ReviewGroup: hive X-ReviewRequest-URL: https://reviews.apache.org/r/18925/ X-Sender: "Szehon Ho" References: <20140307222011.2625.4474@reviews.apache.org> In-Reply-To: <20140307222011.2625.4474@reviews.apache.org> Reply-To: "Szehon Ho" X-ReviewRequest-Repository: hive-git --===============2860868280866032623== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/18925/ ----------------------------------------------------------- (Updated March 8, 2014, 12:01 a.m.) Review request for hive, Brock Noland, justin coffey, and Xuefu Zhang. Changes ------- Fixed the styling of generated equals code. I looked at the proposed refactor, I think the simplication you suggested would hit NPE if this.keyInspector is null and other.keyInspector != null. Given that you would need a few more boolean statements in that line to make it correct, it seems that the current one is probably the cleanest to look at. Repository: hive-git Description ------- The issue is, as part of select * query, a DeepParquetHiveMapInspector is used for one column of an overall parquet-table struct object inspector. The problem lies in the ObjectInspectorFactory's cache for struct object inspector. For performance, there is a cache keyed on an array list, of all object inspectors of columns. The second time the query is run, it attempts to lookup cached struct inspector. But when the hashmap looks up the part of the key consisting of the DeepParquetHiveMapInspector, java calls .equals against the existing DeepParquetHivemapInspector. This fails, as the .equals method casted the "other" to a "StandardParquetHiveInspector". Regenerating the .equals and .hashcode from eclipse. Also adding one more check in .equals before casting, to handle the case if another class of object inspector gets hashed to the same hashcode in the cache. Then java would call .equals against the other, which in this case is not of the same class. Diffs (updated) ----- ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/AbstractParquetMapInspector.java 1d72747 Diff: https://reviews.apache.org/r/18925/diff/ Testing ------- Manual testing. Thanks, Szehon Ho --===============2860868280866032623==--