ALTER TABLE SET LOCATION
Changes the location for the table named table_name
, and optionally a partition with partition_spec
.
Synopsis
ALTER TABLE table_name [ PARTITION (partition_spec) ] SET LOCATION 'new location'
Parameters
- PARTITION (partition_spec)
-
Specifies the partition with parameters
partition_spec
whose location you want to change. Thepartition_spec
specifies a column name/value combination in the formpartition_col_name = partition_col_value
. - SET LOCATION 'new location'
-
Specifies the new location, which must be an Amazon S3 location. For information about syntax, see Table Location in Amazon S3.
Examples
ALTER TABLE customers PARTITION (zip='98040', state='WA') SET LOCATION 's3://amzn-s3-demo-bucket/custdata/';