Skip to content

Commit 41831ce

Browse files
ShreelekhyaGkunal642
authored andcommitted
[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
1 parent a838531 commit 41831ce

File tree

1 file changed

+16
-47
lines changed

1 file changed

+16
-47
lines changed

docs/ddl-of-carbondata.md

+16-47
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ CarbonData DDL statements are documented here,which includes:
6060
* [REFRESH TABLE](#refresh-table)
6161
* [COMMENTS](#table-and-column-comment)
6262
* [PARTITION](#partition)
63-
* [STANDARD PARTITION(HIVE)](#standard-partition)
64-
* [INSERT OVERWRITE PARTITION](#insert-overwrite)
63+
* [CREATE PARTITION](#create-partition-table)
6564
* [SHOW PARTITIONS](#show-partitions)
66-
* [ADD PARTITION](#add-a-new-partition)
67-
* [SPLIT PARTITION](#split-a-partition)
68-
* [DROP PARTITION](#drop-a-partition)
65+
* [ADD PARTITION](#add-partition)
66+
* [DROP PARTITION](#drop-partition)
67+
* [INSERT OVERWRITE PARTITION](#insert-overwrite)
6968
* [BUCKETING](#bucketing)
7069
* [CACHE](#cache)
7170

@@ -1085,9 +1084,20 @@ Users can specify which columns to include and exclude for local dictionary gene
10851084
SHOW PARTITIONS [db_name.]table_name
10861085
```
10871086
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+
10881098
#### Drop Partition
10891099
1090-
This command drops the specified Hive partition only.
1100+
This command drops the specified Hive partition.
10911101
```
10921102
ALTER TABLE table_name DROP [IF EXISTS] PARTITION (part_spec, ...)
10931103
```
@@ -1115,47 +1125,6 @@ Users can specify which columns to include and exclude for local dictionary gene
11151125
WHERE au.country = 'US';
11161126
```
11171127
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.
1147-
1148-
```
1149-
SegmentDir/0_batchno0-0-1502703086921.carbonindex
1150-
^
1151-
SegmentDir/part-0-0_batchno0-0-1502703086921.carbondata
1152-
^
1153-
```
1154-
1155-
Here are some useful tips to improve query performance of carbonData partition table:
1156-
* The partitioned column can be excluded from SORT_COLUMNS, this will let other columns to do the efficient sorting.
1157-
* When writing SQL on a partition table, try to use filters on the partition column.
1158-
11591128
## BUCKETING
11601129
11611130
Bucketing feature can be used to distribute/organize the table/partition data into multiple files such

0 commit comments

Comments
 (0)