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 A28B210DC3 for ; Fri, 7 Mar 2014 23:06:50 +0000 (UTC) Received: (qmail 73533 invoked by uid 500); 7 Mar 2014 23:06:48 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 73469 invoked by uid 500); 7 Mar 2014 23:06:47 -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 73457 invoked by uid 99); 7 Mar 2014 23:06:47 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 23:06:47 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id A63561D4C79; Fri, 7 Mar 2014 23:06:45 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5647982807684925708==" MIME-Version: 1.0 Subject: Re: Review Request 18925: HIVE-6575 select * fails on parquet table with map datatype From: "Xuefu Zhang" To: "justin coffey" , "Xuefu Zhang" , "Brock Noland" Cc: "Szehon Ho" , "hive" Date: Fri, 07 Mar 2014 23:06:45 -0000 Message-ID: <20140307230645.2625.40999@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Xuefu Zhang" X-ReviewGroup: hive X-ReviewRequest-URL: https://reviews.apache.org/r/18925/ X-Sender: "Xuefu Zhang" References: <20140307222011.2625.4474@reviews.apache.org> In-Reply-To: <20140307222011.2625.4474@reviews.apache.org> Reply-To: "Xuefu Zhang" X-ReviewRequest-Repository: hive-git --===============5647982807684925708== 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/#review36578 ----------------------------------------------------------- ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/AbstractParquetMapInspector.java I don't think we should check the class equality here. A child class might inherit a parent class w/o any new identifier. In that case the child class can still be equal to the parent class. It's really up to the child class to decide the equality (by overriding the equal()). ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/AbstractParquetMapInspector.java 1. code style: we may need {} for else if block 2. However, I think this might be refactored as follows for easier understanding: boolean keyEq = (keyInspector == null && other.keyInspector == null) || keyInspector.equal(other.keyInspector); boolean valEq = (ValueInspector == null && other.valueInspector == null) || valueInspector.equal(other.valueInspector); return keyEq && valEq; - Xuefu Zhang On March 7, 2014, 10:20 p.m., Szehon Ho wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/18925/ > ----------------------------------------------------------- > > (Updated March 7, 2014, 10:20 p.m.) > > > Review request for hive, Brock Noland, justin coffey, and Xuefu Zhang. > > > 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 > ----- > > 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 > > --===============5647982807684925708==--