Commit Graph

11766 Commits

Author SHA1 Message Date
307149dc35 [pipeline](task_queue) remove disable steal in task queue to speed up query (#21692)
TPCH Q9

before: 2.74s
after: 2.33s
2023-07-10 22:21:56 +08:00
f5641b59ae [typo](docs) Fixed a typo that changed "不再分区范围内的数据" to "不在分区范围内的数据" (#21655) 2023-07-10 22:17:53 +08:00
90bebc57b9 [docs]Update upgrade.md #21658
* Update upgrade.md

* Update upgrade.md
2023-07-10 22:17:05 +08:00
24290799c4 [improvement](tpch) run-tpch-query.sh add analyze database with sync and calculate total time (#21652)
* run-tpch-query shell add analyze database with sync and calculate total time

* run-tpch-query shell add analyze database with sync and calculate total time
2023-07-10 22:04:57 +08:00
8973610543 [feature](datetime) "timediff" supports calculating microseconds (#21371) 2023-07-10 19:21:32 +08:00
202a5c636f [fix](create table) modify varchar default length 1 to 65533 (#21302)
*modify archer default length 1 to  varchar.max.length , when create table.*

```mysql
create table t2 (             
k1 CHAR,              
K2 CHAR(10) ,               
K3 VARCHAR ,             
 K4 VARCHAR(1024) )              
duplicate key (k1)              
distributed by hash(k1) buckets 1              
properties('replication_num' = '1');  

desc t2;
```

| Field | Type           | Null | Key   | Default | Extra |
| -- |--|--| -| -| -| 
| k1    | CHAR(1)        | Yes  | true  | NULL    |       |
| K2    | CHAR(10)       | Yes  | false | NULL    | NONE  |
| K3    | VARCHAR(65533) | Yes  | false | NULL    | NONE  |
| K4    | VARCHAR(1024)  | Yes  | false | NULL    | NONE  |
2023-07-10 17:57:21 +08:00
36524f2b72 [improvement](functions) avoid copying of block in create_block_with_nested_columns (#21526)
avoid copying of block in create_block_with_nested_columns
2023-07-10 17:21:23 +08:00
842fe00157 [enhancement](flush) make writer write fail status visible (#21530) 2023-07-10 17:14:33 +08:00
2b04fa604c fix: toCalendar should use Calendar.MONTH instead MONDAY (#21665) 2023-07-10 16:49:42 +08:00
0be349e250 [feature](jdbc) Support jdbc catalog to read json types (#21341) 2023-07-10 16:21:00 +08:00
1a08c81adc [Profile](runtimefilter) fix merge time of runtime filter (#21654) 2023-07-10 16:16:05 +08:00
a1a8ee8320 [enchancement](stats) Inject partition statistics #21543
The cost estimation can be more accurate if the statistics of partition are available. But we are running big data like 1T, can not really import.

So now we want to extend this by injecting partition statistics.

Syntax:

ALTER TABLE table_name MODIFY COLUMN column_name SET STATS ('stat_name' = 'stat_value', ...)
  [ PARTITION (partition_name) ];
Explanation:

- Table_name: The table to which the statistics are dropped. It can be a db_name.table_name form.
Column_name: Specified target column. table_name Must be a column that exists in. Statistics can only be modified one column at a time.

- Stat _ name and stat _ value: The corresponding stat name and the value of the stat info. Multiple stats are comma separated. Statistics that can be modified include row_count, ndv, num_nulls min_value max_value, and data_size.

- Partition_name: specifies the target partition. Must be a partition existing in table_name. Multiple partitions are separated by commas.
2023-07-10 15:06:25 +08:00
7d4c47e250 [Enhancement](Compaction) Caculate all committed rowsets delete bitmaps when do comapction (#20907)
Here we will calculate all the rowsets delete bitmaps which are committed but not published to reduce the calculation pressure of publish phase.

Step1: collect this tablet's all committed rowsets' delete bitmaps.

Step2: calculate all rowsets' delete bitmaps which are published during compaction.

Step3: write back updated delete bitmap and tablet info.
2023-07-10 14:06:11 +08:00
9f3bc11b04 [improvement](ssb) run-ssb-queries.sh and run-ssb-flat-queries.sh add analyze database with sync and calculate total time #21653 2023-07-10 11:45:45 +08:00
f9c56d59fc [improvement](statistics)Support external table show table stats, modify column stats and drop stats (#21624)
Support external table show table stats, modify column stats and drop stats.
2023-07-10 11:33:06 +08:00
Pxl
77336bff44 [Bug](materialized-view) adjust limit for create materialized view on uniq/agg table (#21580)
adjust limit for create materialized view on uniq/agg table
2023-07-10 10:04:17 +08:00
ee9822fa7e [Fix](pipeline) fix ExchangeSinkBuffer request id memory alloc problem (#21647)
Co-authored-by: airborne12 <airborne12@gmail.com>
fix ExchangeSinkBuffer request id memory alloc problem
2023-07-09 23:45:28 +08:00
469c8b7ece [Fix](JSON LOAD)fix json load issue when string conform with RFC 4627 #21390
should set: enable_simdjson_reader=false in master as master enable_simdjson_reader=true by default.

Issue Number: close #21389

from rapidjson:

Query String
In addition to GetString(), the Value class also contains GetStringLength(). Here explains why:

According to RFC 4627, JSON strings can contain Unicode character U+0000, which must be escaped as "\u0000". The problem is that, C/C++ often uses null-terminated string, which treats \0 as the terminator symbol.

To conform with RFC 4627, RapidJSON supports string containing U+0000 character. If you need to handle this, you can use GetStringLength() to obtain the correct string length.

For example, after parsing the following JSON to Document d:

{ "s" : "a\u0000b" }
The correct length of the string "a\u0000b" is 3, as returned by GetStringLength(). But strlen() returns 1.

GetStringLength() can also improve performance, as user may often need to call strlen() for allocating buffer.

Besides, std::string also support a constructor:

string(const char* s, size_t count);
which accepts the length of string as parameter. This constructor supports storing null character within the string, and should also provide better performance.
2023-07-09 17:16:03 +08:00
41fb3d5fa4 [opt](Nereids): Join use List<Plan> as children (#21608)
Join use List as children can avoid to construct extra ImmutableList
2023-07-09 17:11:55 +08:00
d9974e6337 [Chore](Job)Fix the wrong log when the export job reads fields and add more clear log information (#21490)
* [Chore](Job)Fix the wrong log when the export job reads fields and add more clear log information

* add OriginStatement .toString method
2023-07-09 17:06:38 +08:00
779b675e9d [test](fix) Case bug (#21518)
* add sync after streamLoad
2023-07-09 16:52:40 +08:00
cf1efce824 [fix](inverted index) use index id instead of column uid to determine whether a hard link is required when build index (#21574)
Fix problem:
For the same column, there are concurrent drop index request and build index request, if build index obtain lock before drop index, build a new index file, but when drop index request execute, link file not contains all index files for the column, that lead to new index file is missed.

Based on the above questions, use index id instead of column unique id to determine whether a hard link is required when do build index
2023-07-09 16:45:27 +08:00
6b945680a7 [Improve](point query) audit point query (#21587) 2023-07-09 16:43:41 +08:00
bf61d2cfc0 [fix](sink) fix pipeline load stuck #21636 2023-07-09 16:27:11 +08:00
015426b2b4 [fix](tablet report) fix fe can not update replica's status with be's report #21600 2023-07-09 16:23:18 +08:00
aacb9b9b66 [Enhancement](binlog) Add create/drop table, add/drop paritition && alter job, modify columns binlog support (#21544) 2023-07-09 09:11:56 +08:00
c36cd18a08 [docs](docs)add more explanation for Fe config (#21627)
add more explanation for Fe config
2023-07-09 08:46:37 +08:00
f2fb23e98f [pipeline](exec) disable pipeline load in now version (#21632) 2023-07-09 01:00:06 +08:00
1b226ff8a2 [refactor](load) remove FlushContext from SegmentWriter (#21596)
* [refactor](load) remove FlushContext from SegmentWriter

* remove unused imports
2023-07-08 22:44:56 +08:00
c58d5cd81b [opt](regression case) add more index change regression case (#21633) 2023-07-08 22:23:09 +08:00
f7adb6507e [Fix](storage engine) shutdown cooldown and cold data compaction thread when engine stop (#21639)
when stop be gracefully, storage engine did not shut down cooldown and cold data compaction thread correctly.
2023-07-08 22:22:15 +08:00
f8a2c66174 [refactor](planner) refactor automatically set instance_num (#21640)
refactor automatically set instance_num
2023-07-08 21:59:17 +08:00
aad8043d44 [opt](Nereids) enable parallel scan for local phase agg (#21642)
after we forbid some cases off agg candidate plans,
all local phase agg require DistributionSpecAny for child.
So, we could enable parallel scan for it
2023-07-08 21:47:17 +08:00
7caab87bbe [FIX](serde) fix map/struct/array support arrow #21628
support map/struct support arrow format
fix string arrow format
fix largeInt 128 for arrow builder
2023-07-08 15:51:14 +08:00
2678afd2db [fix][improvement](fs) add HdfsIO profile and modification time (#21638)
Refactor the interface of create_file_reader

the file_size and mtime are merged into FileDescription, not in FileReaderOptions anymore.
Now the file handle cache can get correct file's modification time from FileDescription.
Add HdfsIO for hdfs file reader
pick from [Enhancement](multi-catalog) Add hdfs read statistics profile. #21442
2023-07-08 14:49:44 +08:00
51b0bbb667 [Feature] (binlog) Add getBinlogLag (#21637)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
2023-07-08 07:41:45 +08:00
499592178e [fix](Nereids) Add alias name for system variable (#21615)
Add alias name for system variable to fix the col name is the values of system variable like:
```
mysql> select @@character_set_client;
+--------+
| 'utf8' |
+--------+
| utf8   |
+--------+
==================================
mysql> select @@character_set_client;
+------------------------+
| @@character_set_client |
+------------------------+
| utf8                   |
+------------------------+
```
2023-07-07 23:26:01 +08:00
d39bca5ec7 [fix](nereids) don't build cte producer if the consumer is empty relation (#21317)
explain WITH cte_0 AS ( SELECT 1 AS a ) SELECT * from cte_0 t1 join cte_0 t2 on true WHERE false;
before:
```
+----------------------------+
| Explain String             |
+----------------------------+
| PLAN FRAGMENT 0            |
|   OUTPUT EXPRS:            |
|     a[#1]                  |
|     a[#2]                  |
|   PARTITION: UNPARTITIONED |
|                            |
|   VRESULT SINK             |
|                            |
|   1:VEMPTYSET              |
|                            |
| PLAN FRAGMENT 1            |
|   OUTPUT EXPRS:            |
|     a[#0]                  |
|   PARTITION: UNPARTITIONED |
|                            |
|   MultiCastDataSinks       |
|                            |
|   0:VUNION                 |
|      constant exprs:       |
|          1                 |
+----------------------------+
```
after:

```
+----------------------------+
| Explain String             |
+----------------------------+
| PLAN FRAGMENT 0            |
|   OUTPUT EXPRS:            |
|     a[#0]                  |
|     a[#1]                  |
|   PARTITION: UNPARTITIONED |
|                            |
|   VRESULT SINK             |
|                            |
|   0:VEMPTYSET              |
+----------------------------+
```
2023-07-07 18:12:28 +08:00
cad9e8849c [minor](stats) ADD LOG in analyze task (#21362) 2023-07-07 18:04:15 +08:00
2d445bbb6d [opt](Nereids) forbid some bad case on agg plans (#21565)
1. forbid all candidates that need to gather process except must do it
2. forbid do local agg after reshuffle of two phase agg of distinct
3. forbid one phase agg after reshuffle
4. forbid three or four phase agg for distinct if any stage need reshuffle
5. forbid multi distinct for one distinct agg if do not need reshuffle
2023-07-07 17:45:55 +08:00
b471cf2045 Revert "[Enhancement](multi-catalog) Add hdfs read statistics profile. (#21442)" (#21618)
This reverts commit 57729bad6841ea9728e6b2cf0bd484133e7b9ead.
To fix compile error
2023-07-07 17:45:31 +08:00
6b1a74af61 [Enhancement](planner&Nereids) support sql_select_limit for master (#21138)
support sql_select_limit for original planner and Nereids.
if enable the variable
In original planner, add limit to the top planNode
In Nereids, add limit node to the top in preprocess phase.
2023-07-07 17:18:38 +08:00
dc44345ee4 [Fix](Planner) change non boolean return type to boolean (#20599)
Problem: When using no boolean type as return type in where or having clause, the analyzer will check the return type and throw an error. But in some other databases, this usage is enable.

Solved: Cast return type to boolean in where clause and having clause. select *** from *** where case when *** then 1 else 0 end;
2023-07-07 17:12:41 +08:00
0b7b5dc991 [fix](catalog) wrong required slot info causing BE crash (#21598)
For file scan node, this is a special field `requiredSlot`, this field is set depends on the `isMaterialized` info of slot.
But `isMaterialized` info can be changed during the plan process, so we must update the `requiredSlot`
in `finalize` phase of scan node, otherwise, it may causing BE crash due to mismatching slot info.
2023-07-07 17:10:50 +08:00
02149ff329 [fix](nereids) Agg on unknown-stats column (#21428) 2023-07-07 17:03:04 +08:00
67afea73b1 [enhancement](merge-on-write) add more version and txn information for mow publish (#21257) 2023-07-07 16:18:47 +08:00
29dd0158cf Delete alter system modify broker related documents (#21578) 2023-07-07 15:34:59 +08:00
871002c882 [fix](kerberos) should renew the kerberos ticket each half of ticket lifetime (#21546)
Follow #21265, the renew interval of kerberos ticket should be half of config::kerberos_expiration_time_seconds
2023-07-07 14:52:36 +08:00
57729bad68 [Enhancement](multi-catalog) Add hdfs read statistics profile. (#21442)
Add hdfs read statistics profile.
```
  -  HdfsIO:  0ns
    -  TotalBytesRead:  133.47  MB
    -  TotalLocalBytesRead:  133.47  MB
    -  TotalShortCircuitBytesRead:  133.47  MB
    -  TotalZeroCopyBytesRead:  0.00  
```
2023-07-07 14:52:14 +08:00
f908ea5573 [fix](Nereids) union distinct should not prune any column (#21610) 2023-07-07 14:38:28 +08:00