Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.net.URISyntaxException when starting HIVE

Tags:

hadoop

hive

I am new in HIVE. I have already set up hadoop and it works well, and I want to set up Hive. When I start hive , it shows an error as

Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D

Are there any solutions?

like image 627
Exia Avatar asked Nov 24 '14 07:11

Exia


4 Answers

Put the following at the beginning of hive-site.xml

  <property>
    <name>system:java.io.tmpdir</name>
    <value>/tmp/hive/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>

See also question

like image 67
Jonathan L Avatar answered Nov 15 '22 09:11

Jonathan L


Change in hfs-site.xml this properties

<name>hive.exec.scratchdir</name>
<value>/tmp/hive-${user.name}</value>

 <name>hive.exec.local.scratchdir</name>
 <value>/tmp/${user.name}</value>

<name>hive.downloaded.resources.dir</name>
<value>/tmp/${user.name}_resources</value>

<name>hive.scratch.dir.permission</name>
    <value>733</value>

restart hive metastore and hiveserver2

like image 22
Barbaros Yıldız Avatar answered Nov 15 '22 10:11

Barbaros Yıldız


I figure it out myself. In the hive-site.xml, replace ${system:java.io.tmpdir}/${system:user.name} by /tmp/mydir as what has been told in https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration.

like image 15
Exia Avatar answered Nov 15 '22 10:11

Exia


Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D system:java.io.tmpdir - path
system:user.name - username

Above properties are system level properties which need to set by user, So hive site template didn't provide these, required manual configuration.

Set the above properties like using property tag with name value key pair in hive-site.xml, Its upto user level to choose the location of temp

<property>
    <name>system:java.io.tmpdir</name>
    <value>/user/local/hive/tmp/java</value>
  </property>
  <property>
    <name>system:user.name</name>
    <value>${user.name}</value>
  </property>
like image 5
Kanthishere Avatar answered Nov 15 '22 09:11

Kanthishere