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 AC7CA111B2 for ; Fri, 16 May 2014 20:25:32 +0000 (UTC) Received: (qmail 49335 invoked by uid 500); 16 May 2014 18:13:27 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 83555 invoked by uid 500); 16 May 2014 17:48:27 -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 59651 invoked by uid 500); 16 May 2014 17:23:31 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 20916 invoked by uid 99); 16 May 2014 17:20:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 17:20:15 +0000 Date: Fri, 16 May 2014 17:20:15 +0000 (UTC) From: "Xuefu Zhang (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-7049) Unable to deserialize AVRO data when file schema and record schema are different and nullable 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-7049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000010#comment-14000010 ] Xuefu Zhang commented on HIVE-7049: ----------------------------------- It seems that your patch tries to fix the issue by ignoring the file schema ( passing NULL down). File schema is needed to read decimal data correctly. Thus, we might need to fix in a different way. > Unable to deserialize AVRO data when file schema and record schema are different and nullable > --------------------------------------------------------------------------------------------- > > Key: HIVE-7049 > URL: https://issues.apache.org/jira/browse/HIVE-7049 > Project: Hive > Issue Type: Bug > Reporter: Mohammad Kamrul Islam > Assignee: Mohammad Kamrul Islam > Attachments: HIVE-7049.1.patch > > > It mainly happens when > 1 )file schema and record schema are not same > 2 ) Record schema is nullable but file schema is not. > The potential code location is at class AvroDeserialize > > {noformat} > if(AvroSerdeUtils.isNullableType(recordSchema)) { > return deserializeNullableUnion(datum, fileSchema, recordSchema, columnType); > } > {noformat} > In the above code snippet, recordSchema is verified if it is nullable. But the file schema is not checked. > I tested with these values: > {noformat} > recordSchema= ["null","string"] > fielSchema= "string" > {noformat} > And i got the following exception . > {noformat} > org.apache.avro.AvroRuntimeException: Not a union: "string" > at org.apache.avro.Schema.getTypes(Schema.java:272) > at org.apache.hadoop.hive.serde2.avro.AvroDeserializer.deserializeNullableUnion(AvroDeserializer.java:275) > at org.apache.hadoop.hive.serde2.avro.AvroDeserializer.worker(AvroDeserializer.java:205) > at org.apache.hadoop.hive.serde2.avro.AvroDeserializer.workerBase(AvroDeserializer.java:188) > at org.apache.hadoop.hive.serde2.avro.AvroDeserializer.deserialize(AvroDeserializer.java:174) > at org.apache.hadoop.hive.serde2.avro.TestAvroDeserializer.verifyNullableType(TestAvroDeserializer.java:487) > at org.apache.hadoop.hive.serde2.avro.TestAvroDeserializer.canDeserializeNullableTypes(TestAvroDeserializer.java:407) > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)