This is an automated email from the ASF dual-hosted git repository.
zhaoc 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 6f3c50a [Document] Add example for using CTE in INSERT operation
(#2572)
6f3c50a is described below
commit 6f3c50a95c0ff7af26430b7416ed086422dc01ee
Author: Mingyu Chen <[email protected]>
AuthorDate: Thu Dec 26 10:00:34 2019 +0800
[Document] Add example for using CTE in INSERT operation (#2572)
---
.../administrator-guide/load-data/insert-into-manual.md | 15 +++++++++++++++
docs/documentation/cn/administrator-guide/variables.md | 2 +-
.../load-data/insert-into-manual_EN.md | 15 +++++++++++++++
docs/documentation/en/administrator-guide/variables_EN.md | 2 +-
.../java/org/apache/doris/common/GenericPoolTest.java | 9 ++++++++-
5 files changed, 40 insertions(+), 3 deletions(-)
diff --git
a/docs/documentation/cn/administrator-guide/load-data/insert-into-manual.md
b/docs/documentation/cn/administrator-guide/load-data/insert-into-manual.md
index eab3618..ed62078 100644
--- a/docs/documentation/cn/administrator-guide/load-data/insert-into-manual.md
+++ b/docs/documentation/cn/administrator-guide/load-data/insert-into-manual.md
@@ -47,6 +47,21 @@ INSERT INTO tbl2 WITH LABEL label1 SELECT * FROM tbl3;
INSERT INTO tbl1 VALUES ("qweasdzxcqweasdzxc"), ("a");
```
+**注意**
+
+当需要使用 `CTE(Common Table Expressions)` 作为 insert 操作中的查询部分时,必须指定 `WITH LABEL` 和
column list 部分。示例
+
+```
+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;
+```
+
下面主要介绍创建导入语句中使用到的参数:
+ partition\_info
diff --git a/docs/documentation/cn/administrator-guide/variables.md
b/docs/documentation/cn/administrator-guide/variables.md
index 2651160..c7ef612 100644
--- a/docs/documentation/cn/administrator-guide/variables.md
+++ b/docs/documentation/cn/administrator-guide/variables.md
@@ -253,7 +253,7 @@ SET forward_to_master = concat('tr', 'u', 'e');
一个查询计划通常会产生一组 scan range,即需要扫描的数据范围。这些数据分布在多个 BE 节点上。一个 BE 节点会有一个或多个 scan
range。默认情况下,每个 BE 节点的一组 scan range
只由一个执行实例处理。当机器资源比较充裕时,可以将增加该变量,让更多的执行实例同时处理一组 scan range,从而提升查询效率。
- 修改该参数仅对扫描节点的效率提升有帮助。较大数值可能会消耗更多的机器资源,如CPU、内存、磁盘IO。
+ 而 scan 实例的数量决定了上层其他执行节点,如聚合节点,join
节点的数量。因此相当于增加了整个查询计划执行的并发度。修改该参数会对大查询效率提升有帮助,但较大数值会消耗更多的机器资源,如CPU、内存、磁盘IO。
* `query_cache_size`
diff --git
a/docs/documentation/en/administrator-guide/load-data/insert-into-manual_EN.md
b/docs/documentation/en/administrator-guide/load-data/insert-into-manual_EN.md
index 0df1153..0955492 100644
---
a/docs/documentation/en/administrator-guide/load-data/insert-into-manual_EN.md
+++
b/docs/documentation/en/administrator-guide/load-data/insert-into-manual_EN.md
@@ -47,6 +47,21 @@ 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 of insert
operation, the `WITH LABEL` or column list part must be specified.
+For example:
+
+```
+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;
+```
+
The following is a brief introduction to the parameters used in creating
import statements:
+ partition\_info
diff --git a/docs/documentation/en/administrator-guide/variables_EN.md
b/docs/documentation/en/administrator-guide/variables_EN.md
index f483f10..4be7a7c 100644
--- a/docs/documentation/en/administrator-guide/variables_EN.md
+++ b/docs/documentation/en/administrator-guide/variables_EN.md
@@ -254,7 +254,7 @@ SET forward_to_master = concat('tr', 'u', 'e');
A query plan typically produces a set of scan ranges, the range of data
that needs to be scanned. These data are distributed across multiple BE nodes.
A BE node will have one or more scan ranges. By default, a set of scan ranges
for each BE node is processed by only one execution instance. When the machine
resources are abundant, you can increase the variable and let more execution
instances process a set of scan ranges at the same time, thus improving query
efficiency.
- Modifying this parameter is only helpful for improving the efficiency of
the scan node. Larger values may consume more machine resources such as CPU,
memory, and disk IO.
+ The number of scan instances determines the number of other execution
nodes in the upper layer, such as aggregate nodes and join nodes. Therefore, it
is equivalent to increasing the concurrency of the entire query plan execution.
Modifying this parameter will help improve the efficiency of large queries, but
larger values will consume more machine resources, such as CPU, memory, and
disk IO.
* `query_cache_size`
diff --git a/fe/src/test/java/org/apache/doris/common/GenericPoolTest.java
b/fe/src/test/java/org/apache/doris/common/GenericPoolTest.java
index 75f6e3d..e4ec3ee 100644
--- a/fe/src/test/java/org/apache/doris/common/GenericPoolTest.java
+++ b/fe/src/test/java/org/apache/doris/common/GenericPoolTest.java
@@ -62,12 +62,18 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
+import java.util.Random;
public class GenericPoolTest {
static GenericPool<BackendService.Client> backendService;
static ThriftServer service;
static String ip = "127.0.0.1";
- static int port = 39401;
+ static int port;
+
+ static {
+ Random r = new Random(System.currentTimeMillis());
+ port = 20000 + r.nextInt(10000);
+ }
static void close() {
if (service != null) {
@@ -92,6 +98,7 @@ public class GenericPoolTest {
new InternalProcessor());
service = new ThriftServer(port, tprocessor);
service.start();
+ Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
close();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]