Skip to content

Commit e5ffc14

Browse files
authored
Merge branch 'main' into table_stage_file_duplicate_rfc
2 parents 61bb138 + 9efea7f commit e5ffc14

File tree

150 files changed

+7253
-2029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+7253
-2029
lines changed

Cargo.lock

Lines changed: 29 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/doc/30-reference/20-functions/30-datetime-functions/todatetime.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ The function extracts a date and time from the provided string. If the argument
2222

2323
Returns a value of Timestamp type in the format “YYYY-MM-DD hh:mm:ss.ffffff”.
2424

25+
If the expr matches this format but does not have a time part, it is automatically extended to this pattern. The padding value is 0.
26+
2527
## Examples
2628

2729
### Using a String as Argument
@@ -46,6 +48,11 @@ SELECT TO_DATETIME('2022-01-02T01:12:00-07:00');
4648

4749
---
4850
2022-01-02 08:12:00.000000
51+
52+
SELECT TO_DATETIME('2022-01-02T01');
53+
54+
---
55+
2022-01-02 01:00:00.000000
4956
```
5057

5158
### Using an Integer as Argument

docs/doc/30-reference/30-sql/00-ddl/40-stage/01-ddl-create-stage.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CREATE STAGE [ IF NOT EXISTS ] <internal_stage_name>
1212
[ FILE_FORMAT = ( { TYPE = { CSV | PARQUET } [ formatTypeOptions ] ) } ]
1313
[ COPY_OPTIONS = ( copyOptions ) ]
1414
[ COMMENT = '<string_literal>' ]
15-
15+
1616
-- External stage
1717
CREATE STAGE [ IF NOT EXISTS ] <external_stage_name>
1818
externalStageParams
@@ -70,8 +70,8 @@ externalStageParams ::=
7070
### formatTypeOptions
7171
```
7272
formatTypeOptions ::=
73-
RECORD_DELIMITER = '<character>'
74-
FIELD_DELIMITER = '<character>'
73+
RECORD_DELIMITER = '<character>'
74+
FIELD_DELIMITER = '<character>'
7575
SKIP_HEADER = <integer>
7676
```
7777

@@ -85,11 +85,13 @@ formatTypeOptions ::=
8585
```
8686
copyOptions ::=
8787
[ SIZE_LIMIT = <num> ]
88+
[ PURGE = <bool> ]
8889
```
8990

9091
| Parameters | Description | Required |
9192
| ----------- | ----------- | --- |
9293
| `SIZE_LIMIT = <num>` | Number (> 0) that specifies the maximum rows of data to be loaded for a given COPY statement. Default `0` | Optional |
94+
| `PURGE = <bool>` | True specifies that the command will purge the files in the stage if they are loaded successfully into table. Default `false` | Optional |
9395

9496

9597
## Examples

docs/doc/30-reference/30-sql/10-dml/dml-copy-into-location.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ externalLocation (for Amazon S3) ::=
5656
### formatTypeOptions
5757
```
5858
formatTypeOptions ::=
59-
RECORD_DELIMITER = '<character>'
60-
FIELD_DELIMITER = '<character>'
59+
RECORD_DELIMITER = '<character>'
60+
FIELD_DELIMITER = '<character>'
6161
SKIP_HEADER = <integer>
6262
```
6363

docs/doc/30-reference/30-sql/10-dml/dml-copy-into-table.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ A regular expression pattern string, enclosed in single quotes, specifying the f
9797

9898
```
9999
formatTypeOptions ::=
100-
RECORD_DELIMITER = '<character>'
101-
FIELD_DELIMITER = '<character>'
100+
RECORD_DELIMITER = '<character>'
101+
FIELD_DELIMITER = '<character>'
102102
SKIP_HEADER = <integer>
103103
COMPRESSION = AUTO | GZIP | BZ2 | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | NONE
104104
```
@@ -129,7 +129,7 @@ Default: `NONE`
129129

130130
Values:
131131

132-
| Values | Notes |
132+
| Values | Notes |
133133
|---------------|-----------------------------------------------------------------|
134134
| `AUTO` | Auto detect compression via file extensions |
135135
| `GZIP` | |
@@ -145,11 +145,13 @@ Values:
145145
```
146146
copyOptions ::=
147147
[ SIZE_LIMIT = <num> ]
148+
[ PURGE = <bool> ]
148149
```
149150

150151
| Parameters | Description | Required |
151152
| ----------- | ----------- | --- |
152153
| `SIZE_LIMIT = <num>` | Number (> 0) that specifies the maximum rows of data to be loaded for a given COPY statement. Default `0` | Optional |
154+
| `PURGE = <bool>` | True that specifies the command will purge the files in the stage if they are loaded successfully into table. Default `false` | Optional |
153155

154156
## Examples
155157

docs/doc/30-reference/30-sql/70-system-tables/system-query-log.md

Lines changed: 100 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,71 @@
22
title: system.query_log
33
---
44

5-
A read-only in-memory table stores all the query logs;
5+
A read-only in-memory table stores all the query logs.
66

7-
```sql
8-
SELECT * FROM system.query_log ORDER BY event_time DESC LIMIT 1\G
9-
*************************** 1. row ***************************
7+
8+
## Columns
9+
10+
```
11+
CREATE TABLE `query_log` (
12+
`log_type` TINYINT,
13+
`handler_type` VARCHAR,
14+
`tenant_id` VARCHAR,
15+
`cluster_id` VARCHAR,
16+
`sql_user` VARCHAR,
17+
`sql_user_quota` VARCHAR,
18+
`sql_user_privileges` VARCHAR,
19+
`query_id` VARCHAR,
20+
`query_kind` VARCHAR,
21+
`query_text` VARCHAR,
22+
`event_date` DATE,
23+
`event_time` TIMESTAMP(3),
24+
`current_database` VARCHAR,
25+
`databases` VARCHAR,
26+
`tables` VARCHAR,
27+
`columns` VARCHAR,
28+
`projections` VARCHAR,
29+
`written_rows` BIGINT UNSIGNED,
30+
`written_bytes` BIGINT UNSIGNED,
31+
`written_io_bytes` BIGINT UNSIGNED,
32+
`written_io_bytes_cost_ms` BIGINT UNSIGNED,
33+
`scan_rows` BIGINT UNSIGNED,
34+
`scan_bytes` BIGINT UNSIGNED,
35+
`scan_io_bytes` BIGINT UNSIGNED,
36+
`scan_io_bytes_cost_ms` BIGINT UNSIGNED,
37+
`scan_partitions` BIGINT UNSIGNED,
38+
`total_partitions` BIGINT UNSIGNED,
39+
`result_rows` BIGINT UNSIGNED,
40+
`result_bytes` BIGINT UNSIGNED,
41+
`cpu_usage` INT UNSIGNED,
42+
`memory_usage` BIGINT UNSIGNED,
43+
`client_info` VARCHAR,
44+
`client_address` VARCHAR,
45+
`exception_code` INT,
46+
`exception_text` VARCHAR,
47+
`stack_trace` VARCHAR,
48+
`server_version` VARCHAR,
49+
`session_settings` VARCHAR,
50+
`extra` VARCHAR
51+
)
52+
```
53+
54+
## Examples
55+
56+
```
57+
*************************** 4. row ***************************
1058
log_type: 1
1159
handler_type: MySQL
12-
tenant_id: test_tenant
13-
cluster_id: test_cluster
60+
tenant_id: admin
61+
cluster_id:
1462
sql_user: root
1563
sql_user_quota: UserQuota<cpu:0,mem:0,store:0>
16-
sql_user_privileges: GRANT ALL ON *.* TO 'root'@'127.0.0.1', ROLES: []
17-
query_id: da879c17-94bb-4163-b2ac-ff4786bbe69e
18-
query_kind: SelectPlan
19-
query_text: SELECT * from system.query_log order by event_time desc limit 1
20-
event_date: 2022-03-24
21-
event_time: 2022-03-24 11:13:27.414
64+
sql_user_privileges: GRANT ALL ON *.*, ROLES: []
65+
query_id: eda2a82b-3667-4ffb-b436-953785178c39
66+
query_kind: Query
67+
query_text: select avg(number) from numbers(1000000)
68+
event_date: 2022-09-08
69+
event_time: 2022-09-08 03:32:39.517
2270
current_database: default
2371
databases:
2472
tables:
@@ -34,16 +82,50 @@ written_io_bytes_cost_ms: 0
3482
scan_io_bytes_cost_ms: 0
3583
scan_partitions: 0
3684
total_partitions: 0
37-
result_rows: 0
38-
result_bytes: 0
39-
cpu_usage: 10
40-
memory_usage: 1603
85+
86+
, skip_header=0, sql_dialect=PostgreSQL, storage_read_buffer_size=1048576, timezone=UTC, unquoted_ident_case_sensitive=0, wait_for_async_insert=1, wait_for_async_insert_timeout=100, scope: SESSION
87+
extra:
88+
89+
90+
*************************** 5. row ***************************
91+
log_type: 2
92+
handler_type: MySQL
93+
tenant_id: admin
94+
cluster_id:
95+
sql_user: root
96+
sql_user_quota: UserQuota<cpu:0,mem:0,store:0>
97+
sql_user_privileges: GRANT ALL ON *.*, ROLES: []
98+
query_id: eda2a82b-3667-4ffb-b436-953785178c39
99+
query_kind: Query
100+
query_text: select avg(number) from numbers(1000000)
101+
event_date: 2022-09-08
102+
event_time: 2022-09-08 03:32:39.519
103+
current_database: default
104+
databases:
105+
tables:
106+
columns:
107+
projections:
108+
written_rows: 0
109+
written_bytes: 0
110+
written_io_bytes: 0
111+
written_io_bytes_cost_ms: 0
112+
scan_rows: 1000000
113+
scan_bytes: 8000000
114+
scan_io_bytes: 0
115+
scan_io_bytes_cost_ms: 0
116+
scan_partitions: 0
117+
total_partitions: 0
118+
result_rows: 1
119+
result_bytes: 9
120+
cpu_usage: 24
121+
memory_usage: 0
41122
client_info:
42-
client_address: 127.0.0.1:56744
123+
client_address: 127.0.0.1:53304
43124
exception_code: 0
44125
exception_text:
45126
stack_trace:
46127
server_version:
47-
session_settings: enable_new_processor_framework=1, flight_client_timeout=60, max_block_size=10000, max_threads=8, storage_occ_backoff_init_delay_ms=5, storage_occ_backoff_max_delay_ms=20000, storage_occ_backoff_max_elapsed_ms=120000, storage_read_buffer_size=1048576, scope: SESSION
128+
session_settings: compression=None, empty_as_default=1, enable_async_insert=0, enable_new_processor_framework=1, enable_planner_v2=1, field_delimiter=,, flight_client_timeout=60, group_by_two_level_threshold=10000, max_block_size=10000, max_execute_time=0, max_threads=24, quoted_ident_case_sensitive=1, record_delimiter=
129+
, skip_header=0, sql_dialect=PostgreSQL, storage_read_buffer_size=1048576, timezone=UTC, unquoted_ident_case_sensitive=0, wait_for_async_insert=1, wait_for_async_insert_timeout=100, scope: SESSION
48130
extra:
49131
```

src/binaries/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ common-grpc = { path = "../common/grpc" }
3333
common-macros = { path = "../common/macros" }
3434
common-meta-api = { path = "../meta/api" }
3535
common-meta-app = { path = "../meta/app" }
36+
common-meta-client = { path = "../meta/client" }
3637
common-meta-embedded = { path = "../meta/embedded" }
37-
common-meta-grpc = { path = "../meta/grpc" }
3838
common-meta-raft-store = { path = "../meta/raft-store" }
3939
common-meta-sled-store = { path = "../meta/sled-store" }
4040
common-meta-store = { path = "../meta/store" }

0 commit comments

Comments
 (0)