Commit Graph

1379 Commits

Author SHA1 Message Date
079b764136 [Bug] Fix thread safe problem when check whether olap table is stable (#5478) 2021-03-10 19:12:00 +08:00
7aad412539 [MINOR] Remove offensive words (#5495) 2021-03-10 18:36:02 +08:00
b4c8e9de7f [Bug] Fix create view faild when StringLiteral in SelectStmt contains single quotes (#5484)
* [Bug] Fix create view faild when StringLiteral in SelectStmt contains single quotes

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-03-10 14:47:02 +08:00
bd53f407aa [Bucket Shuffle Join] Support the some featrue of Bucket Shuffle Join (#5459)
1.Support Bucket Shuffle Join when left table is colocate table or Colocate/Bucket Bucket Shuffle Join
2.Enable Local Rumtime Filter when there is Bucket Shuffle Join and Colocate Join
3.Add Doc for Bucket Shuffle Join
2021-03-09 14:47:59 +08:00
e023ef5404 [Load] Support multi bytes LineDelimiter and ColumnSeparator (#5462)
* [Internal][Support Multibytes Separator] doris-1079
support multi bytes LineDelimiter and ColumnSeparator
2021-03-09 09:35:39 +08:00
a1160bcd99 [Bug] Fix bug that data lost when doing backup job (#5473)
Backup job may delete the tablet of existing table, which cause data lost.
2021-03-08 09:32:16 +08:00
ae364dea3d [BUG] fix DECHECK Fail While Call UDF (#5457) 2021-03-06 16:13:30 +08:00
c95f00d508 [Bug] Fix bug that the image cannot be pulled after the new fe nodes added (#5418)
* [Bug] Fix bug that the image cannot be pulled after the new fe node is added

This is because httpv2 modified the response body of the "/info" api,
causing FE to fail to obtain info from this api.
And the system did not exit correctly.

This will also cause issues in issue #5292
2021-03-05 10:50:54 +08:00
c9ddd88e14 [Rewrite]Rewrite from_unixtime to reduce calling this function (#5444)
from_unxitime is a cpu-exhausted function.
SQL: select filed from table where from_unixtime(field) > '2021-03-02',
if there are one million rows of data. Function from_unixtime will be called one million times,
which will make query very slow.

In issue #5443, we try to rewrite from_unixtime into timestamp to reduce calling this function.
This rewriting can bring 2 times query performance improvement.
2021-03-04 22:31:28 +08:00
77485521d3 [Enhancement] move FeMetaVersion.java from fe-common to fe-core #5426 (#5427)
Currently, FeMetaVersion.java is in fe-common, users may forget to copy fe-common.jar when upgrading the service.
It's really dangerous because the data may be corrupted and can not be recovered.
2021-03-04 22:25:03 +08:00
8c34013cf6 [Enhance] Remove order by from insert into select (#5419)
remove unnecessary order by of insert into select stmt
2021-03-04 22:23:16 +08:00
bfce98f4b9 [Bug] The toString() method in PartitionInfo class. Property information strings are concatenated together (#5407) 2021-03-04 22:22:37 +08:00
5a6be411da [Ut] Add drop meta unit test and remove some redundant code in Alter (#5395)
* [Ut] Add drop meta unit test and remove some redundant code in Alter

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-03-04 21:53:31 +08:00
7a41629fbe [Audit] Support builtin load audit function to record successful bulk load job (#5183)
* [Audit] Support builtin load audit function to record successful bulk load job

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-03-03 17:01:02 +08:00
e5cc6de294 [SQL Planner] Column Pruning under count start (#5410)
When there is count(*) function in query, we only need to scan the smallest column.
For example:
Query: select count(*) from (select k1, k2, k3 from base) tmp;
Only k1 which is the smallest column should be scanned.
The remaining columns (k2, k3) should be pruning.

This pr achieves this optimization of column pruning.
Fixed #5409
2021-02-25 09:52:36 +08:00
5781d67afe Fix file licences (#5414)
Add license to files
For Doris 0.14
2021-02-24 16:37:17 +08:00
73b89b58f3 [Bug][Cache] Version should not be considered when find the latest partition (#5408)
When a table has multiple partitions, each partition has it's own
version, the version doesn't represent whether it's newer or not. When a
partition has a large version, it may be considered as the largest one
currently, this will cause incorrect query result.
Suppose there are 2 partitions:
PartitionName | VisibleVersion |  VisibleVersionTime
p1            |            123 | 2021-02-17 23:31:32
p2            |             23 | 2021-02-22 11:39:19
Partition p1 will be considered as the lastest partition, and there is a
cache before p2's last update time, the cache will hit and return an
error result.
2021-02-24 11:23:19 +08:00
13c7b18592 add check when set lowerBoundInclusive in operator < and <= (#5382)
Change-Id: I54c702900d68da21e3fa16e74d55d16c7365e195

Co-authored-by: qijianliang01 <qijianliang01@baidu.com>
2021-02-23 11:14:29 +08:00
bc10d44522 升级jackson版本号 (#5373)
Co-authored-by: jiangyan <jiangyan@sfmail.sf-express.com>
2021-02-23 10:43:25 +08:00
6ede4c6ec1 [Feature] Support backup,restore,load,export directly connect to s3 (#5399)
* [doris-1008] support backup and restore directly to cloud storage via aws s3 protocol

* Internal][S3DirectAccess] Support backup,restore,load,export directlyconnect to s3
1. Support load and export data from/to s3 directly.
2. Add a config to auto convert broker access to s3 acces when available

Change-Id: Iac96d4b3670776708bc96a119ff491db8cb4cde7

(cherry picked from commit 2f03832ca52221cc7436069b96c45c48c4bc7201)

* [Internal][S3DirectAccess] File path glob compatible with broker

Change-Id: Ie55e07a547aa22c6fa8d432ca926216c10384e68
(cherry picked from commit d4fb25544c0dc06d23e1ada571ec3f8edd4ba56f)

* [internal] [doris-1008] fix log4j class not found

Change-Id: I468176aca0d821383c74ee658d461aba9e7d5be3
(cherry picked from commit 029adaa9d6ded8503acbd6644c1519456f3db232)

* add poms

Co-authored-by: yangzhengguo01 <yangzhengguo01@baidu.com>
2021-02-22 16:07:56 +08:00
aa4f46c349 [Enhancement]Use add method instead of put method to avoid query being stuck when event queue is full (#5310)
Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-02-18 10:36:55 +08:00
a7d16acaac [MySQL] Support for AuthSwitchRequest In HandShakePacket to better support MySQL 8.0 clients (#5386)
issue:5348
2021-02-16 22:47:53 +08:00
99e1a97822 [Bug] Fix NPE when replaying modify table property (#5378) 2021-02-16 22:34:48 +08:00
204fa45a48 [FE][Bug] Fix overflow in RuntimeProfile.sortChildren. (#5377)
If the difference between the two times exceeds Integer.MAX_VALUE,
the compare's return value will overflow and the flow exception may be triggered when sorting profile.
2021-02-16 22:34:27 +08:00
bd72328177 [UT] Fix FE ut bugs (#5387)
This bug is introduced from #5356
2021-02-14 15:59:21 +08:00
51ccd44865 [Load Parallel][3/3] Support parallel delta writer (#5369)
In the previous broker load, multiple OlapTableSinks would send data to the same LoadChannel,
and because of the lock granularity problem, LoadChannel could only process these requests serially,
which made it impossible to make full use of cluster resources.

This CL modifies the related locks so that LoadChannel can process these requests in parallel.

In the test, with a size of 20G, the load speed of 334 million rows of data in 3 nodes has been
increased from 9min to 5min, and after enabling 2 concurrency, it can be increased to 3min.

Also modify the profile of load job.
2021-02-07 22:42:18 +08:00
f12f32da11 [Bug] Support if not exists in create table like stmt (#5368)
Currently we support syntax `create table xx if not exists like xxx`, but `if not exists` does not work well.
2021-02-07 22:41:55 +08:00
2ec55bf19e [LOG] Change some log level (#5361)
Change some log level from error to warn
2021-02-07 22:41:13 +08:00
f77b8ce8e4 [UT] Modify to avoid some UT failure accidentally (#5359)
After an Alter job finished, the job's state is FINISHED, but table's state
may not be NORMAL for a while.
We need to make sure that table's state become NORMAL to continue next UT.
2021-02-07 22:39:45 +08:00
fd81499fbc [Bug] Add space in case and caseExpr when toSql (#5356) 2021-02-07 22:38:54 +08:00
780900ac9c [Feature] Support preceding filter original data when loading (#5338)
Support conditional filtering of original data in broker load and routine load
eg:

```
LOAD LABEL `label1`
(
DATA INFILE ('bos://cmy-repo/1.csv')
INTO TABLE tbl2
COLUMNS TERMINATED BY '\t'
(event_day, product_id, ocpc_stage, user_id)
SET (
	ocpc_stage = ocpc_stage + 100
)
PRECEDING FILTER user_id = 1381035
WHERE ocpc_stage > 30
)
...
```
2021-02-07 22:37:48 +08:00
c283bb3677 [Bug] Fix bug that not erase meta such as tablet when force drop db, table, partition (#5329) 2021-02-07 22:37:18 +08:00
f98b26645c [Bug] Set forceDrop to false when getDropPartitionClause for DynamicPartitionScheduler to avoid that the deleted partition cannot be recovered (#5319)
Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-02-07 22:36:54 +08:00
779c4629b4 [Bug] Fix bug of NPE when replaying spark load job. (#5367)
* [Bug] Fix bug of NPE when replaying spark load job.

The resourceDesc in spark load job may be null because it is not persisted.
So when replaying the job, we should check it.

* fix

* add ut
2021-02-07 11:25:06 +08:00
4ce6f49c0f [LOG] Reduce verbose exception log by catch exceptions (#5229)
In our product environment, we use LVS to dispatch requests to FEs,
however, LVS will send probes to check whether FE is alive, and will
close the connection immediately. It will cause much verbose log,
this patch aim to reduce these log by catch related exceptions.
2021-02-06 23:14:26 +08:00
2a2cec91f9 Adding a column with SUM aggregation to table should restrict the default value (#5315)
One Tablet have three replicas, the compaction progress is different.
Considering the following scenario, replica A have 3 versions(1, 2, 3);
replica B have 2 versions(1-2, 3);
replica C have 1 versions(1-3).
Now a column named city been added with default zero 1.
Replica A will be resulted as 3, replica B results as 2,
replica C results as 1.

So there is a necessity to restrict the default value to zero for SUM aggregation column.
2021-02-05 18:50:04 +08:00
d8202ca9cc [Enhancement] move common codes from fe-core to fe-common and remove log4j1 (#5317) (#5318)
The io related codes may be used by new modules, so It's better to move them to fe-common.

The modification to fe-core is frequent, but there are many generated java files by thrift
will slow down the compilation, so It's better to move thrift generation process to fe-common.

Currently both log4j1 and log4j2 are used, which leads to logs are written to wrong files.
Our modification will remove log4j1 from dependency, use slf4j + slf4j -> log4j2 instead.
2021-02-04 13:41:03 +08:00
b6abcbdd35 Fix 5243 Skip repair replica not in colocate group. (#5250)
* Fix 5243 Skip repair replica not in colocate group.

* Remove useless parameter& Add UT

* Update fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
2021-02-04 12:04:19 +08:00
ed9c70bdb9 [Bug] Fix bug of create ODBC table first column is float or double, issue#5350 (#5351) 2021-02-04 09:32:53 +08:00
77b756fb87 [Refactor] Remove redundant code of mini load and insert (#4966)
The content deleted by this PR includes mini load and insert in the old framework.
The task and scheduling logic of old framework has been deleted.
2021-02-03 22:19:20 +08:00
059791c6ac [Config] Change some defualt value of Doris config (#5348)
1. Default enable bucket shuffle join in session variables.
2. Remove config of FE enable_odbc_table.
2021-02-03 13:22:38 +08:00
47e33c7987 Support create index on unique value column (#5305)
* support create index on unique table value columns
2021-02-03 13:22:00 +08:00
ddd85d8ae8 [ODBC] Fix Memory consumption of ODBC MySQL Driver (#5322) (#5323) 2021-02-01 00:12:49 +08:00
bb7ba00ccf [Backup]Support content, exclude and whole database in backup (#5314)
This PR support following functions:
1. Support content properties in backup stmt. It means user can backup only metadata or
meta+data which use content [METADATA_ONLY| ALL]attribute to distinguish.
2. Support exclude some tables in backup and restore stmt. This means that some
very large and unimportant tables can be excluded when the entire database is backed up.
3. Support backup and restore whole database instead of declaring each table name
in the backup and restore statement.

The backup and restore api has changed as following:
```
BACKUP SNAPSHOT [db_name].{snapshot_name}
TO 'repo_name'
[ON|EXCLUDE (
    'table_name' [partition (p1,...)]
)]
[properties (
    "content" = "metadata_only|all"
)]

RESTORE SNAPSHOT [db_name].{snapshot_name}
TO 'repo_name'
[EXCLUDE|ON (
    'table_name' [partition (p1,...)]
)]
[properties (
)]
```
2021-02-01 00:12:35 +08:00
be0b0f930c [Load] Load job should not begin transaction when task queue in loadingLoadTaskScheduler is full to avoid txn timeout (#5205) 2021-02-01 00:10:24 +08:00
cd96ded1ad [Bugs] Fix bugs that FE heartbeat api of httpv2 does not return version info (#5306)
Co-authored-by: morningman <chenmingyu@baidu.com>
2021-01-30 20:34:33 +08:00
de57667d6d [Delete] Support delete with multi partitions (#5252)
Support delete statement like:
1. delete from table partitions(p1, p2) where xxx;  // apply to p1, p2
2. delete from table where xxx;     // apply to all partitions

Also remove code about the deprecated sync/async delete job.

This CL changes FE meta version to 94
2021-01-30 20:33:34 +08:00
8fe372f82b [Bug] Fix NoSuchElementException when accessing empty partition info (#5201) 2021-01-30 16:36:24 +08:00
6bd22bc573 [BackupAndRestore] Support backup and restore view and external odbc table (#5299)
[BackupAndRestore] Support backup and restore view and external odbc table

1. Support backup and restore view and odbc table. The syntax is the same as that of the backup and restore table.
2. If the table associated with the view does not exist in the snapshot,
   the view can still be backed up successfully, but the TableNotFound exception will be thrown when querying the view.
3. If the odbc table associated with the odbc resource, the odbc resource will be backuped and restored together.
4. If the same view, odbc table and resource already exists in the database, it will compare whether the metadata of snapshot is consistent.
   If it is inconsistent, the restoration will fail.
4. This pr also modified the json format of the backup information.
   A `new_backup_objects` object is added to the root node to store backup meta-information other than olap table,
   such as views and external tables.
   ```
   {
       "backup_objects": {},
       "new_backup_objects": {
           "view": [
               {"name": "view1", "id": "10001"}
           ],
           "odbc_table": [
               {"name":"xxx", xxx}
           ]
           "odbc_resources": [
               {"name": "bj_oracle"}
           ]
       }
   }
   ```
5. This pr changes the serialization and deserialization method of backup information
   from manual construction to automatic analysis by Gson tools.

Change-Id: I216469bf2a6484177185d8354dcca2dc19f653f3
2021-01-28 18:50:18 +08:00
e774314ffb Fix some problems related to thrift rpc when use nonblokcing IO model (#5117)
* Fix some problems related to thrift rpc when use nonblokcing IO model

Co-authored-by: caiconghui [蔡聪辉] <caiconghui@xiaomi.com>
2021-01-28 10:57:30 +08:00