Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
{
"title": "SHOW STREAM LOAD",
"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
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# SHOW STREAM LOAD
## Description
This statement is used to show the execution of the specified import task
Grammar:
SHOW STREAM LOAD
[FROM both names]
[
WHERE
[LABEL [ = "your_label" | LIKE "label_matcher"]]
[STATUS = ["SUCCESS"|"FAIL"|]]
]
[ORDER BY ...]
[LIMIT limit][OFFSET offset];

Explain:
1) If db_name is not specified, use the current default DB
2) If you use LABEL LIKE, the label that matches the task contains the STREAM LOAD task of label_matcher
3) If LABEL = is used, the specified label is matched accurately.
4) If STATUS is specified, the STREAM LOAD status is matched
5) Arbitrary column combinations can be sorted using ORDER BY
6) If LIMIT is specified, the limit bar matching record is displayed. Otherwise, all of them will be displayed.
7) If OFFSET is specified, the query results are displayed from offset. By default, the offset is 0.

## example
1. Show all STREAM LOAD tasks of default DB
SHOW STREAM LOAD;

2. Show the STREAM LOAD task of the specified db. The label contains the string "2014_01_02", showing the oldest 10
SHOW STREAM LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10;

3. Show the STREAM LOAD task of the specified db, specify label as "load_example_db_20140102"
SHOW STREAM LOAD FROM example_db WHERE LABEL = "load_example_db_20140102";

4. Show the STREAM LOAD task of the specified db, specify status as "success", and sort it in descending order by LoadStartTime
SHOW STREAM LOAD FROM example_db WHERE STATUS = "success" ORDER BY LoadStartTime DESC;

5. Show the STREAM LOAD task of the specified dB and sort it in descending order by LoadStartTime, and display 10 query results starting with offset 5
SHOW STREAM LOAD FROM example_db ORDER BY LoadStartTime DESC limit 5,10;
SHOW STREAM LOAD FROM example_db ORDER BY LoadStartTime DESC limit 10 offset 5;

## keyword
SHOW,STREAM LOAD
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
{
"title": "SHOW STREAM LOAD",
"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
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# SHOW STREAM LOAD
## description
该语句用于展示指定的Stream Load任务的执行情况
语法:
SHOW STREAM LOAD
[FROM db_name]
[
WHERE
[LABEL [ = "your_label" | LIKE "label_matcher"]]
[STATUS = ["SUCCESS"|"FAIL"]]
]
[ORDER BY ...]
[LIMIT limit][OFFSET offset];

说明:
1) 如果不指定 db_name,使用当前默认db
2) 如果使用 LABEL LIKE,则会匹配Stream Load任务的 label 包含 label_matcher 的任务
3) 如果使用 LABEL = ,则精确匹配指定的 label
4) 如果指定了 STATUS,则匹配 STREAM LOAD 状态
5) 可以使用 ORDER BY 对任意列组合进行排序
6) 如果指定了 LIMIT,则显示 limit 条匹配记录。否则全部显示
7) 如果指定了 OFFSET,则从偏移量offset开始显示查询结果。默认情况下偏移量为0。

## example
1. 展示默认 db 的所有Stream Load任务
SHOW STREAM LOAD;

2. 展示指定 db 的Stream Load任务,label 中包含字符串 "2014_01_02",展示最老的10个
SHOW STREAM LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10;

3. 展示指定 db 的Stream Load任务,指定 label 为 "load_example_db_20140102"
SHOW STREAM LOAD FROM example_db WHERE LABEL = "load_example_db_20140102";

4. 展示指定 db 的Stream Load任务,指定 status 为 "success", 并按 LoadStartTime 降序排序
SHOW STREAM LOAD FROM example_db WHERE STATUS = "success" ORDER BY LoadStartTime DESC;

5. 展示指定 db 的导入任务 并按 LoadStartTime 降序排序,并从偏移量5开始显示10条查询结果
SHOW STREAM LOAD FROM example_db ORDER BY LoadStartTime DESC limit 5,10;
SHOW STREAM LOAD FROM example_db ORDER BY LoadStartTime DESC limit 10 offset 5;

## keyword
SHOW,STREAM LOAD

7 changes: 6 additions & 1 deletion fe/fe-core/src/main/cup/sql_parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ terminal String KW_ADD, KW_ADMIN, KW_AFTER, KW_AGGREGATE, KW_ALL, KW_ALTER, KW_A
KW_REPAIR, KW_REPEATABLE, KW_REPOSITORY, KW_REPOSITORIES, KW_REPLACE, KW_REPLACE_IF_NOT_NULL, KW_REPLICA, KW_RESOURCE, KW_RESOURCES, KW_RESTORE, KW_RETURNS, KW_RESUME, KW_REVOKE,
KW_RIGHT, KW_ROLE, KW_ROLES, KW_ROLLBACK, KW_ROLLUP, KW_ROUTINE, KW_ROW, KW_ROWS,
KW_S3, KW_SCHEMA, KW_SCHEMAS, KW_SECOND, KW_SELECT, KW_SEMI, KW_SERIALIZABLE, KW_SESSION, KW_SET, KW_SETS, KW_SET_VAR, KW_SHOW, KW_SIGNED,
KW_SMALLINT, KW_SNAPSHOT, KW_SONAME, KW_SPLIT, KW_START, KW_STATUS, KW_STOP, KW_STORAGE, KW_STRING,
KW_SMALLINT, KW_SNAPSHOT, KW_SONAME, KW_SPLIT, KW_START, KW_STATUS, KW_STOP, KW_STORAGE, KW_STREAM, KW_STRING,
KW_SUM, KW_SUPERUSER, KW_SYNC, KW_SYSTEM,
KW_TABLE, KW_TABLES, KW_TABLET, KW_TASK, KW_TEMPORARY, KW_TERMINATED, KW_THAN, KW_TIME, KW_THEN, KW_TIMESTAMP, KW_TINYINT,
KW_TO, KW_TRANSACTION, KW_TRIGGERS, KW_TRIM, KW_TRUE, KW_TRUNCATE, KW_TYPE, KW_TYPES,
Expand Down Expand Up @@ -2446,6 +2446,11 @@ show_param ::=
{:
RESULT = new ShowLoadStmt(db, parser.where, orderByClause, limitClause);
:}
/* Show stream load statement */
| KW_STREAM KW_LOAD opt_db:db opt_wild_where order_by_clause:orderByClause limit_clause:limitClause
{:
RESULT = new ShowStreamLoadStmt(db, parser.where, orderByClause, limitClause);
:}
/* Show export statement */
| KW_EXPORT opt_db:db opt_wild_where order_by_clause:orderByClause limit_clause:limitClause
{:
Expand Down
Loading