Create a table in the Hive metastore using the Avro file format

While creating a hive table using avro format, we are using 3 back slashes(hdfs:///user) for LOCATION where as for TBLPROPERTIES 2 back slashes(hdfs://quickstart).

Copied the code from github for reference below:
LOCATION ‘hdfs:**///user/hive/warehouse/retail_stage.db/customers’
TBLPROPERTIES (‘avro.schema.url’='hdfs:
//**quickstart.cloudera/user/cloudera/retail_stage/sqoop_import_customers.avsc’);

Kindly explain. Thanks in Advance.

Hi Subbu,

The only difference between the 2 statements is the hostname. In both statements, we can either mention the hostname in the path as “hdfs://quickstart.cloudera/user/hive/warehouse/retail_stage.db/customers” for LOCATION and “hdfs://quickstart.cloudera/user/cloudera/retail_stage/sqoop_import_customers.avsc” for schema url OR we can skip the hostname if we are already on that host and specify the LOCATION as “hdfs:///user/hive/warehouse/retail_stage.db/customers” and schemal url as “hdfs:///user/cloudera/retail_stage/sqoop_import_customers.avsc”.