1

I am new to Hive, Can anybody please help me with the below Error I receive when trying to create the following table:

hive> create table Employees(
    > name String,
    > salary float,
    > subordinates array<string>,
    > deductions map<string,float>,
    > address struct<street:string,city:string,state:string>)
    > row format serde
    > 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe' << **this one is present in "hive-contrib"**
    > with serdeproperties ("field.delim"=",")
    > location 'Mytable/employee'; **<< This is in my HDFS location.** 

The error is:

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: hdfs://localhost:9000./Mytable/employee)**

My data takes the form:

JSON :

{
"name":"Manager",
"salary":10000.0,
"subordinates": ["Emp1", "Emp2"],
"deductions":{
   "State Tax":0.1,
   "Insurance":2,   
},
"address":{
"street":"1 Ave",
"city":"Chicago",
"state":"IL"
}
}

Thanks in advance.

1 Answer 1

1

location should be an absolute path. If you really want your data to be in hdfs://localhost:9000/Mytable/employee, you should replace the last line with:

location '/Mytable/employee';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.