I’d like to use this query to create a partitioned table in Amazon Athena:
CREATE TABLE IF NOT EXISTS testing.partitioned_test(order_id bigint, name string, car string, country string) PARTITIONED BY (year int) ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' STORED AS 'PARQUET' LOCATION 's3://testing-imcm-into/partitions'
Unfortunately I don’t get the error message which tells me the following:
line 3:2: mismatched input ‘partitioned’ expecting {, ‘with’}
Advertisement
Answer
The quotes around 'PARQUET'
seemed to be causing a problem.
Try this:
CREATE EXTERNAL TABLE IF NOT EXISTS partitioned_test (order_id bigint, name string, car string, country string) PARTITIONED BY (year int) STORED AS PARQUET LOCATION 's3://testing-imcm-into/partitions/'