Skip to content
Permalink
Browse files
Revert "Supplementary information for add segment syntax ."
This reverts commit 81c2e29.
  • Loading branch information
bieremayi committed Dec 7, 2021
1 parent ce5747d commit f544e59de1b75cf595f0b194928a8fb255928bca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 41 deletions.
@@ -27,46 +27,10 @@ Heterogeneous format segments aims to solve this problem by avoiding data conver
### Add segment with path and format
Users can add the existing data as a segment to the carbon table provided the schema of the data
and the carbon table should be the same.

Syntax

```
ALTER TABLE [db_name.]table_name ADD SEGMENT OPTIONS(property_name=property_value, ...)
```

**Supported properties:**

| Property | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [PATH](#path) | User external old table path |
| [FORMAT](#format) | User external old table file format |
| [PARTITION](#partition) | Extract partition info for partition table , should be form of "a:int, b:string" |


-
You can use the following options to add segment:

- ##### PATH:
User old table path.

```
OPTIONS('PATH'='hdfs://usr/oldtable')
```

- ##### FORMAT:
User old table file format. eg : json, parquet, jdbc, orc, csv, text

```
OPTIONS('FORMAT'='parquet')
```
- ##### PARTITION:
Extract partition info for partition table , should be form of "a:int, b:string"

```
OPTIONS('PARTITION'='a:int, b:string')
```


```
alter table table_name add segment options ('path'= 'hdfs://usr/oldtable','format'='parquet')
```
In the above command user can add the existing data to the carbon table as a new segment and also
can provide the data format.

@@ -25,7 +25,6 @@ concept which helps to maintain consistency of data and easy transaction managem
- [Delete Segment by ID](#delete-segment-by-id)
- [Delete Segment by Date](#delete-segment-by-date)
- [Query Data with Specified Segments](#query-data-with-specified-segments)
- [Add Segment](./addsegment-guide.md)

### SHOW SEGMENT

@@ -208,4 +207,4 @@ concept which helps to maintain consistency of data and easy transaction managem
spark.sql("select count(empno) from carbon.input.segments.db.carbontable_Multi_Thread").show();
}
}
```
```

0 comments on commit f544e59

Please sign in to comment.