piotrek
piotrek

Reputation: 14520

hive: external partitioned table without location

Is it possible to create external partitioned table without location? I want to add all the locations later, together with partitions.

i tried:

CREATE EXTERNAL TABLE IF NOT EXISTS a.b
(line STRING)
COMMENT 'abc'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\n'
STORED AS TEXTFILE
PARTITIONED BY day;

but i got ParseException: missing EOF at 'PARTITIONED' near 'TEXTFILE'

Upvotes: 0

Views: 804

Answers (2)

Tremo
Tremo

Reputation: 599

I don't think so, as said in alter location. But anyway, i think your query as some errors and the correct script would be :

CREATE EXTERNAL TABLE IF NOT EXISTS a.b
 (line STRING)
 COMMENT 'abc'
 PARTITIONED BY (day String)
 ROW FORMAT DELIMITED FIELDS TERMINATED BY '\n'
 STORED AS TEXTFILE
;

Upvotes: 1

Geetika Goyal
Geetika Goyal

Reputation: 71

I think the issue is that you have not specified data type for your partition column "day". And you can create a HIVE external table without location and can use ALTER table options later to change the location.

Upvotes: 0

Related Questions