Changing Table Storage Location
Function
Change the storage location of a table.
For example, if you have an OBS table named my_table with its data stored in the parallel file system path obs://my-bucket/old-path, you can use the syntax described in this section to update its storage location to another parallel file system path, such as obs://my-bucket/new-path.
A parallel file system is a high-performance file system that delivers millisecond-level access latency, TB/s bandwidth, and millions of IOPS, making it ideal for interactive big data analytics scenarios.
For details about how to change the storage location of a table partition, refer to Altering the Partition Location of a Table (Only OBS Tables Supported).
Notes and Constraints
- The operations described in this section apply only to OBS tables.
- For OBS tables created with a parallel file system specified as the storage location, you can use the ALTER TABLE ... SET LOCATION syntax to reset the table's storage location.
The applicability of ALTER TABLE ... SET LOCATION varies depending on the metadata type of the table. Refer to Table 1 for detailed usage scenarios.
Table 1 Application scenarios of ALTER TABLE ... SET LOCATION Metadata Type
Bucket Type of the Storage Location During Table Creation
Desired Bucket Type of the Storage Location
Table Storage Location Change Support
DLI
Object bucket
Object bucket
Yes
DLI
Object bucket
Parallel file system
Yes
DLI
Parallel file system
Parallel file system
Yes
DLI
Parallel file system
Object bucket
Yes
Syntax
ALTER TABLE table_name SET LOCATION 'new_location';
Keywords
LOCATION: storage path.
Parameters
|
Parameter |
Description |
|---|---|
|
table_name |
Table name. |
|
new_location |
New storage location. |
Example
Change the storage location of the my_table table.
ALTER TABLE my_table SET LOCATION 'obs://my-bucket/new-path';
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot