You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CARBONDATA-4327] Update documentation related to partition
Why is this PR needed?
Drop partition with data is not supported and a few of the links are not working.
What changes were proposed in this PR?
Removed unsupported syntax , duplicate headings and updated the header with proper linkage.
This closes#4254
@@ -1085,9 +1084,20 @@ Users can specify which columns to include and exclude for local dictionary gene
1085
1084
SHOW PARTITIONS [db_name.]table_name
1086
1085
```
1087
1086
1087
+
### Add Partition
1088
+
1089
+
This command adds the specified Hive partition.
1090
+
```
1091
+
ALTER TABLE [db_name].table_name ADD PARTITION(part_spec, ...)
1092
+
```
1093
+
Example:
1094
+
```
1095
+
ALTER TABLE locationTable ADD PARTITION (country = 'US');
1096
+
```
1097
+
1088
1098
#### Drop Partition
1089
1099
1090
-
This command drops the specified Hive partition only.
1100
+
This command drops the specified Hive partition.
1091
1101
```
1092
1102
ALTER TABLE table_name DROP [IF EXISTS] PARTITION (part_spec, ...)
1093
1103
```
@@ -1115,47 +1125,6 @@ Users can specify which columns to include and exclude for local dictionary gene
1115
1125
WHERE au.country = 'US';
1116
1126
```
1117
1127
1118
-
### Show Partitions
1119
-
1120
-
The following command is executed to get the partition information of the table
1121
-
1122
-
```
1123
-
SHOW PARTITIONS [db_name.]table_name
1124
-
```
1125
-
1126
-
### Add a new partition
1127
-
1128
-
```
1129
-
ALTER TABLE [db_name].table_name ADD PARTITION('new_partition')
1130
-
```
1131
-
1132
-
### Drop a partition
1133
-
1134
-
Only drop partition definition, but keep data
1135
-
```
1136
-
ALTER TABLE [db_name].table_name DROP PARTITION(partition_id)
1137
-
```
1138
-
1139
-
Drop both partition definition and data
1140
-
```
1141
-
ALTER TABLE [db_name].table_name DROP PARTITION(partition_id) WITH DATA
1142
-
```
1143
-
1144
-
**NOTE:**
1145
-
* Hash partition table is not supported for ADD, SPLIT and DROP commands.
1146
-
* Partition Id: in CarbonData like the hive, folders are not used to divide partitions instead partition id is used to replace the task id. It could make use of the characteristic and meanwhile reduce some metadata.
0 commit comments