Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

Alter External Table Examples

The following example sets the numRows table property for the SPECTRUM.SALES external table to 170,000 rows.

Copy
alter table spectrum.sales set table properties ('numRows'='170000');

The following example changes the location for the SPECTRUM.SALES external table.

Copy
alter table spectrum.sales set location 's3://awssampledbuswest2/tickit/spectrum/sales/';

The following example changes the format for the SPECTRUM.SALES external table to Parquet.

Copy
alter table spectrum.sales set file format parquet;

The following example adds one partition for the table SPECTRUM.SALES_PART.

Copy
alter table spectrum.sales_part add partition(saledate='2008-01-01') location 's3://awssampledbuswest2/tickit/spectrum/sales_partition/saledate=2008-01/';

The following example alters SPECTRUM.SALES_PART to drop the partition with saledate='2008-01-01''.

Copy
alter table spectrum.sales_part drop partition(saledate='2008-01-01');

The following example sets a new Amazon S3 path for the partition with saledate='2008-01-01'.

Copy
alter table spectrum.sales_part partition(saledate='2008-01-01') set location 's3://awssampledbuswest2/tickit/spectrum/sales_partition/saledate=2008-01-01/';