Error while creating external table in hive


#1

Command:
CREATE EXTERNAL TABLE departments_jo76
> 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 ‘hdfs:////user/siddejyothi76/sqoop_import_avro/departments_jo76’
> TBLPROPERTIES (‘avro.schema.url’=‘hdfs://sandbox.hortonworks.com/user/siddejyothi76/sqoop_import_avro/departments_jo76.avsc’);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:org.apache.hadoop.hive.serd
e2.SerDeException Encountered exception determining schema. Returning signal schema to indicate problem: java.net.UnknownHostException: sandbox.hortonworks.com)

Could some one please let me know what shall be the avro schema URL.


#2

@siva_jyothi
Please check LOCATION url you mentioned. After hdfs there should be 3 backward slashes.
Use this:
LOCATION ‘hdfs:///user/siddejyothi76/sqoop_import_avro/departments_jo76’