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 DC1E9109C9 for ; Thu, 19 Sep 2013 10:36:05 +0000 (UTC) Received: (qmail 44616 invoked by uid 500); 19 Sep 2013 10:35:55 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 44506 invoked by uid 500); 19 Sep 2013 10:35:53 -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 44487 invoked by uid 500); 19 Sep 2013 10:35:52 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 44482 invoked by uid 99); 19 Sep 2013 10:35:51 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Sep 2013 10:35:51 +0000 Date: Thu, 19 Sep 2013 10:35:51 +0000 (UTC) From: "Neha Tomar (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-5319) Executing SELECT on an AVRO table fails after executing ALTER to modify type of an existing column 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-5319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13771780#comment-13771780 ] Neha Tomar commented on HIVE-5319: ---------------------------------- Pasting the exception trace below. Failed with exception java.io.IOException:org.apache.avro.AvroTypeException: Found "long", expecting "int" 13/09/19 16:03:46 ERROR CliDriver: Failed with exception java.io.IOException:org.apache.avro.AvroTypeException: Found "long", expecting "int" java.io.IOException: org.apache.avro.AvroTypeException: Found "long", expecting "int" at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:544) at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:488) at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136) at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.apache.hadoop.util.RunJar.main(RunJar.java:212) Caused by: org.apache.avro.AvroTypeException: Found "long", expecting "int" at org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:231) at org.apache.avro.io.parsing.Parser.advance(Parser.java:88) at org.apache.avro.io.ValidatingDecoder.readInt(ValidatingDecoder.java:82) at org.apache.avro.generic.GenericDatumReader.readInt(GenericDatumReader.java:341) at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:146) at org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:166) at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:138) at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:129) at org.apache.avro.file.DataFileStream.next(DataFileStream.java:233) at org.apache.avro.file.DataFileStream.next(DataFileStream.java:220) at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.next(AvroGenericRecordReader.java:140) at org.apache.hadoop.hive.ql.io.avro.AvroGenericRecordReader.next(AvroGenericRecordReader.java:49) at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:514) ... 13 more > Executing SELECT on an AVRO table fails after executing ALTER to modify type of an existing column > -------------------------------------------------------------------------------------------------- > > Key: HIVE-5319 > URL: https://issues.apache.org/jira/browse/HIVE-5319 > Project: Hive > Issue Type: Bug > Affects Versions: 0.11.0 > Environment: Linux Ubuntu > Reporter: Neha Tomar > Labels: avro > > 1 >> Created a table in Hive with AVRO data. > CREATE EXTERNAL TABLE tweets (username string, tweet string, timestamp bigint) > COMMENT 'A table backed by Avro data with the Avro schema stored in HDFS' > ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' > STORED AS > INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' > OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat' > LOCATION '/home/neha/test_data/avro_create_data' > TBLPROPERTIES ('avro.schema.literal'='{"namespace":"com.miguno.avro","name":"Tweet","type":"record","fields":[ {"name" : "username","type" : "string","doc" : "Name of the user account on Twitter.com"},{"name" : "tweet","type":"string","doc" : "The content of the Twitter message"}, {"name" : "timestamp", "type" : "long", "doc" : "Unix epoch time in seconds"}]}'); > 2 >> Altered type of a column (to a compatible type) using ALTER TABLE. In this example, altered type for column "timestamp" from "long" to "int". > ALTER TABLE tweets SET TBLPROPERTIES ('avro.schema.literal'='{"namespace":"com.miguno.avro","name":"Tweet","type":"record","fields":[ {"name" : "username","type" : "string","doc" : "Name of the user account on Twitter.com"},{"name" : "tweet","type":"string","doc" : "The content of the Twitter message"}, {"name" : "timestamp", "type" : "int", "doc" : "Unix epoch time in seconds"}]}'); > 3 >> Now, a select query on this table fails with following error. > hive> select * from tweets; > OK > Failed with exception java.io.IOException:org.apache.avro.AvroTypeException: Found "long", expecting "int" > Time taken: 4.514 seconds -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira