3

I am trying to change the partition location of my external hive table.

Command that I try to run:

ALTER TALBE sl_uploads PARTITION (hivetimestamp='2016-07-26 15:00:00') SET LOCATION '/data/dev/event/uploads/hivetimestamp=2016-07-26 15:00:00'

Error I get :

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.net.URISyntaxException: Illegal character in path

My data for a particular partition exists at the path:

/data/dev/event/uploads/hivetimestamp=date time/actual_data

I think space is creating an issue. But any help on this would be great.

Ronak Patel
  • 3,819
  • 1
  • 16
  • 29
Austin
  • 135
  • 4
  • 17
  • try escaping the space using \ : SET LOCATION '/data/dev/event/uploads/hivetimestamp=2016-07-26\ 15:00:00' – K S Nidhin Jul 28 '16 at 19:12
  • No that does not work. It still gives the same error. I had tried that before in order to skip the space character. – Austin Jul 29 '16 at 21:41

3 Answers3

0

your hdfs in path is right?

add /actual_data/?

Joker
  • 41
  • 3
  • 10
0

Hive is unable to read the full hdfs path due to space in "2016-07-26 15:00:00"; you can use below commands;

hive> set part=2016-07-26 15:00:00;
hive>ALTER TALBE sl_uploads PARTITION (hivetimestamp='2016-07-26 15:00:00') SET LOCATION '/data/dev/event/uploads/hivetimestamp=@part';
Neethu Lalitha
  • 3,031
  • 4
  • 35
  • 60
  • It sets the part and alters the partition location but when i run the select count(*) from sl_uploads where hivetimestamp='2016-07-26 15:00:00' it does not work. It gives the error: FAILED: SemanticException java.io.FileNotFoundException: File hdfs://data/dev/event/uploads/hivetimestamp=@part does not exist. – Austin Jul 29 '16 at 21:42
0

First thing i saw that, you wrote TALBE instead of TABLE.

Prabhat jha
  • 519
  • 4
  • 6