Description
The ALTER SCHEMA
statement is used to adjust the name, properties, and comments of a specified schema. With this statement, users can update the comments and properties of the schema to adapt to changes in data processing needs and organizational structure.
Modify Schema Name
Syntax:
Modify Schema Comments
To modify the schema comments, you can use the following syntax:
Example
- Modify the comment of the
rc4_l
schema torc7
:
After executing this statement, use the DESC
command to verify if the comment was successfully modified:
Expected Output Results:
Modify Schema Properties
In addition to modifying comments, you can also set or update properties for the schema. Use the following syntax:
Example
- Set the attribute
custom_property
totrue
for therc4_l
schema:
Check if the schema attribute is set successfully:
The properties section in the expected output should contain the newly set properties:
Permission Requirements
The user executing the ALTER SCHEMA
statement must have the ALTER permission for the corresponding schema. If the user does not have the appropriate permissions, the operation will be denied.