Commit Graph

1452 Commits

Author SHA1 Message Date
d1007afe80 Use fmt and std::from_chars to make convert integer to string and convert string to integer more efficient (#6361)
* [Optimize] optimize the speed of converting integer to string

* Use fmt and std::from_chars to make convert integer to string and convert string to integer more efficient

Co-authored-by: caiconghui <caiconghui@xiaomi.com>
2021-08-04 10:55:19 +08:00
16bc5fa585 [Bug] fix violating C/C++ aliasing rules cause a error hash value in decimal value (#6348)
In RuntimeFilter BloomFilter, decimal column will got a wrong hash value because violating  aliasing rules
decimal12_t decimal = { 12, 12 };
murmurhash3(decimal) in bloom filter: 2167721464
expect: 4203026776
2021-08-03 12:00:03 +08:00
2c208e932b [Bug][RoutineLoad] Avoid TOO_MANY_TASKS error (#6342)
Use `commitAsync` to commit offset to kafka, instead of using `commitSync`, which may block for a long time.
Also assign a group.id to routine load if user not specified "property.group.id" property, so that all consumer of
this job will use same group.id instead of a random id for each consume task.
2021-08-03 11:59:06 +08:00
cf1fcdd614 fix BE coredump in UserFunctionCache (#6331)
Co-authored-by: weizuo <weizuo@xiaomi.com>
2021-07-30 09:24:30 +08:00
6597a338dc [Feature] Support config max length of zone map index (#6293) 2021-07-30 09:23:11 +08:00
5a7237062f remove palo_internal_service.proto and PInternalService from code base, because it is not used now (#6341) 2021-07-30 09:22:50 +08:00
d416cd3e79 [Bug] Fix BE coredump when flushing memtable (#6317)
Fix #6316

If the size of memtable is greater than max segment size and the memtable will flush more than
one segment file. BE coredump will be triggered when flushing memtable.
2021-07-27 13:42:19 +08:00
1454aacd69 [Metric] Add metrics to monitor size of queued tasks in load thread pool (#6306)
(1) Add metrics to monitor the size of queued tasks in load thread pool.
(2) Change some log level to VLOG_NOTICE
2021-07-27 13:41:44 +08:00
776df2effc [BUG][stack-buffer-overflow] fix overflow while calculate hash code in ArrayType and fix some warning 2021-07-27 13:41:00 +08:00
f26e3408b2 [Profile] Support show load profile for broker load job (#6214)
1.
Add new statement:
`SHOW LOAD PROFILE "xxx";`

2.
Improve the read performance of orc scanner
2021-07-27 13:37:34 +08:00
4c0fdd2800 [Bug] Fix core dump in BloomFilter while build Runtime Filter right table string column contains null (#6305)
when right table has null value in string column, runtime filter may coredump
```
select count(*) from baseall t1 join test t2 where t1.k7 = t2.k7;
```
2021-07-26 09:41:41 +08:00
13ef2c9e1d [Function][Enhance] lower/upper case transfer function vectorized (#6253)
Currently, the function lower()/upper() can only handle one char at a time.
A vectorized function has been implemented, it makes performance 2 times faster. Here is the performance test:

The length of char: 26, test 100 times
vectorized-function-cost: 99491 ns
normal-function-cost: 134766 ns

The length of char: 260, test 100 times
vectorized-function-cost: 179341 ns
normal-function-cost: 344995 ns
2021-07-26 09:38:07 +08:00
02a00cdf35 [Bug] Fix the bug in from_date_format_str function (#6273) 2021-07-21 12:31:37 +08:00
327e31c227 [Feature] Support setting concurrency for thread pool token (#6237)
Now we can submit a group of tasks using thread pool token, and limit
the max concurrency of this task group
2021-07-21 12:30:43 +08:00
7592f52d2e [Feature][Insert] Add transaction for the operation of insert #6244 (#6245)
## Proposed changes
Add transaction for the operation of insert. It will cost less time than non-transaction(it will cost 1/1000 time) when you want to insert a amount of rows.
### Syntax

```
BEGIN [ WITH LABEL label];
INSERT INTO table_name ...
[COMMIT | ROLLBACK];
```

### Example
commit a transaction:
```
begin;
insert into Tbl values(11, 22, 33);
commit;
```
rollback a transaction:
```
begin;
insert into Tbl values(11, 22, 33);
rollback;
```
commit a transaction with label:
```
begin with label test_label;
insert into Tbl values(11, 22, 33);
commit;
```

### Description
```
begin:  begin a transaction, the next insert will execute in the transaction until commit/rollback;
commit:  commit the transaction, the data in the transaction will be inserted into the table;
rollback:  abort the transaction, nothing will be inserted into the table;
```
### The main realization principle:
```
1. begin a transaction in the session. next sql is executed in the transaction;
2. insert sql will be parser and get the database name and table name, they will be used to select a be and create a pipe to accept data;
3. all inserted values will be sent to the be and write into the pipe;
4. a thread will get the data from the pipe, then write them to disk;
5. commit will complete this transaction and make these data visible;
6. rollback will abort this transaction
```

### Some restrictions on the use of update syntax.
1. Only ```insert``` can be called in a transaction.
2. If something error happened, ```commit``` will not succeed, it will ```rollback``` directly;
3. By default, if part of insert in the transaction is invalid, ```commit``` will only insert the other correct data into the table.
4. If you need ```commit``` return failed when any insert in the transaction is invalid, you need execute ```set enable_insert_strict = true``` before ```begin```.
2021-07-21 10:54:11 +08:00
2d78c31d49 [Enhance] improve performance of init_scan_key by sharing the schema (#6099)
Co-authored-by: huangmengbin <huangmengbin@bytedance.com>
2021-07-21 10:50:31 +08:00
a1a37c8cba [Feature] Support calc constant expr by BE (#6233)
At present, some constant expression calculations are implemented on the FE side,
but they are incomplete, and some expressions cannot be completely consistent with
the value calculated by BE (such as part of the time function)

Therefore, we provide a way to pass all the constants in SQL to BE for calculation,
and then begin to analyze and plan SQL. This method can also solve the problem that some
complex constant calculations issued by BI cannot be processed on the FE side.

Here through a session variable enable_fold_constant_by_be to control this function,
which is disabled by default.
2021-07-19 10:25:53 +08:00
b53ff15ef2 [Config] set spark load and odbc table feature enable by default (#6212)
1. Also use BufferedReader to speed up orc reader
2021-07-18 22:15:13 +08:00
fae3eff2e6 [Bug] Fix the bug of cast string to datetime return not null (#6228) 2021-07-17 10:55:08 +08:00
8de09cbd21 [Bug-fix] Decimal Divide, Mod Zero Result Should be NULL. (#6051) 2021-07-17 10:43:06 +08:00
bf5db6eefe [BUG][Timeout][QueryLeak] Fixed memory not released in time (#6221)
* Revert "[Optimize] Put _Tuple_ptrs into mempool when RowBatch is initialized (#6036)"

This reverts commit f254870aeb18752a786586ef5d7ccf952b97f895.

* [BUG][Timeout][QueryLeak] Fixed memory not released in time, Fix Core dump in bloomfilter
2021-07-16 12:32:10 +08:00
c2695e9716 [Bug][RoutineLoad] Can not match whole json in routine load (#6213)
Support using json path "$" to match the whole json in routine load

Co-authored-by: chenmingyu <chenmingyu@baidu.com>
2021-07-16 09:21:27 +08:00
19cd42ccbd [BUG] avoid std::function copy in client cache (#6186)
* [BUG] avoid std::function copy in client cache

* Refactor ClientFactory Name
2021-07-16 09:20:28 +08:00
409cee0fdb [Bug][RoutineLoad] Fix bug that routine load thread on BE may be blocked (#6215)
* [Bug][RoutineLoad] Fix bug that routine load thread on BE may be blocked

This bug will cause the routine load job throw TOO MANY TASK error, and routine
load job is blocked.

* fix ut

Co-authored-by: chenmingyu <chenmingyu@baidu.com>
2021-07-15 11:21:01 +08:00
68f988b78a [Optimize] Use flat_hash_set to replace unorderd_set in InPredicate (#6216)
Co-authored-by: chenmingyu <chenmingyu@baidu.com>
2021-07-15 11:15:11 +08:00
7e77b5ed7f [Optimize] Using custom conf dir to save log config of Spring (#6205)
The log4j-config.xml will be generated at startup of FE and also when modifying FE config.
But in some deploy environment such as k8s, the conf dir is not writable.

So change the dir of log4j-config.xml to Config.custom_conf_dir.

Also fix some small bugs:

1. Typo "less then" -> "less than"
2. Duplicated `exec_mem_limit` showed in SHOW ROUTINE LOAD
3. Allow MAXVALUE in single partition column table.
4. Add IP info for "intolerate index channel failure" msg.

Change-Id: Ib4e1182084219c41eae44d3a28110c0315fdbd7d

Co-authored-by: chenmingyu <chenmingyu@baidu.com>
2021-07-15 11:13:51 +08:00
ed3ff470ce [ARRAY] Support array type load and select not include access by index (#5980)
This is part of the array type support and has not been fully completed. 
The following functions are implemented
1. fe array type support and implementation of array function, support array syntax analysis and planning
2. Support import array type data through insert into
3. Support select array type data
4. Only the array type is supported on the value lie of the duplicate table

this pr merge some code from #4655 #4650 #4644 #4643 #4623 #2979
2021-07-13 14:02:39 +08:00
d79cdc829f [Bug] Filter out unavaliable backends when getting tablet location (#6204)
* [Bug] Filter out unavaiable backends when getting scan range location

In the previous implementation, we will eliminate non-surviving BEs in the Coordinator phase.
But for Spark or Flink Connector, there is no such logic, so when a BE node is down,
it will cause the problem of querying errors through the Connector.

* fix ut

* fix compiule
2021-07-13 11:17:49 +08:00
dbfe8e4753 [enhancement] Optimize load CSV file memory allocate (#6174)
Optimize load CSV file memory allocate, avoid frequent allocation,
may reduce the load time by 40%-50% when large column numbers
2021-07-12 09:58:45 +08:00
290a844e04 [optimize] Optimize bloomfilter performance (#6180)
refactor runtime filter bloomfilter and eliminate some virtual function calls which obtained a performance improvement of about 5%
import block bloom filter, for avx version obtained 40% performance improvement
before: bloomfilter size:default, about 2000W item cost about 1s400ms
after: bloomfilter size:524288, about 2000W item cost about 400ms
2021-07-10 10:12:12 +08:00
01bef4b40d [Load] Add "LOAD WITH HDFS" model, and make hdfs_reader support hdfs ha (#6161)
Support load data from HDFS by using `LOAD WITH HDFS` syntax and read data directly via libhdfs3
2021-07-10 10:11:52 +08:00
Pxl
3812cca4db [Bug]fix the calculation of the "_start_trash_sweep" run interval. (#6177)
* fix the calculation of the _start_trash_sweep run interval
2021-07-09 09:45:44 +08:00
Pxl
0c6726f7cd [Bug] Fix bug of TDisk have wrong static_cast (#6175)
* remove some useless static_cast
2021-07-09 09:42:08 +08:00
8a785ab08b [BUG][Leak] fix new-delete-type-mismatch in StorageBackend (#6157) 2021-07-08 09:55:22 +08:00
c929a8935a [Feature][Function] support bit_length function (#6140)
support bit_length function like mysql
2021-07-08 09:40:30 +08:00
198ba78595 [Feature] Add update time to show table status (#6117)
Add update time to show table status

```
MySQL [test_query_qa]> show table status;
+----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------+----------+----------------+---------+
| Name     | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time         | Check_time          | Collation | Checksum | Create_options | Comment |
+----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------+----------+----------------+---------+
| bigtable | Doris  |    NULL | NULL       | NULL |           NULL |        NULL |            NULL |         NULL |      NULL |           NULL | 2021-06-29 17:09:28 | 2021-06-29 17:17:28 | 1970-01-01 07:59:59 | utf-8     |     NULL | NULL           | OLAP    |
| test     | Doris  |    NULL | NULL       | NULL |           NULL |        NULL |            NULL |         NULL |      NULL |           NULL | 2021-06-29 17:09:26 | 2021-06-29 17:17:28 | 1970-01-01 07:59:59 | utf-8     |     NULL | NULL           | OLAP    |
| baseall  | Doris  |    NULL | NULL       | NULL |           NULL |        NULL |            NULL |         NULL |      NULL |           NULL | 2021-06-29 17:09:26 | 2021-06-29 17:17:26 | 1970-01-01 07:59:59 | utf-8     |     NULL | NULL           | OLAP    |
+----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+---------------------+-----------+----------+----------------+---------+
3 rows in set (0.002 sec)
```
2021-07-07 10:27:14 +08:00
739c0268ff [refactor] Remove decimal v1 related code from code base (#6079)
remove ALL DECIMAL V1 type code , this is a part of #6073
2021-07-07 10:26:32 +08:00
149def9e42 [Feature] Support RuntimeFilter in Doris (BE Implement) (#6077)
1. support in/bloomfilter/minmax
2. support broadcast/shuffle/bucket shuffle/colocate join
3. opt memory use and cpu cache miss while build runtime filter
4. opt memory use in left semi join (works well on tpcds-95)
2021-07-04 20:59:05 +08:00
4a5f0f859d [Bug] Add readlock when calling get_rowset_by_version() (#6120) 2021-07-01 09:19:10 +08:00
6441a4c0ca [Metrics] Add metrics for load average. (#6069)
Added load average metrics to be for monitoring system load.
See iseue #6068 for a detailed explanation.
2021-06-30 09:28:45 +08:00
f254870aeb [Optimize] Put _Tuple_ptrs into mempool when RowBatch is initialized (#6036) 2021-06-30 09:27:53 +08:00
fe65a623c1 Fix timeout error when delete condition contains invalid datetime format (#6030)
* add date time format check in delete statment
2021-06-29 09:47:42 +08:00
dd455af844 fix stdfs link error in some gcc version (#6090) 2021-06-26 14:09:00 +08:00
6651d3bf2a SIMD instruction speed up the storage layer (#6089)
* SIMD instruction speed up the storage layer

* 1. add DECHECK in power of 2 int32
2. change vector to array deduce the cost
2021-06-25 11:04:32 +08:00
45ec084a6d fix (#6081) 2021-06-24 09:44:24 +08:00
c8899ee5bd [Build][ARM] Fix some compilation problems on ARM64 (#6076)
1. Disable libhdfs3 on ARM, because it doesn't support ARM now.
2. Add compilation doc for ARM64
2021-06-23 09:38:16 +08:00
68bab73c35 [Bug] Fix select random storage path maybe same at a long time (#6062)
random_shuflle will generate same random sequence when call multiple times,
although we use twice random, but when there is no change in the size relationship
between the adjacent numbers, the result of the second shuffle will not change either
2021-06-20 16:16:32 +08:00
5dabf0bef5 [Alter] validate data file after alter operation success (#6022)
Co-authored-by: wangxixu <wangxixu@xiaomi.com>
2021-06-20 16:15:14 +08:00
1999a0c26b [optimization] open gcc strict-aliasing optimization (#6034)
* open gcc strict-aliasing optimization

* use -Werror=strick-alias
2021-06-18 11:39:24 +08:00
5cfe081b05 [Bug] Remove duplicate memtracker (#6041)
* [Enhanece] Remove duplicate memtracker

This problem will cause frequent creation of memtracker and affect query concurrency.
2021-06-18 11:28:37 +08:00