Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 014C518FF7 for ; Fri, 2 Oct 2015 18:42:30 +0000 (UTC) Received: (qmail 4792 invoked by uid 500); 2 Oct 2015 18:42:26 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 4504 invoked by uid 500); 2 Oct 2015 18:42:26 -0000 Mailing-List: contact issues-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 issues@hive.apache.org Received: (qmail 4491 invoked by uid 99); 2 Oct 2015 18:42:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2015 18:42:26 +0000 Date: Fri, 2 Oct 2015 18:42:26 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-11977) Hive should handle an external avro table with zero length files present 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-11977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14941548#comment-14941548 ] Ashutosh Chauhan commented on HIVE-11977: ----------------------------------------- Thanks for patch [~dossett] A 0-length file is an invalid Avro file, as in Avro's {{DataFileWriter}} will always write MAGIC header for version. Thats the reason {{DataFileReader}} expects it and throws up when it doesn't get one. It seems these 0 length files got there because of some faulty generator process. Isn't it better to just not generate those 0 length files. Or, alternatively, delete these faulty files. > Hive should handle an external avro table with zero length files present > ------------------------------------------------------------------------ > > Key: HIVE-11977 > URL: https://issues.apache.org/jira/browse/HIVE-11977 > Project: Hive > Issue Type: Bug > Reporter: Aaron Dossett > Assignee: Aaron Dossett > Attachments: HIVE-11977-2.patch, HIVE-11977.patch > > > If a zero length file is in the top level directory housing an external avro table, all hive queries on the table fail. > This issue is that org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader creates a new org.apache.avro.file.DataFileReader and DataFileReader throws an exception when trying to read an empty file (because the empty file lacks the magic number marking it as avro). > AvroGenericRecordReader should detect an empty file and then behave reasonably. > Caused by: java.io.IOException: Not a data file. > at org.apache.avro.file.DataFileStream.initialize(DataFileStream.java:102) > at org.apache.avro.file.DataFileReader.(DataFileReader.java:97) > at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.(AvroGenericRecordReader.java:81) > at org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat.getRecordReader(AvroContainerInputFormat.java:51) > at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:246) > ... 25 more -- This message was sent by Atlassian JIRA (v6.3.4#6332)