1
votes

I'm trying to create an external, partitioned table in Greenplum. Getting the following error on executing the create query:

ERROR: syntax error at or near "PARTITION"

CREATE EXTERNAL TABLE weekly_csv (
product_category text,
tier text,
snapshot_date date
)
LOCATION (
's3://data/weekly_csv/ config=/home/s3.conf')
PARTITION BY RANGE (snapshot_date)
(start('2014-12-05') end ('2020-01-01') every( interval '1 week'))
FORMAT 'csv' (delimiter ',' null as '' header fill missing fields)
ENCODING 'UTF8'
LOG ERRORS SEGMENT REJECT LIMIT 100 ROWS;

Not sure if partitioned external tables are a possibility in Greenplum.

Any help would be appreciated :)

1
This question might be more suited for dba.stackexchange.com. - Robin Green

1 Answers

5
votes
  1. Create a partitioned table
  2. Create external tables for each week of data
  3. Use ALTER TABLE .. EXCHANGE PARTITION to swap the partitions from step 1 with each external table