You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ch...@apache.org on 2021/12/20 14:55:45 UTC

[carbondata] 01/14: Supplementary information for add segment syntax .

This is an automated email from the ASF dual-hosted git repository.

chenliang613 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git

commit 81c2e29604d66e35f3757122cbc7cda0ed463cac
Author: bieremayi <li...@sina.com>
AuthorDate: Thu Nov 25 17:46:57 2021 +0800

    Supplementary information for add segment syntax .
    
    1. add segment option (partition)
    2. segment-management-on-carbondata.md link addsegment-guide.md
---
 docs/addsegment-guide.md                 | 42 +++++++++++++++++++++++++++++---
 docs/segment-management-on-carbondata.md |  3 ++-
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/docs/addsegment-guide.md b/docs/addsegment-guide.md
index 78b15e6..648c426 100644
--- a/docs/addsegment-guide.md
+++ b/docs/addsegment-guide.md
@@ -27,10 +27,46 @@ 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.
 
diff --git a/docs/segment-management-on-carbondata.md b/docs/segment-management-on-carbondata.md
index 6c144b1..ef01799 100644
--- a/docs/segment-management-on-carbondata.md
+++ b/docs/segment-management-on-carbondata.md
@@ -25,6 +25,7 @@ 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
 
@@ -207,4 +208,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();
      }
    }
-  ```
+  ```
\ No newline at end of file