I have stored partitioned data in s3 in hive format like this.
/bucket/date=2017-02-20
/bucket/date=2017-20-25
Now i am running following query from Athena to create partition
CREATE EXTERNAL TABLE hive3(
battery double,
longitude double,
application string,
latitude double,
device_id string,
trip_id string,
id int,
accuracy double,
PARTITIONED BY (date string)
)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
WITH SERDEPROPERTIES ('serialization.format' = '1') LOCATION 's3://bucket/'
Throwing following exception
no viable alternative at input 'create external' (service: amazonathena; status code: 400; error code: invalidrequestexception; request id: 6a4e0852-f8b0-11e6-b606-e52f2622374b)
Any help would be appreciated.
Thanks
PARTITIONED BY (date string)
should be outside the columns definition scope
CREATE EXTERNAL TABLE hive3(
battery double,
longitude double,
application string,
latitude double,
device_id string,
trip_id string,
id int,
accuracy double
)
PARTITIONED BY (date string)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
WITH SERDEPROPERTIES ('serialization.format' = '1')
LOCATION 's3://bucket/'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With