You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2022/04/15 08:38:47 UTC

[incubator-doris] branch master updated: [Refactor][Doc]Add part of the document content for Get-Starting (#8867)

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

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 556602a5f1 [Refactor][Doc]Add part of the document content for Get-Starting (#8867)
556602a5f1 is described below

commit 556602a5f11a765d0d4002e6d565edb05bdfee65
Author: FreeOnePlus <54...@users.noreply.github.com>
AuthorDate: Fri Apr 15 16:38:42 2022 +0800

    [Refactor][Doc]Add part of the document content for Get-Starting (#8867)
    
    * Add part of the document content for Get-Starting
---
 new-docs/en/get-starting/get-starting.md    | 670 +++++++++++++++++++++++++++-
 new-docs/zh-CN/get-starting/get-starting.md | 668 ++++++++++++++++++++++++++-
 2 files changed, 1332 insertions(+), 6 deletions(-)

diff --git a/new-docs/en/get-starting/get-starting.md b/new-docs/en/get-starting/get-starting.md
index 19ddd0b111..c64624f992 100644
--- a/new-docs/en/get-starting/get-starting.md
+++ b/new-docs/en/get-starting/get-starting.md
@@ -1,11 +1,12 @@
 ---
 {
-    "title": "Getting Started",
+    "title": "Get-Starting",
     "language": "en"
 }
+
 ---
 
-<!--
+<!-- 
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
@@ -22,4 +23,667 @@ software distributed under the License is distributed on an
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
--->
\ No newline at end of file
+-->
+
+# Apache Doris Get-Starting
+
+This article is suitable for students who have not learned Apache Doris yet and want to quickly experience the complete Apache Doris from compilation and deployment to specific applications.
+
+This article is applicable to multi-platform (Win|Mac|Linux) and multi-mode (bare metal|Docker|virtual machine) **single-machine deployment**, which can be selected according to the objective situation.
+
+## Environmental preparation
+
+1. CPU: 2C (minimum) 8C (recommended)
+2. Memory: 4G (minimum) 48G (recommended)
+3. Hard disk: 100G (minimum) 400G (recommended)
+4. Platform: MacOS (Inter), LinuxOS, Windows virtual machine
+5. System: CentOS (7.1 and above), Ubuntu (16.04 and above)
+6. Software: JDK (1.8 and above), GCC (4.8.2 and above)
+
+## Stand-alone deployment
+
+**Before creating, please prepare the compiled FE/BE file, this tutorial will not repeat the compilation process. **
+
+> If you have no intention of compiling or want to directly download the successfully compiled file, you can use the following link to download the corresponding version
+>
+> Apache-Doris-Release--JDK1.8 precompiled version:
+>
+> Baidu Palo-1.0-preview2-JDK1.8 precompiled version: https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/PALO-1.0.0-preview2-no-avx2 -binary.tar.gz
+
+1. Set the maximum number of open file handles in the system
+
+   ```shell
+   vi /etc/security/limits.conf 
+   # Add the following two lines of information
+   * soft nofile 65536
+   * hard nofile 65536
+   # Save and exit and restart the server
+   ```
+   
+2. Download binary package / self-compile FE / BE files
+
+   ```shell
+   wget https://doris.apache.org/apache-doris-release/version to deploy
+   wget https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/version to deploy
+   # For example the following link
+   wget https://doris.apache.org/release/doris-1.0.0.tar.gz
+   wget https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/PALO-1.0.0-preview2-no-avx2-binary.tar.gz
+   ```
+
+3. Extract the tar.gz file
+
+   ```shell
+   tar -zxvf Downloaded binary archive
+   # example
+   tar -zxvf PALO-1.0.0-preview2-no-avx2-binary.tar.gz
+   ```
+
+4. Migrate the decompressed program files to the specified directory and rename them
+
+   ```shell
+   mv [unzipped root directory] [Target path]
+   cd [Target path]
+   # example
+   mv PALO-1.0.0-preview2-no-avx2-binary /opt/doris
+   cd /opt/doris
+   ```
+
+5. Configure FE
+
+   ```shell
+   # Configure FE-Config
+   vi fe/conf/fe.conf
+   # Uncomment priority_networks and modify parameters
+   priority_networks = 127.0.0.0/24
+   # save and exit
+   ```
+
+6. Configure BE
+
+   ```shell
+   # Configure BE-Config
+   vi be/conf/be.conf
+   # Uncomment priority_networks and modify parameters
+   priority_networks = 127.0.0.0/24
+   # save and exit
+   ```
+
+7. Configure environment variables
+
+   ```shell
+   # Configure environment variables
+   vim /etc/profile.d/doris.sh
+   export DORIS_HOME=Doris root path # example:/opt/doris
+   export PATH=$PATH:$DORIS_HOME/fe/bin:$DORIS_HOME/be/bin
+   # save and source
+   source /etc/profile.d/doris.sh
+   ```
+
+8. Start FE and BE and register BE to FE
+
+   ```shell
+   start_fe.sh --daemon
+   start_be.sh --daemon
+   ```
+
+   Check whether the FE startup is successful
+
+   > 1. Check whether the startup is successful, and whether there is a PaloFe process under the JPS command
+   > 2. After the FE process is started, the metadata will be loaded first. Depending on the role of the FE, you will see transfer from UNKNOWN to MASTER/FOLLOWER/OBSERVER in the log. Finally, you will see the thrift server started log, and you can connect to FE through the mysql client, which means FE started successfully.
+   > 3. You can also check whether the startup is successful through the following connection: http://fe_host:fe_http_port/api/bootstrap If it returns: {"status":"OK","msg":"Success"}, it means the startup is successful, and the rest , there may be a problem.
+   > 4. Visit http://fe_host:fe_http_port in the external environment to check whether you can access the WebUI interface. The default login account is root and the password is empty.
+   >
+   > **Note: If you can't see the startup failure information in fe.log, maybe you can see it in fe.out. **
+
+   Verify that BE is successfully started
+
+   > 1. After the BE process is started, if there is data before, it may take several minutes to load the data index.
+   > 2. If it is the first start of a BE, or the BE has not joined any cluster, the BE log will periodically scroll waiting to receive first heartbeat from frontend. Indicates that the BE has not received the Master's address through the heart hop of the FE, and is passively waiting. This kind of error log will disappear after ADD BACKEND in FE and sending a heartbeat. If the words master client, get client from cache failed.host: , port: 0, code: 7 appear repeatedly after receiving the  [...]
+   > 3. If the BE has been added to the cluster, the heartbeat log from the FE should be scrolled every 5 seconds: get heartbeat, host: xx.xx.xx.xx, port: 9020, cluster id: xxxxxx , Indicates that the heartbeat is normal.
+   > 4. Secondly, the words finish report task success. return code: 0 should be scrolled in the log every 10 seconds, indicating that the communication between BE and FE is normal.
+   > 5. At the same time, if there is a data query, you should be able to see the log that keeps scrolling, and there is a log of execute time is xxx, indicating that the BE has been started successfully and the query is normal.
+   > 6. You can also check whether the startup is successful through the following connection: http://be_host:be_http_port/api/health If it returns: {"status": "OK","msg": "To Be Added"}, it means the startup is successful, In other cases, there may be problems.
+   >
+   > **Note: If you can't see the startup failure information in be.INFO, maybe you can see it in be.out. **
+
+   Register BE to FE (using MySQL-Client, you need to install it yourself)
+
+   ```shell
+   # login
+   mysql -h 127.0.0.1 -P 9030 -uroot
+   # Register BE
+   ALTER SYSTEM ADD BACKEND "127.0.0.1:9050";
+   ```
+
+## Apache Doris is easy to use
+
+Doris uses the MySQL protocol for communication, and users can connect to the Doris cluster through MySQL Client or MySQL JDBC. When choosing the MySQL client version, it is recommended to use a version after 5.1, because the user name longer than 16 characters cannot be supported before 5.1. Doris SQL syntax basically covers MySQL syntax.
+
+### Apache Doris Web UI access
+
+By default, Http protocol is used for WebUI access, and the following format address is entered in the browser to access
+
+```cql
+http://FE_IP:FE_HTTP_PORT(默认8030)
+```
+
+If the account password is changed during cluster installation, use the new account password to log in
+
+```
+Default account: root
+Default password: empty
+```
+
+1. Introduction to WebUI
+
+   On the home page of FE-WEB-UI, Version and Hardware Info are listed
+
+   The Tab page has the following six modules:
+
+   - Playground (Visual SQL)
+
+   - System (system status)
+
+   - Log (cluster log)
+
+   - QueryProfile (SQL execution log)
+
+   - Session (linked list)
+
+   - Configuration
+
+2. View the BE list
+
+    Go to `System` --> `backends` to view
+
+    What needs to be paid attention to is the `Alive` column, the `True` and `False` of this column represent the normal and abnormal status of the corresponding BE node
+
+3. profile query
+
+    Enter QueryProfile to view the latest 100 SQL execution report information, click the specified ID in the QueryID column to view the Profile information
+
+### MySQL command line/graphical client access
+
+```shell
+# Command Line
+mysql -h FE-host -P 9030 -u username -p password
+# Client (Navicat as an example)
+Host: FE-host (if it is a cloud server, public IP is required)
+Port: 9030
+username: username
+password password
+````
+
+#### Profile settings
+
+FE splits the query plan into fragments and sends them to BE for task execution. When BE executes Fragment, it records **statistical value of running state**, and outputs the statistics of Fragment execution to the log. FE can also collect these statistical values recorded by each Fragment through switches, and print the results on the FE web page.
+
+- Turn on the Report switch of FE
+
+   ```mysql
+   set enable_profile=true;
+   ````
+
+- After executing the SQL statement, you can view the corresponding SQL statement execution report information on the FE's WEB-UI interface
+
+For a complete parameter comparison table, please go to [Profile parameter analysis](https://doris.apache.org/zh-CN/administrator-guide/running-profile.html#profile%E5%8F%82%E6 %95%B0%E8%A7%A3%E6%9E%90 ) View Details
+
+#### Library table operations
+
+- View database list
+
+  ```mysql
+  show databases;
+  ````
+
+- create database
+
+   ```mysql
+   CREATE DATABASE database name;
+   ````
+
+   > For more detailed syntax and best practices used by Create-DataBase, see [Create-DataBase](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create /CREATE-DATABASE.html) command manual.
+   >
+   > If you don't know the full name of the command, you can use "help command a field" for fuzzy query. If you type 'HELP CREATE', you can match `CREATE DATABASE`, `CREATE TABLE`, `CREATE USER` and other commands.
+   
+   After the database is created, you can view the database information through `SHOW DATABASES;`.
+   
+   ```mysql
+   MySQL> SHOW DATABASES;
+   +--------------------+
+   | Database |
+   +--------------------+
+   | example_db |
+   | information_schema |
+   +--------------------+
+   2 rows in set (0.00 sec)
+   ````
+   
+   `information_schema` exists to be compatible with the MySQL protocol. In practice, the information may not be very accurate, so it is recommended to obtain information about a specific database by directly querying the corresponding database.
+   
+- Create data table
+
+  > For more detailed syntax and best practices used by Create-Table, see [Create-Table](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/ CREATE-TABLE.html) command manual.
+
+  Use the `CREATE TABLE` command to create a table (Table). More detailed parameters can be viewed:
+
+  ```mysql
+  HELP CREATE TABLE;
+  ````
+
+  First switch the database:
+
+  ```mysql
+  USE example_db;
+  ````
+
+  Doris supports two table creation methods, single partition and composite partition (for details, please refer to [Create-Table](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create /CREATE-TABLE.html) command manual).
+
+  The following takes the aggregation model as an example to demonstrate the table building statements for two partitions.
+
+  - single partition
+
+    Create a logical table named table1. The bucketed column is siteid, and the number of buckets is 10.
+
+    The schema for this table is as follows:
+
+    - siteid: type is INT (4 bytes), default value is 10
+    - citycode: type is SMALLINT (2 bytes)
+    - username: the type is VARCHAR, the maximum length is 32, the default value is an empty string
+    - pv: the type is BIGINT (8 bytes), the default value is 0; this is an indicator column, Doris will perform aggregation operations on the indicator column internally, and the aggregation method of this column is sum (SUM)
+
+    The table creation statement is as follows:
+
+    ```mysql
+    CREATE TABLE table1
+    (
+        siteid INT DEFAULT '10',
+        citycode SMALLINT,
+        username VARCHAR(32) DEFAULT '',
+        pv BIGINT SUM DEFAULT '0'
+    )
+    AGGREGATE KEY(siteid, citycode, username)
+    DISTRIBUTED BY HASH(siteid) BUCKETS 10
+    PROPERTIES("replication_num" = "1");
+    ```
+
+  - composite partition
+
+    Create a logical table named table2.
+
+    The schema for this table is as follows:
+
+    - event_day: type is DATE, no default value
+    - siteid: type is INT (4 bytes), default value is 10
+    - citycode: type is SMALLINT (2 bytes)
+    - username: the type is VARCHAR, the maximum length is 32, the default value is an empty string
+    - pv: The type is BIGINT (8 bytes), the default value is 0; this is an indicator column, Doris will perform aggregation operations on the indicator column internally, and the aggregation method of this column is sum (SUM)
+
+    We use the event_day column as the partition column and create 3 partitions: p201706, p201707, p201708
+
+    - p201706: Range is [Min, 2017-07-01)
+
+    - p201707: The range is [2017-07-01, 2017-08-01)
+
+    - p201708: The range is [2017-08-01, 2017-09-01)
+
+       > Note that the interval is left closed and right open.
+
+    Each partition uses siteid for hash bucketing, and the number of buckets is 10
+
+    The table creation statement is as follows:
+
+  - ```mysql
+    CREATE TABLE table2
+    (
+        event_day DATE,
+        siteid INT DEFAULT '10',
+        citycode SMALLINT,
+        username VARCHAR(32) DEFAULT '',
+        pv BIGINT SUM DEFAULT '0'
+    )
+    AGGREGATE KEY(event_day, siteid, citycode, username)
+    PARTITION BY RANGE(event_day)
+    (
+        PARTITION p201706 VALUES LESS THAN ('2017-07-01'),
+        PARTITION p201707 VALUES LESS THAN ('2017-08-01'),
+        PARTITION p201708 VALUES LESS THAN ('2017-09-01')
+    )
+    DISTRIBUTED BY HASH(siteid) BUCKETS 10
+    PROPERTIES("replication_num" = "1");
+    ```
+
+    After the table is created, you can view the information of the table in example_db:
+
+    ```mysql
+    MySQL> SHOW TABLES;
+    +----------------------+
+    | Tables_in_example_db |
+    +----------------------+
+    | table1               |
+    | table2               |
+    +----------------------+
+    2 rows in set (0.01 sec)
+    
+    MySQL> DESC table1;
+    +----------+-------------+------+-------+---------+-------+
+    | Field    | Type        | Null | Key   | Default | Extra |
+    +----------+-------------+------+-------+---------+-------+
+    | siteid   | int(11)     | Yes  | true  | 10      |       |
+    | citycode | smallint(6) | Yes  | true  | N/A     |       |
+    | username | varchar(32) | Yes  | true  |         |       |
+    | pv       | bigint(20)  | Yes  | false | 0       | SUM   |
+    +----------+-------------+------+-------+---------+-------+
+    4 rows in set (0.00 sec)
+    
+    MySQL> DESC table2;
+    +-----------+-------------+------+-------+---------+-------+
+    | Field     | Type        | Null | Key   | Default | Extra |
+    +-----------+-------------+------+-------+---------+-------+
+    | event_day | date        | Yes  | true  | N/A     |       |
+    | siteid    | int(11)     | Yes  | true  | 10      |       |
+    | citycode  | smallint(6) | Yes  | true  | N/A     |       |
+    | username  | varchar(32) | Yes  | true  |         |       |
+    | pv        | bigint(20)  | Yes  | false | 0       | SUM   |
+    +-----------+-------------+------+-------+---------+-------+
+    5 rows in set (0.00 sec)
+    ```
+
+    > Precautions:
+    >
+    > 1. The above tables are all single-copy tables by setting replication_num. Doris recommends that users use the default 3-copy setting to ensure high availability.
+    > 2. You can dynamically add or delete partitions to the composite partition table. See the Partition section in `HELP ALTER TABLE` for details.
+    > 3. Data import can import the specified Partition. See `HELP LOAD` for details.
+    > 4. The schema of the table can be dynamically modified.
+    > 5. You can add Rollup to Table to improve query performance. For this part, please refer to the description of Rollup in the Advanced User Guide.
+    > 6. The Null attribute of the table column defaults to true, which will have a certain impact on query performance.
+
+#### Insert Data
+
+1. Insert Into
+
+   > For more detailed syntax and best practices for Insert usage, see [Insert](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/INSERT.html) Command Manual.
+
+   The Insert Into statement is used in a similar way to the Insert Into statement in databases such as MySQL. But in Doris, all data writing is a separate import job. Therefore, Insert Into is also introduced as an import method here.
+
+   The main Insert Into commands include the following two;
+
+   - INSERT INTO tbl SELECT ...
+   - INSERT INTO tbl (col1, col2, ...) VALUES (1, 2, ...), (1,3, ...);
+
+   The second command is for Demo only, not in test or production environments.
+
+   The Insert Into command needs to be submitted through the MySQL protocol. Creating an import request will return the import result synchronously.
+
+   grammar:
+
+   ```mysql
+   INSERT INTO table_name [partition_info] [WITH LABEL label] [col_list] [query_stmt] [VALUES];
+   ```
+
+   Example:
+
+   ```mysql
+   INSERT INTO tbl2 WITH LABEL label1 SELECT * FROM tbl3;
+   INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"),("a");
+   ```
+
+   **Notice**
+
+   When using `CTE(Common Table Expressions)` as the query part in an insert operation, the `WITH LABEL` and `column list` parts must be specified. Example
+
+   ```mysql
+   INSERT INTO tbl1 WITH LABEL label1
+   WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+   SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+   
+   INSERT INTO tbl1 (k1)
+   WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+   SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+   ```
+
+   Insert Into itself is an SQL command, and its return results are divided into the following types according to the different execution results:
+
+   - If the return result is `ERROR 1064 (HY000)`, it means the import failed.
+   - If the returned result is `Query OK`, the execution is successful.
+      - If `rows affected` is 0, the result set is empty and no data is imported.
+      - If `rows affected` is greater than 0:
+        - If `status` is `committed`, the data is not yet visible. Need to view status through `show transaction` statement until `visible`
+        - If `status` is `visible`, the data import is successful.
+      - If `warnings` is greater than 0, it means that data is filtered. You can get the url through the `show load` statement to view the filtered lines.
+
+   For more detailed instructions, see the [Insert](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/INSERT.html) command manual.
+
+2. Batch Import
+
+   Doris supports multiple data import methods. For details, please refer to the data import documentation. Here we use Stream-Load and Broker-Load as an example.
+
+   - Stream-Load
+
+     > For more detailed syntax and best practices used by Stream-Load, see [Stream-Load](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Load/ STREAM-LOAD.html) command manual.
+
+     Streaming import transfers data to Doris through the HTTP protocol, and can directly import local data without relying on other systems or components. See `HELP STREAM LOAD;` for detailed syntax help.
+
+     Example 1: With "table1_20170707" as the Label, use the local file table1_data to import the table1 table.
+
+     ```CQL
+     curl --location-trusted -u test:test_passwd -H "label:table1_20170707" -H "column_separator:," -T table1_data http://FE_HOST:8030/api/example_db/table1/_stream_load
+     ```
+
+     > 1. FE_HOST is the IP of the node where any FE is located, and 8030 is the http_port in fe.conf.
+     > 2. You can use the IP of any BE and the webserver_port in be.conf to import. For example: `BE_HOST:8040`
+
+     The local file `table1_data` uses `,` as the separation between data, the details are as follows:
+
+     ```text
+     1,1,jim,2
+     2,1,grace,2
+     3,2,tom,2
+     4,3,bush,3
+     5,3,helen,3
+     ```
+
+     Example 2: With "table2_20170707" as the Label, use the local file table2_data to import the table2 table.
+
+     ```CQL
+     curl --location-trusted -u test:test -H "label:table2_20170707" -H "column_separator:|" -T table2_data http://127.0.0.1:8030/api/example_db/table2/_stream_load
+     ```
+
+     The local file `table2_data` uses `|` as the separation between data, the details are as follows:
+
+     ```text
+     2017-07-03|1|1|jim|2
+     2017-07-05|2|1|grace|2
+     2017-07-12|3|2|tom|2
+     2017-07-15|4|3|bush|3
+     2017-07-12|5|3|helen|3
+     ```
+
+     > Precautions:
+     >
+     > 1. It is recommended to use streaming import to limit the file size to 10GB. Too large files will increase the cost of failed retry attempts.
+     > 2. Each batch of imported data needs to take a Label. The Label should preferably be a string related to a batch of data, which is easy to read and manage. Based on Label, Doris guarantees that within a Database, the same batch of data can only be successfully imported once. Labels of failed tasks can be reused.
+     > 3. Streaming import is a synchronous command. If the command returns successfully, it means that the data has been imported, and if it returns a failure, it means that the batch of data has not been imported.
+
+   - Broker-Load
+
+     Broker import uses the deployed Broker process to read data on external storage for import.
+
+     > For more detailed syntax and best practices used by Broker Load, see [Broker Load](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Load/BROKER- LOAD.html) command manual, you can also enter `HELP BROKER LOAD` in the MySql client command line for more help information.
+
+     Example: With "table1_20170708" as the Label, import the files on HDFS into table1
+
+        ```mysql
+        LOAD LABEL table1_20170708
+        (
+            DATA INFILE("hdfs://your.namenode.host:port/dir/table1_data")
+            INTO TABLE table1
+        )
+        WITH BROKER hdfs 
+        (
+            "username"="hdfs_user",
+            "password"="hdfs_password"
+        )
+        PROPERTIES
+        (
+            "timeout"="3600",
+            "max_filter_ratio"="0.1"
+        );
+        ```
+
+     Broker imports are asynchronous commands. The successful execution of the above command only means that the submitted task is successful. Whether the import is successful needs to be checked through `SHOW LOAD;`. Such as:
+
+        ```mysql
+     SHOW LOAD WHERE LABEL = "table1_20170708";
+        ```
+
+     In the returned result, if the `State` field is FINISHED, the import is successful.
+
+     For more information on `SHOW LOAD`, see `HELP SHOW LOAD;`
+
+     Asynchronous import tasks can be canceled before they finish:
+
+        ```mysql
+     CANCEL LOAD WHERE LABEL = "table1_20170708";
+        ```
+
+#### Query Data
+
+1. Simple query
+
+   ```mysql
+   MySQL> SELECT * FROM table1 LIMIT 3;
+   +--------+----------+----------+------+
+   | siteid | citycode | username | pv   |
+   +--------+----------+----------+------+
+   |      2 |        1 | 'grace'  |    2 |
+   |      5 |        3 | 'helen'  |    3 |
+   |      3 |        2 | 'tom'    |    2 |
+   +--------+----------+----------+------+
+   3 rows in set (0.01 sec)
+   
+   MySQL> SELECT * FROM table1 ORDER BY citycode;
+   +--------+----------+----------+------+
+   | siteid | citycode | username | pv   |
+   +--------+----------+----------+------+
+   |      2 |        1 | 'grace'  |    2 |
+   |      1 |        1 | 'jim'    |    2 |
+   |      3 |        2 | 'tom'    |    2 |
+   |      4 |        3 | 'bush'   |    3 |
+   |      5 |        3 | 'helen'  |    3 |
+   +--------+----------+----------+------+
+   5 rows in set (0.01 sec)
+   ```
+
+2. Join query
+
+   ```mysql
+   MySQL> SELECT SUM(table1.pv) FROM table1 JOIN table2 WHERE table1.siteid = table2.siteid;
+   +--------------------+
+   | sum(`table1`.`pv`) |
+   +--------------------+
+   |                 12 |
+   +--------------------+
+   1 row in set (0.20 sec)
+   ```
+
+3. subquery
+
+   ```mysql
+   MySQL> SELECT SUM(pv) FROM table2 WHERE siteid IN (SELECT siteid FROM table1 WHERE siteid > 2);
+   +-----------+
+   | sum(`pv`) |
+   +-----------+
+   |         8 |
+   +-----------+
+   1 row in set (0.13 sec)
+   ```
+
+#### Update Data
+
+> For more detailed syntax and best practices used by Update, see [Update](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/UPDATE.html) Command Manual.
+
+The current UPDATE statement **only supports** row updates on the Unique model, and there may be data conflicts caused by concurrent updates. At present, Doris does not deal with such problems, and users need to avoid such problems from the business side.
+
+1. grammar rules
+
+   ```text
+   UPDATE table_name 
+       SET assignment_list
+       WHERE expression
+   
+   value:
+       {expr | DEFAULT}
+   
+   assignment:
+       col_name = value
+   
+   assignment_list:
+       assignment [, assignment] ...
+   ```
+
+   **Parameter Description**
+
+   - table_name: The target table of the data to be updated. Can be of the form 'db_name.table_name'
+   - assignment_list: the target column to be updated, in the format 'col_name = value, col_name = value'
+   - where expression: the condition that is expected to be updated, an expression that returns true or false can be
+
+2. Example
+
+   The `test` table is a unique model table, which contains four columns: k1, k2, v1, v2. Where k1, k2 are keys, v1, v2 are values, and the aggregation method is Replace.
+
+   1. Update the v1 column in the 'test' table that satisfies the conditions k1 =1 , k2 =2 to 1
+
+      ```text
+      UPDATE test SET v1 = 1 WHERE k1=1 and k2=2;
+      ```
+
+   2. Increment the v1 column of the column k1=1 in the 'test' table by 1
+
+      ```text
+      UPDATE test SET v1 = v1+1 WHERE k1=1;
+      ```
+
+#### Delete Data
+
+> For more detailed syntax and best practices for Delete use, see [Delete](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/DELETE.html) Command Manual.
+
+1. grammar rules
+
+   ```mysql
+   This statement is used to conditionally delete data in the specified table (base index) partition.
+   This operation will also delete the data of the rollup index related to this base index.
+   grammar:
+       DELETE FROM table_name [PARTITION partition_name | PARTITIONS (p1, p2)]
+       WHERE
+       column_name1 op { value | value_list } [ AND column_name2 op { value | value_list } ...];
+       
+   illustrate:
+       1) The optional types of op include: =, >, <, >=, <=, !=, in, not in
+       2) Only conditions on the key column can be specified.
+       2) When the selected key column does not exist in a rollup, delete cannot be performed.
+       3) The relationship between conditions can only be "and".
+          If you want to achieve an "or" relationship, you need to write the conditions in two DELETE statements.
+       4) If it is a partitioned table, you can specify a partition. If not specified, and the session variable delete_without_partition is true, it will be applied to all partitions. If it is a single-partition table, it can be left unspecified.
+          
+   Notice:
+       This statement may reduce query efficiency for a period of time after execution.
+       The degree of impact depends on the number of delete conditions specified in the statement.
+       The more conditions you specify, the greater the impact.
+   ```
+
+2. Example
+
+   ```mysql
+   1. Delete the data row whose k1 column value is 3 in my_table partition p1
+        DELETE FROM my_table PARTITION p1
+        WHERE k1 = 3;
+       
+   2. Delete the data rows where the value of column k1 is greater than or equal to 3 and the value of column k2 is "abc" in my_table partition p1
+        DELETE FROM my_table PARTITION p1
+        WHERE k1 >= 3 AND k2 = "abc";
+   
+   3. Delete the data rows where the value of column k1 is greater than or equal to 3 and the value of column k2 is "abc" in my_table partition p1, p2
+        DELETE FROM my_table PARTITIONS (p1, p2)
+        WHERE k1 >= 3 AND k2 = "abc";
+   ```
\ No newline at end of file
diff --git a/new-docs/zh-CN/get-starting/get-starting.md b/new-docs/zh-CN/get-starting/get-starting.md
index 5fee3aa027..a4775154c8 100644
--- a/new-docs/zh-CN/get-starting/get-starting.md
+++ b/new-docs/zh-CN/get-starting/get-starting.md
@@ -1,11 +1,12 @@
 ---
 {
-    "title": "快速开始",
+    "title": "Get-Starting",
     "language": "zh-CN"
 }
+
 ---
 
-<!--
+<!-- 
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
@@ -24,4 +25,665 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-# 快速开始
\ No newline at end of file
+# Apache Doris 快速入门
+
+本文适用于暂未学习Apache Doris、想极速体验完整Apache Doris从编译部署到具体应用的同学。
+
+本文适用于多平台(Win|Mac|Linux)、多方式(裸机|Docker|虚拟机)的**单机部署**,可根据客观情况选择。
+
+## 环境准备
+
+1. CPU:2C(最低)8C(推荐)
+2. 内存:4G(最低)48G(推荐)
+3. 硬盘:100G(最低)400G(推荐)
+4. 平台:MacOS(Inter)、LinuxOS、Windows虚拟机
+5. 系统:CentOS(7.1及以上)、Ubuntu(16.04 及以上)
+6. 软件:JDK(1.8及以上)、GCC(4.8.2 及以上)
+
+## 单机部署
+
+**在创建之前,请准备好已完成编译的FE/BE文件,此教程不再赘述编译过程。**
+
+> 如无编译意向或想直接下载编译成功的文件,可使用如下链接下载对应版本
+>
+> Apache-Doris-Release--JDK1.8 预编译版本:
+>
+> 百度Palo-1.0-preview2-JDK1.8 预编译版本:https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/PALO-1.0.0-preview2-no-avx2-binary.tar.gz
+
+1. 设置系统最大打开文件句柄数
+
+   ```shell
+   vi /etc/security/limits.conf 
+   # 添加以下两行信息
+   * soft nofile 65536
+   * hard nofile 65536
+   # 保存退出并重启服务器
+   ```
+   
+2. 下载二进制包/自主编译 FE / BE 文件
+
+   ```shell
+   wget https://doris.apache.org/apache-doris-release/要部署的版本
+   wget https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/要部署的版本
+   # 例如如下链接
+   wget https://doris.apache.org/release/doris-1.0.0.tar.gz
+   wget https://palo-cloud-repo-bd.bd.bcebos.com/baidu-doris-release/PALO-1.0.0-preview2-no-avx2-binary.tar.gz
+   ```
+
+3. 解压缩 tar.gz 文件
+
+   ```shell
+   tar -zxvf 下载好的二进制压缩包
+   # 例如
+   tar -zxvf PALO-1.0.0-preview2-no-avx2-binary.tar.gz
+   ```
+
+4. 迁移解压缩后的程序文件至指定目录并重命名
+
+   ```shell
+   mv 解压后的根目录 目标路径
+   cd 目标路径
+   # 例如
+   mv PALO-1.0.0-preview2-no-avx2-binary /opt/doris
+   cd /opt/doris
+   ```
+
+5. 配置 FE
+
+   ```shell
+   # 配置FE-Config
+   vi fe/conf/fe.conf
+   # 取消priority_networks的注释,修改参数
+   priority_networks = 127.0.0.0/24
+   # 保存退出
+   ```
+
+6. 配置 BE
+
+   ```shell
+   # 配置FE-Config
+   vi be/conf/be.conf
+   # 取消priority_networks的注释,修改参数
+   priority_networks = 127.0.0.0/24
+   # 保存退出
+   ```
+
+7. 配置环境变量
+
+   ```shell
+   # 配置环境变量
+   vim /etc/profile.d/doris.sh
+   export DORIS_HOME=Doris根目录 # 例如/opt/doris
+   export PATH=$PATH:$DORIS_HOME/fe/bin:$DORIS_HOME/be/bin
+   # 保存并source
+   source /etc/profile.d/doris.sh
+   ```
+
+8. 启动 FE 和 BE 并注册 BE 至 FE
+
+   ```shell
+   start_fe.sh --daemon
+   start_be.sh --daemon
+   ```
+
+   校验FE启动是否成功
+
+   > 1. 检查是否启动成功, JPS 命令下有没有 PaloFe 进程 
+   > 2. FE 进程启动后,会⾸先加载元数据,根据 FE ⻆⾊的不同,在⽇志中会看到 transfer from UNKNOWN to MASTER/FOLLOWER/OBSERVER 。最终会看到 thrift server started ⽇志,并且可以通过 mysql 客户端连接到 FE,则 表示 FE 启动成功。
+   > 3. 也可以通过如下连接查看是否启动成功: http://fe_host:fe_http_port/api/bootstrap 如果返回: {"status":"OK","msg":"Success"} 则表示启动成功,其余情况,则可能存在问题。
+   > 4. 外⽹环境访问 http://fe_host:fe_http_port 查看是否可以访问WebUI界 ⾯,登录账号默认为root,密码为空
+   >
+   > **注:如果在 fe.log 中查看不到启动失败的信息,也许在 fe.out 中可以看到。**
+
+   校验 BE 启动是否成功
+
+   > 1. BE 进程启动后,如果之前有数据,则可能有数分钟不等的数据索引加载时 间。 
+   > 2. 如果是 BE 的第⼀次启动,或者该 BE 尚未加⼊任何集群,则 BE ⽇志会定期滚 动 waiting to receive first heartbeat from frontend 字样。表示 BE 还未通过 FE 的⼼跳收到 Master 的地址,正在被动等待。这种错误⽇志, 在 FE 中 ADD BACKEND 并发送⼼跳后,就会消失。如果在接到⼼跳后,⼜重 复出现 master client, get client from cache failed.host: , port: 0, code: 7 字样,说明 FE 成功连接了 BE,但 BE ⽆法主动连接 FE。可能需要检查 BE 到 FE 的 rpc_port 的连通性。 
+   > 3. 如果 BE 已经被加⼊集群,⽇志中应该每隔 5 秒滚动来⾃ FE 的⼼跳⽇ 志: get heartbeat, host: xx.xx.xx.xx, port: 9020, cluster id: xxxxxx ,表示⼼跳正常。 
+   > 4. 其次,⽇志中应该每隔 10 秒滚动 finish report task success. return code: 0 的字样,表示 BE 向 FE 的通信正常。 
+   > 5. 同时,如果有数据查询,应该能看到不停滚动的⽇志,并且有 execute time is xxx ⽇志,表示 BE 启动成功,并且查询正常。 
+   > 6. 也可以通过如下连接查看是否启动成功: http://be_host:be_http_port/api/health 如果返回: {"status": "OK","msg": "To Be Added"} 则表示启动成功,其余情况,则可能存在问题。 
+   >
+   > **注:如果在 be.INFO 中查看不到启动失败的信息,也许在 be.out 中可以看到。**
+
+   注册 BE 至 FE(使用MySQL-Client,需自行安装)
+
+   ```shell
+   # 登录
+   mysql -h 127.0.0.1 -P 9030 -uroot
+   # 注册BE
+   ALTER SYSTEM ADD BACKEND "127.0.0.1:9050";
+   ```
+
+## Apache Doris简单使用
+
+Doris 采用 MySQL 协议进行通信,用户可通过 MySQL Client 或者 MySQL JDBC 连接到 Doris 集群。选择 MySQL client 版本时建议采用5.1 之后的版本,因为 5.1 之前不能支持长度超过 16 个字符的用户名。Doris SQL 语法基本覆盖 MySQL 语法。
+
+### Apache Doris Web UI访问
+
+默认使用 Http 协议进行 WebUI 访问,在浏览器输入以下格式地址访问
+
+```cql
+http://FE_IP:FE_HTTP_PORT(默认8030)
+```
+
+如在集群安装时修改了账号密码,则使用新的账号密码登陆
+
+```
+默认账号:root
+默认密码:空
+```
+
+1. WebUI简介
+
+   在 FE-WEB-UI 首页,罗列了 Version 和 Hardware Info
+
+   Tab 页有以下六个模块:
+
+   - Playground(可视化 SQL)
+
+   - System(系统状态)
+
+   - Log(集群日志)
+
+   - QueryProfile(SQL 执行日志)
+
+   - Session(链接列表)
+
+   - Configuration(配置参数)
+
+2. 查看BE列表
+
+   进入 `System` ——> `backends` 即可查看
+
+   需要关注的是 `Alive`列,该列的 `True `和 `False` 代表对应的BE节点的正常和异常状态
+
+3. profile查询
+
+   进入 QueryProfile 可以查看到最近的100条 SQL 执行 Report 信息,点击 QueryID 列的指定 ID 可以查看 Profile 信息
+
+### MySQL命令行/图形化客户端访问
+
+```shell
+# 命令行
+mysql -h FE-host -P 9030 -u用户名 -p密码
+# 客户端(Navicat为例)
+主机:FE-host(若是云服务器,则需要公网IP)
+端口:9030
+用户名:用户名
+密码:密码
+```
+
+#### Profile设置
+
+FE 将查询计划拆分成为 Fragment 下发到 BE 进行任务执行。BE 在执行 Fragment 时记录了**运行状态时的统计值**,并将 Fragment 执行的统计信息输出到日志之中。 FE 也可以通过开关将各个 Fragment 记录的这些统计值进行搜集,并在 FE 的Web页面上打印结果。
+
+- 打开 FE 的 Report 开关
+
+  ```mysql
+  set enable_profile=true; 
+  ```
+
+- 执行 SQL 语句后,可在 FE 的 WEB-UI 界面查看对应的 SQL 语句执行 Report 信息
+
+如需获取完整的参数对照表,请至 [Profile 参数解析](https://doris.apache.org/zh-CN/administrator-guide/running-profile.html#profile%E5%8F%82%E6%95%B0%E8%A7%A3%E6%9E%90 ) 查看详情
+
+#### 库表操作
+
+- 查看数据库列表
+
+  ```mysql
+  show databases;
+  ```
+
+- 创建数据库
+
+  ```mysql
+  CREATE DATABASE 数据库名;
+  ```
+
+  > 关于 Create-DataBase 使用的更多详细语法及最佳实践,请参阅 [Create-DataBase](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-DATABASE.html) 命令手册。
+  >
+  > 如果不清楚命令的全名,可以使用 "help 命令某一字段" 进行模糊查询。如键入 'HELP CREATE',可以匹配到 `CREATE DATABASE`, `CREATE TABLE`, `CREATE USER` 等命令。
+
+  数据库创建完成之后,可以通过 `SHOW DATABASES;` 查看数据库信息。
+
+  ```mysql
+  MySQL> SHOW DATABASES;
+  +--------------------+
+  | Database           |
+  +--------------------+
+  | example_db         |
+  | information_schema |
+  +--------------------+
+  2 rows in set (0.00 sec)
+  ```
+
+  `information_schema` 是为了兼容 MySQL 协议而存在,实际中信息可能不是很准确,所以关于具体数据库的信息建议通过直接查询相应数据库而获得。
+
+- 创建数据表
+
+  > 关于 Create-Table 使用的更多详细语法及最佳实践,请参阅 [Create-Table](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-TABLE.html) 命令手册。
+
+  使用 `CREATE TABLE` 命令建立一个表(Table)。更多详细参数可以查看:
+
+  ```mysql
+  HELP CREATE TABLE;
+  ```
+
+  首先切换数据库:
+
+  ```mysql
+  USE example_db;
+  ```
+
+  Doris 支持支持单分区和复合分区两种建表方式(详细区别请参阅 [Create-Table](../../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-TABLE.html) 命令手册) 。
+
+  下面以聚合模型为例,演示两种分区的建表语句。
+
+  - 单分区
+
+    建立一个名字为 table1 的逻辑表。分桶列为 siteid,桶数为 10。
+
+    这个表的 schema 如下:
+
+    - siteid:类型是INT(4字节), 默认值为10
+    - citycode:类型是 SMALLINT(2字节)
+    - username:类型是 VARCHAR, 最大长度为32, 默认值为空字符串
+    - pv:类型是 BIGINT(8字节), 默认值是0; 这是一个指标列, Doris 内部会对指标列做聚合操作, 这个列的聚合方法是求和(SUM)
+
+    建表语句如下:
+
+    ```mysql
+    CREATE TABLE table1
+    (
+        siteid INT DEFAULT '10',
+        citycode SMALLINT,
+        username VARCHAR(32) DEFAULT '',
+        pv BIGINT SUM DEFAULT '0'
+    )
+    AGGREGATE KEY(siteid, citycode, username)
+    DISTRIBUTED BY HASH(siteid) BUCKETS 10
+    PROPERTIES("replication_num" = "1");
+    ```
+
+  - 复合分区
+
+    建立一个名字为 table2 的逻辑表。
+
+    这个表的 schema 如下:
+
+    - event_day:类型是DATE,无默认值
+    - siteid:类型是 INT(4字节), 默认值为10
+    - citycode:类型是 SMALLINT(2字节)
+    - username:类型是 VARCHAR, 最大长度为32, 默认值为空字符串
+    - pv:类型是BIGINT(8字节), 默认值是0; 这是一个指标列, Doris 内部会对指标列做聚合操作, 这个列的聚合方法是求和(SUM)
+
+    我们使用 event_day 列作为分区列,建立3个分区: p201706, p201707, p201708
+
+    - p201706:范围为 [最小值, 2017-07-01)
+
+    - p201707:范围为 [2017-07-01, 2017-08-01)
+
+    - p201708:范围为 [2017-08-01, 2017-09-01)
+
+      > 注意区间为左闭右开。
+
+    每个分区使用 siteid 进行哈希分桶,桶数为10
+
+    建表语句如下:
+
+    ```mysql
+    CREATE TABLE table2
+    (
+        event_day DATE,
+        siteid INT DEFAULT '10',
+        citycode SMALLINT,
+        username VARCHAR(32) DEFAULT '',
+        pv BIGINT SUM DEFAULT '0'
+    )
+    AGGREGATE KEY(event_day, siteid, citycode, username)
+    PARTITION BY RANGE(event_day)
+    (
+        PARTITION p201706 VALUES LESS THAN ('2017-07-01'),
+        PARTITION p201707 VALUES LESS THAN ('2017-08-01'),
+        PARTITION p201708 VALUES LESS THAN ('2017-09-01')
+    )
+    DISTRIBUTED BY HASH(siteid) BUCKETS 10
+    PROPERTIES("replication_num" = "1");
+    ```
+
+    表建完之后,可以查看 example_db 中表的信息:
+
+    ```mysql
+    MySQL> SHOW TABLES;
+    +----------------------+
+    | Tables_in_example_db |
+    +----------------------+
+    | table1               |
+    | table2               |
+    +----------------------+
+    2 rows in set (0.01 sec)
+    
+    MySQL> DESC table1;
+    +----------+-------------+------+-------+---------+-------+
+    | Field    | Type        | Null | Key   | Default | Extra |
+    +----------+-------------+------+-------+---------+-------+
+    | siteid   | int(11)     | Yes  | true  | 10      |       |
+    | citycode | smallint(6) | Yes  | true  | N/A     |       |
+    | username | varchar(32) | Yes  | true  |         |       |
+    | pv       | bigint(20)  | Yes  | false | 0       | SUM   |
+    +----------+-------------+------+-------+---------+-------+
+    4 rows in set (0.00 sec)
+    
+    MySQL> DESC table2;
+    +-----------+-------------+------+-------+---------+-------+
+    | Field     | Type        | Null | Key   | Default | Extra |
+    +-----------+-------------+------+-------+---------+-------+
+    | event_day | date        | Yes  | true  | N/A     |       |
+    | siteid    | int(11)     | Yes  | true  | 10      |       |
+    | citycode  | smallint(6) | Yes  | true  | N/A     |       |
+    | username  | varchar(32) | Yes  | true  |         |       |
+    | pv        | bigint(20)  | Yes  | false | 0       | SUM   |
+    +-----------+-------------+------+-------+---------+-------+
+    5 rows in set (0.00 sec)
+    ```
+
+    > 注意事项:
+    >
+    > 1. 上述表通过设置 replication_num 建的都是单副本的表,Doris建议用户采用默认的 3 副本设置,以保证高可用。
+    > 2. 可以对复合分区表动态的增删分区。详见 `HELP ALTER TABLE` 中 Partition 相关部分。
+    > 3. 数据导入可以导入指定的 Partition。详见 `HELP LOAD`。
+    > 4. 可以动态修改表的 Schema。
+    > 5. 可以对 Table 增加上卷表(Rollup)以提高查询性能,这部分可以参见高级使用指南关于 Rollup 的描述。
+    > 6. 表的列的Null属性默认为true,会对查询性能有一定的影响。
+
+#### 插入数据
+
+1. Insert Into 插入
+
+   > 关于 Insert 使用的更多详细语法及最佳实践,请参阅 [Insert](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/INSERT.html) 命令手册。
+
+   Insert Into 语句的使用方式和 MySQL 等数据库中 Insert Into 语句的使用方式类似。但在 Doris 中,所有的数据写入都是一个独立的导入作业。所以这里将 Insert Into 也作为一种导入方式介绍。
+
+   主要的 Insert Into 命令包含以下两种;
+
+   - INSERT INTO tbl SELECT ...
+   - INSERT INTO tbl (col1, col2, ...) VALUES (1, 2, ...), (1,3, ...);
+
+   其中第二种命令仅用于 Demo,不要使用在测试或生产环境中。
+
+   Insert Into 命令需要通过 MySQL 协议提交,创建导入请求会同步返回导入结果。
+
+   语法:
+
+   ```mysql
+   INSERT INTO table_name [partition_info] [WITH LABEL label] [col_list] [query_stmt] [VALUES];
+   ```
+
+   示例:
+
+   ```mysql
+   INSERT INTO tbl2 WITH LABEL label1 SELECT * FROM tbl3;
+   INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"),("a");
+   ```
+
+   **注意**
+
+   当需要使用 `CTE(Common Table Expressions)` 作为 insert 操作中的查询部分时,必须指定 `WITH LABEL` 和 `column list` 部分。示例
+
+   ```mysql
+   INSERT INTO tbl1 WITH LABEL label1
+   WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+   SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+   
+   INSERT INTO tbl1 (k1)
+   WITH cte1 AS (SELECT * FROM tbl1), cte2 AS (SELECT * FROM tbl2)
+   SELECT k1 FROM cte1 JOIN cte2 WHERE cte1.k1 = 1;
+   ```
+
+   Insert Into 本身就是一个 SQL 命令,其返回结果会根据执行结果的不同,分为以下几种:
+
+   - 如果返回结果为 `ERROR 1064 (HY000)`,则表示导入失败。
+   - 如果返回结果为`Query OK`,则表示执行成功。
+      - 如果 `rows affected` 为 0,表示结果集为空,没有数据被导入。
+      - 如果`rows affected`大于 0:
+         - 如果 `status` 为 `committed`,表示数据还不可见。需要通过 `show transaction` 语句查看状态直到 `visible`
+         - 如果 `status` 为 `visible`,表示数据导入成功。
+      - 如果 `warnings` 大于 0,表示有数据被过滤,可以通过 `show load` 语句获取 url 查看被过滤的行。
+
+   更多详细说明,请参阅 [Insert](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/INSERT.html) 命令手册。
+
+2. 批量导入
+
+   Doris 支持多种数据导入方式。具体可以参阅数据导入文档。这里我们使用流式导入 (Stream-Load) 和 Broker-Load 导入做示例。
+
+   - Stream-Load
+
+     > 关于 Stream-Load 使用的更多详细语法及最佳实践,请参阅 [Stream-Load](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Load/STREAM-LOAD.html) 命令手册。
+
+     流式导入通过 HTTP 协议向 Doris 传输数据,可以不依赖其他系统或组件直接导入本地数据。详细语法帮助可以参阅 `HELP STREAM LOAD;`。
+
+     示例1:以 "table1_20170707" 为 Label,使用本地文件 table1_data 导入 table1 表。
+
+     ```CQL
+     curl --location-trusted -u test:test_passwd -H "label:table1_20170707" -H "column_separator:," -T table1_data http://FE_HOST:8030/api/example_db/table1/_stream_load
+     ```
+
+     > 1. FE_HOST 是任一 FE 所在节点 IP,8030 为 fe.conf 中的 http_port。
+     > 2. 可以使用任一 BE 的 IP,以及 be.conf 中的 webserver_port 进行导入。如:`BE_HOST:8040`
+
+     本地文件 `table1_data` 以 `,` 作为数据之间的分隔,具体内容如下:
+
+     ```text
+     1,1,jim,2
+     2,1,grace,2
+     3,2,tom,2
+     4,3,bush,3
+     5,3,helen,3
+     ```
+
+     示例2: 以 "table2_20170707" 为 Label,使用本地文件 table2_data 导入 table2 表。
+
+     ```CQL
+     curl --location-trusted -u test:test -H "label:table2_20170707" -H "column_separator:|" -T table2_data http://127.0.0.1:8030/api/example_db/table2/_stream_load
+     ```
+
+     本地文件 `table2_data` 以 `|` 作为数据之间的分隔,具体内容如下:
+
+     ```text
+     2017-07-03|1|1|jim|2
+     2017-07-05|2|1|grace|2
+     2017-07-12|3|2|tom|2
+     2017-07-15|4|3|bush|3
+     2017-07-12|5|3|helen|3
+     ```
+
+     > 注意事项:
+     >
+     > 1. 采用流式导入建议文件大小限制在 10GB 以内,过大的文件会导致失败重试代价变大。
+     > 2. 每一批导入数据都需要取一个 Label,Label 最好是一个和一批数据有关的字符串,方便阅读和管理。Doris 基于 Label 保证在一个Database 内,同一批数据只可导入成功一次。失败任务的 Label 可以重用。
+     > 3. 流式导入是同步命令。命令返回成功则表示数据已经导入,返回失败表示这批数据没有导入。
+
+   - Broker-Load
+
+     Broker 导入通过部署的 Broker 进程,读取外部存储上的数据进行导入。
+
+     > 关于 Broker Load 使用的更多详细语法及最佳实践,请参阅 [Broker Load](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Load/BROKER-LOAD.html) 命令手册,你也可以在 MySql 客户端命令行下输入 `HELP BROKER LOAD` 获取更多帮助信息。
+
+     示例:以 "table1_20170708" 为 Label,将 HDFS 上的文件导入 table1 表
+
+        ```mysql
+        LOAD LABEL table1_20170708
+        (
+            DATA INFILE("hdfs://your.namenode.host:port/dir/table1_data")
+            INTO TABLE table1
+        )
+        WITH BROKER hdfs 
+        (
+            "username"="hdfs_user",
+            "password"="hdfs_password"
+        )
+        PROPERTIES
+        (
+            "timeout"="3600",
+            "max_filter_ratio"="0.1"
+        );
+        ```
+
+     Broker 导入是异步命令。以上命令执行成功只表示提交任务成功。导入是否成功需要通过 `SHOW LOAD;` 查看。如:
+
+        ```mysql
+     SHOW LOAD WHERE LABEL = "table1_20170708";
+        ```
+
+     返回结果中,`State` 字段为 FINISHED 则表示导入成功。
+
+     关于 `SHOW LOAD` 的更多说明,可以参阅 `HELP SHOW LOAD;`
+
+     异步的导入任务在结束前可以取消:
+
+        ```mysql
+     CANCEL LOAD WHERE LABEL = "table1_20170708";
+        ```
+
+#### 查询数据
+
+1. 简单查询
+
+   ```mysql
+   MySQL> SELECT * FROM table1 LIMIT 3;
+   +--------+----------+----------+------+
+   | siteid | citycode | username | pv   |
+   +--------+----------+----------+------+
+   |      2 |        1 | 'grace'  |    2 |
+   |      5 |        3 | 'helen'  |    3 |
+   |      3 |        2 | 'tom'    |    2 |
+   +--------+----------+----------+------+
+   3 rows in set (0.01 sec)
+   
+   MySQL> SELECT * FROM table1 ORDER BY citycode;
+   +--------+----------+----------+------+
+   | siteid | citycode | username | pv   |
+   +--------+----------+----------+------+
+   |      2 |        1 | 'grace'  |    2 |
+   |      1 |        1 | 'jim'    |    2 |
+   |      3 |        2 | 'tom'    |    2 |
+   |      4 |        3 | 'bush'   |    3 |
+   |      5 |        3 | 'helen'  |    3 |
+   +--------+----------+----------+------+
+   5 rows in set (0.01 sec)
+   ```
+
+2. Join查询
+
+   ```mysql
+   MySQL> SELECT SUM(table1.pv) FROM table1 JOIN table2 WHERE table1.siteid = table2.siteid;
+   +--------------------+
+   | sum(`table1`.`pv`) |
+   +--------------------+
+   |                 12 |
+   +--------------------+
+   1 row in set (0.20 sec)
+   ```
+
+3. 子查询
+
+   ```mysql
+   MySQL> SELECT SUM(pv) FROM table2 WHERE siteid IN (SELECT siteid FROM table1 WHERE siteid > 2);
+   +-----------+
+   | sum(`pv`) |
+   +-----------+
+   |         8 |
+   +-----------+
+   1 row in set (0.13 sec)
+   ```
+
+#### 更新数据
+
+> 关于 Update 使用的更多详细语法及最佳实践,请参阅 [Update](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/UPDATE.html) 命令手册。
+
+当前 UPDATE 语句**仅支持**在 Unique 模型上的行更新,存在并发更新导致的数据冲突可能。 目前 Doris 并不处理这类问题,需要用户从业务侧规避这类问题。
+
+1. 语法规则
+
+   ```text
+   UPDATE table_name 
+       SET assignment_list
+       WHERE expression
+   
+   value:
+       {expr | DEFAULT}
+   
+   assignment:
+       col_name = value
+   
+   assignment_list:
+       assignment [, assignment] ...
+   ```
+
+   **参数说明**
+
+   - table_name: 待更新数据的目标表。可以是 'db_name.table_name' 形式
+   - assignment_list: 待更新的目标列,形如 'col_name = value, col_name = value' 格式
+   - where expression: 期望更新的条件,一个返回 true 或者 false 的表达式即可
+
+2. 示例
+
+   `test` 表是一个 unique 模型的表,包含: k1, k2, v1, v2 四个列。其中 k1, k2 是 key,v1, v2 是value,聚合方式是 Replace。
+
+   1. 将 'test' 表中满足条件 k1 =1 , k2 =2 的 v1 列更新为 1
+
+      ```text
+      UPDATE test SET v1 = 1 WHERE k1=1 and k2=2;
+      ```
+
+   2. 将 'test' 表中 k1=1 的列的 v1 列自增1
+
+      ```text
+      UPDATE test SET v1 = v1+1 WHERE k1=1;
+      ```
+
+#### 删除数据
+
+> 关于 Delete 使用的更多详细语法及最佳实践,请参阅 [Delete](../../../sql-manual/sql-reference-v2/Data-Manipulation-Statements/Manipulation/DELETE.html) 命令手册。
+
+1. 语法规则
+
+   ```mysql
+   该语句用于按条件删除指定 table(base index) partition 中的数据。
+   该操作会同时删除和此 base index 相关的 rollup index 的数据。
+   语法:
+       DELETE FROM table_name [PARTITION partition_name | PARTITIONS (p1, p2)]
+       WHERE
+       column_name1 op { value | value_list } [ AND column_name2 op { value | value_list } ...];
+       
+   说明:
+       1) op 的可选类型包括:=, >, <, >=, <=, !=, in, not in
+       2) 只能指定 key 列上的条件。
+       2) 当选定的 key 列不存在于某个 rollup 中时,无法进行 delete。
+       3) 条件之间只能是“与”的关系。
+          若希望达成“或”的关系,需要将条件分写在两个 DELETE 语句中。
+       4) 如果为分区表,可以指定分区,如不指定,且会话变量 delete_without_partition 为 true,则会应用到所有分区。如果是单分区表,可以不指定。
+          
+   注意:
+       该语句可能会降低执行后一段时间内的查询效率。
+       影响程度取决于语句中指定的删除条件的数量。
+       指定的条件越多,影响越大。
+   ```
+
+2. 示例
+
+   ```mysql
+   1. 删除 my_table partition p1 中 k1 列值为 3 的数据行
+       DELETE FROM my_table PARTITION p1
+       WHERE k1 = 3;
+       
+   2. 删除 my_table partition p1 中 k1 列值大于等于 3 且 k2 列值为 "abc" 的数据行
+       DELETE FROM my_table PARTITION p1
+       WHERE k1 >= 3 AND k2 = "abc";
+   
+   3. 删除 my_table partition p1, p2 中 k1 列值大于等于 3 且 k2 列值为 "abc" 的数据行
+       DELETE FROM my_table PARTITIONS (p1, p2)
+       WHERE k1 >= 3 AND k2 = "abc";
+   ```
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org