hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaoyu Tang (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (HIVE-5456) Queries fail on avro backed table with empty partition
Date Fri, 18 Jul 2014 19:10:05 GMT

     [ https://issues.apache.org/jira/browse/HIVE-5456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Chaoyu Tang reopened HIVE-5456:
-------------------------------

      Assignee: Chaoyu Tang

This problem is still existing in trunk Hive-0.14.0 as of today (7/17/2014). The  cause is
that the properties used in createDummyFileForEmptyPartition only contain those from a partition,
thus missing the Avro schema url/literal which might only exist as a table property. 

> Queries fail on avro backed table with empty partition 
> -------------------------------------------------------
>
>                 Key: HIVE-5456
>                 URL: https://issues.apache.org/jira/browse/HIVE-5456
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.11.0
>            Reporter: Prasad Mujumdar
>            Assignee: Chaoyu Tang
>
> The following query fails
> {noformat}
> DROP TABLE IF EXISTS episodes_partitioned;
> CREATE TABLE episodes_partitioned
> PARTITIONED BY (doctor_pt INT)
> 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'
> TBLPROPERTIES ('avro.schema.literal'='{
>   "namespace": "testing.hive.avro.serde",
>   "name": "episodes",
>   "type": "record",
>   "fields": [
>     {
>       "name":"title",
>       "type":"string",
>       "doc":"episode title"
>     },
>     {
>       "name":"air_date",
>       "type":"string",
>       "doc":"initial date"
>     },
>     {
>       "name":"doctor",
>       "type":"int",
>       "doc":"main actor playing the Doctor in episode"
>     }
>   ]
> }');
> ALTER TABLE episodes_partitioned ADD PARTITION (doctor_pt=4);
> ALTER TABLE episodes_partitioned ADD PARTITION (doctor_pt=5);
> SELECT COUNT(*) FROM episodes_partitioned;
> {noformat}
> with following exception 
> {noformat}
> java.io.IOException: org.apache.hadoop.hive.serde2.avro.AvroSerdeException: Neither avro.schema.literal
nor avro.schema.url specified, can't determine table schema
>         at org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat.getHiveRecordWriter(AvroContainerOutputFormat.java:61)
>         at org.apache.hadoop.hive.ql.exec.Utilities.createEmptyFile(Utilities.java:2869)
>         at org.apache.hadoop.hive.ql.exec.Utilities.createDummyFileForEmptyPartition(Utilities.java:2901)
>         at org.apache.hadoop.hive.ql.exec.Utilities.getInputPaths(Utilities.java:2825)
>         at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:381)
>         at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:136)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151)
>         at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1409)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1187)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1015)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:883)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
>         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.processLine(CliDriver.java:348)
>         at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:446)
>         at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:456)
>         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:737)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message