Modifying a CarbonData Table
SET and UNSET
When you run the SET command, all the attributes of the new SET overwrite the existing properties.
- SORT SCOPE
An example of the SET SORT SCOPE command is as follows:
ALTER TABLE tablename SET TBLPROPERTIES('SORT_SCOPE'='no_sort')
After the UNSET SORT SCOPE command is executed, the default option NO_SORT is used.
Example for UNSET SORT SCOPE:
ALTER TABLE tablename UNSET TBLPROPERTIES('SORT_SCOPE')
- SORT COLUMNS
ALTER TABLE tablename SET TBLPROPERTIES('SORT_COLUMNS'='column1')
This command applies new setting of SORT_COLUMNS to new imports. You can adjust SORT_COLUMNS to get optimal query result, but the old data will not be changed. Query performance of historical segments is not affected they are not queried based on the new SORT_COLUMNS.
The UNSET command is not supported. Instead, you can set SORT_COLUMNS to an empty string.
ALTER TABLE tablename SET TBLPROPERTIES('SORT_COLUMNS'='')
- In later versions, custom merge will be enhanced to sort old segments again.
- SORT_COLUMNS cannot be modified for streaming tables.
- If an inverted index column is removed from SORT_COLUMNS, no inverted index will be created for the column. The old INVERTED_INDEX settings will not change.
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