Commit Graph

3786 Commits

Author SHA1 Message Date
f93ac89a67 [fix](lateral-view) fix bugs of lateral view with CTE or where clause (#7865)
fix bugs of lateral view with CTE or where clause.
The error case can be found in newly added tests in `TableFunctionPlanTest.java`
But there are still some bugs not being fixed, so the unit test is annotated with @Ignore

This PR contains the change is #7824 :

> Issue Number: close #7823
> 
> After the subquery is rewritten, the rewritten stmt needs to be reset
> (that is, the content of the first analyze semantic analysis is cleared),
> and then the rewritten stmt can be reAnalyzed.
> 
> The lateral view ref in the previous implementation forgot to implement the reset function.
> This caused him to keep the first error message in the second analyze.
> Eventually, two duplicate tupleIds appear in the new stmt and are marked with different tuple.
> From the explain string, the following syntax will have an additional wrong join predicate.
> ```
> Query: explain select k1 from test_explode lateral view explode_split(k2, ",") tmp as e1  where k1 in (select k3 from tbl1);
> Error equal join conjunct: `k3` = `k3`
> ```
> 
> This pr mainly adds the reset function of the lateral view
> to avoid possible errors in the second analyze
> when the lateral view and subquery rewrite occur at the same time.
2022-01-28 22:24:23 +08:00
22830ea498 [feature](show) add new statement show proc '/current_query_stmts' (#7487)
To show the the query statement at first level.
2022-01-28 22:23:13 +08:00
1ba20b1dbb [improvement](storage) improving Column inserter (#7855)
* optimize Column inserter

* DCHECK

* DCHECK

Co-authored-by: zuochunwei <zuochunwei@meituan.com>
2022-01-27 14:18:15 +08:00
dee79d98a8 [improvement](explain) Displays cast information with implicit conversions in verbose (#7851)
Displays cast information with implicit conversions in verbose.
2022-01-27 10:37:38 +08:00
0d3fe8f07b [typo](docs) fix document backup-restore.md typo (#7868)
Refactor the document format and improve the content of the English version
2022-01-27 10:34:34 +08:00
ea96242529 [chore] add set -e to download_thirdparty.sh (#7867)
Let the build process stop immediately if some command execute failed.
For example, patch failed due to command not found, otherwise it will stop until compile error.
2022-01-27 10:33:08 +08:00
d2386dd85d [improvement](rewrite) Make RewriteDateLiteralRule to be compatible with mysql (#7876) 2022-01-27 10:32:18 +08:00
d69b7bff2e [feature](meta) Support show compactionTooSlowTablets and oversizeTablets (#7821)
Add more columns in `show proc "/statistic"`
2022-01-27 10:26:41 +08:00
3b8d48f08b [feature-wip](iceberg) Step1: Support create Iceberg external table (#7391)
Close related #7389

Support create Iceberg external table in Doris. 

This is the first step to support Iceberg external table.

### Create Iceberg external table
This pr describes two ways to create Iceberg external tables. Both ways do not require explicitly specifying column definitions, Doris automatically converts them based on Iceberg's column definitions.

1. Create an Iceberg external table directly

```sql
    CREATE [EXTERNAL] TABLE table_name 
    ENGINE = ICEBERG
    [COMMENT "comment"]
    PROPERTIES (
    "iceberg.database" = "iceberg_db_name",
    "iceberg.table" = "icberg_table_name",
    "iceberg.hive.metastore.uris"  =  "thrift://192.168.0.1:9083",
    "iceberg.catalog.type"  =  "HIVE_CATALOG"
    );
```

2. Create an Iceberg database and automatically create all the tables under that db.

```sql
    CREATE DATABASE db_name 
    [COMMENT "comment"]
    PROPERTIES (
    "iceberg.database" = "iceberg_db_name",
    "iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083",
    "iceberg.catalog.type" = "HIVE_CATALOG"
    );
```

### Show table creation

1. For individual tables you can view them with `help show create table`.

```sql 
mysql> show create table iceberg_db.logs_1;
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table  | Create Table                                                                                                                                                                                                                                                                                                                                                 |
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logs_1 | CREATE TABLE `logs_1` (
  `level` varchar(-1) NOT NULL COMMENT "null",
  `event_time` datetime NOT NULL COMMENT "null",
  `message` varchar(-1) NOT NULL COMMENT "null"
) ENGINE=ICEBERG
COMMENT "ICEBERG"
PROPERTIES (
"iceberg.database" = "doris",
"iceberg.table" = "logs_1",
"iceberg.hive.metastore.uris"  =  "thrift://10.10.10.10:9087",
"iceberg.catalog.type"  =  "HIVE_CATALOG"
) |
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

2. For Iceberg database, you can view it with `help show table creation`.

```sql
mysql> show table creation from iceberg_db;
+--------+---------+---------------------+---------------------------------------------------------+
| Table  | Status  | Create Time         | Error Msg                                               |
+--------+---------+---------------------+---------------------------------------------------------+
| logs   | fail    | 2021-12-14 13:50:10 | Cannot convert unknown type to Doris type: list<string> |
| logs_1 | success | 2021-12-14 13:50:10 |                                                         |
+--------+---------+---------------------+---------------------------------------------------------+
2 rows in set (0.00 sec)
```

  This is a new syntax.
  
  Show table creation records in Iceberg database:
  
  Syntax:
  ```sql
      SHOW TABLE CREATION [FROM db] [LIKE mask]
  ```
2022-01-27 10:22:47 +08:00
df76a5b34c refactor SegmentIterator (#7852)
Co-authored-by: zuochunwei <zuochunwei@meituan.com>
2022-01-26 16:44:02 +08:00
ec5ecd1604 handle conflict (#7836)
Co-authored-by: zuochunwei <zuochunwei@meituan.com>
2022-01-26 16:33:37 +08:00
015371ac72 [fix](grouping-set) Fix the bug of grouping set core in both vec and non vec query engine (#7800) 2022-01-26 16:15:30 +08:00
38660d5095 [docs]correct SeaTunnel website hyperlink and PPMC into the Member List (#7886)
* [docs]correct SeaTunnel website hyperlink
* [docs]Add the new PPMC into the Member List

* Update members.md
2022-01-26 15:24:52 +08:00
f227472db2 [chore] fix error while compiling with -O3 (#7890) 2022-01-26 12:53:56 +08:00
Pxl
cd73a6b84b [chore] fix clang compile error (#7883) 2022-01-26 12:53:35 +08:00
e3bc232578 [docs] OS Installation Requirements (#7830) 2022-01-26 09:11:41 +08:00
4bdeef3b64 [chore][fix][doc](fe-plugin)(mysqldump) fix build auditlog plugin error (#7804)
1. fix problems when build fe_plugins
2. format
3. add docs about dump data using mysql dump
2022-01-26 09:11:23 +08:00
b435a54304 [fix] Consider backend status when more than one backends exists in same host (#7784) 2022-01-26 09:10:34 +08:00
461b352d3e [fix](function) Change digital_masking function arg type to BIGINT (#7888)
Change digital_masking function arg type to BIGINT to fix the wrong result.
2022-01-25 22:28:05 +08:00
a6831535e9 [Vectorized][Bug] fix bug of coalesce function (#7827) 2022-01-25 20:44:16 +08:00
ee0037e1af [fix](ldap) fix ldap password logic (#7862)
1. write ldap info to image;
2. optimizing LdapClient class thread safety.
2022-01-25 09:59:24 +08:00
40f993ca15 [docs][seatunnel] add seatunnel flink doris sink doc (#7844) 2022-01-24 21:13:06 +08:00
8aa9faa7cb [chore](docker) Add docker dev image with ldb-toolchain (#7838)
Add docker images `apache/incubator-doris:build-env-ldb-toolchain-latest`,
which is built with ldb-toolchain
2022-01-24 21:12:15 +08:00
be9ebbc14d [fix] Fix bug that wrong exception message returned by insert statement (#7832)
`insert` statement may return exception message `Execute timeout` after load data failed.
But the real reason is that there exists unhealthy backend, not execute timeout.

```
MySQL [ssb]> insert into lineorder_flat select * from lineorder_flat;
ERROR 1105 (HY000): errCode = 2, detailMessage = Execute timeout
```
2022-01-24 21:11:45 +08:00
4e9bc5cb65 [doc] add documents for bitwise functions (#7790) 2022-01-24 21:08:41 +08:00
86f34323a8 [Doc]Doris compile and install JDK version incompatibility problem (#7797)
* Doris compile and install JDK version incompatibility problem
2022-01-24 13:57:18 +08:00
ca0fac0722 [chore](ldb-toolchain) Support ldb_toolchain on ubuntu 20 (#7846) 2022-01-24 13:16:37 +08:00
d7b40c3136 [Doc]wrong directory structure (#7842)
wrong directory structure
2022-01-23 23:22:52 +08:00
60c6bb4f92 [Feature][flink-connector] support flink delete option (#7457)
* Flink Connector supports delete option on Unique models
Co-authored-by: wudi <wud3@shuhaisc.com>
2022-01-23 20:24:41 +08:00
c2520c878c [Improvement](Vectorized) optimize SegmentIterator predication evaluate (#7795)
* [Improvement](Vectorized) optimize SegmentIterator predication evaluate

* fix bug

* move bytes32_mask_to_bits32_mask to util/simd/bits.h
2022-01-22 15:31:07 +08:00
c5ec6dbc51 [docs](install-deploy) fix misplaced whitespace(#7814) (#7816)
Misplaced whitespace causes unexpected output. Fix it so newcomers need not to
worry if they are lost by the docs.
2022-01-22 10:20:24 +08:00
d1b1723c74 [fix](export) fix export failed when table has hidden columns (#7813)
fix export failed when table has hidden columns
2022-01-22 10:19:15 +08:00
1c711705d7 [chore] Use ccache to speed recompiling test code up. (#7811) 2022-01-22 10:18:52 +08:00
cf02e43ec1 [improvement](vectorized) optimize dict read (#7805) 2022-01-22 10:18:30 +08:00
Pxl
b56c568a8d [fix](vectorized) fix fold const value fail at datetime type (#7803) 2022-01-22 10:16:38 +08:00
b14d1c54fd [fix](function) fix vec round reference #7421 (#7801)
reference #7421
2022-01-22 10:09:10 +08:00
f2cbf0a8d2 [chore] Improve the ldb toolchain compilation documentation (#7829)
Add document for compiling Doris with ldb toolchain
2022-01-21 21:36:43 +08:00
800a36343a [chore] Prolog of hermetic build with GCC 11 and Clang 13. (#7712)
Prepare to generate hermetic build using GCC 11 and Clang 13.
The ideal toolchain would be ldb toolchain generated by [ldb_toolchain_gen.sh](https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.3/ldb_toolchain_gen.sh)

To kick off a clang build, set `DORIS_TOOLCHAIN=clang` before running any build scripts.
2022-01-21 12:12:04 +08:00
0efef1b332 [fix](schema-change) Fix bug that schema change may return -102 error (#7808)
When using linked schema change, we need to check if all rowsets are of the same type,
ALPHA or BETA. otherwise, we need to use direct schema change to convert the data.
2022-01-21 10:59:54 +08:00
ed39ff1500 [feature](compaction) Support triggering compaction for a specific partition manually (#7521)
Add statement to trigger cumulative or base compaction for a specified partition.
2022-01-21 09:27:06 +08:00
4c17c370e7 [Doc]Modify the audit log plugin to record the SQL statement field type as String (#7798)
Modify the audit log plugin to record the SQL statement field type as String
2022-01-20 21:36:02 +08:00
4768dd4efa [docs] Documentation corrections (#7787) 2022-01-20 16:18:48 +08:00
ef984a6a72 [improvement](load) Improve load fault tolerance (#7674)
Currently, if we encounter a problem with a replica of a tablet during the load process,
such as a write error, rpc error, -235, etc., it will cause the entire load job to fail,
which results in a significant reduction in Doris' fault tolerance.

This PR mainly changes:

1. refined the judgment of failed replicas in the load process, so that the failure of a few replicas will not affect the normal completion of the load job.
2. fix a bug introduced from #7754 that may cause BE coredump
2022-01-20 09:23:21 +08:00
7574d39d14 [fix](bitmap-index) Fix bug that bitmap index may return wrong result. (#7788)
Fix the following bugs.

1. `column1` created a bitmap index.
2. `column1` has a lot index items in the bitmap index, and the index page is divided into two levels.
3. `column1`'s value range is `[1000, 10000000]`.
4. the query condition is `column1 > 0`
5. the empty result will be returned, while the expected value should be 9999000 rows.
2022-01-19 12:27:08 +08:00
aacbc960c8 [fix][chore](thrift) Fix warning when generate cpp code by thrift IDL file and use strict mode (#7773) 2022-01-19 12:26:44 +08:00
5fc0a9f40d [improvement](Load) Cancel the load job ASAP when encounter unqualified data (#6319)
This PR mainly changes:

1. Help to Cancel the load job ASAP when encounter unqualified data.
    Solution is described in #6318 .
    Also replace some std::stringstream with fmt::memory_buffer to avoid performance issues.

2. fix a NPE bug when create user with empty host
3. fix compile warning after rebasing the master(vectorization)
2022-01-18 13:13:55 +08:00
efb4e189df [fix](lateral-view) Fix some lateral view bugs (#7772)
1. Fix bug that BE may crash when input node of TableFunctionNode has non-null column
2. Fix bug that TableFunctionNode may not return all results
2022-01-18 12:09:32 +08:00
3494c8973b [improvement](colocation) Add a new config to delay the relocation of colocation group (#7656)
1. Add a new FE config `colocate_group_relocate_delay_second`

    The relocation of a colocation group may involve a large number of tablets moving within the cluster.
    Therefore, we should use a more conservative strategy to avoid relocation of colocation groups as much as possible.
    Relocation usually occurs after a BE node goes offline or goes down.
    This config is used to delay the determination of BE node unavailability.
    The default is 30 minutes, i.e., if a BE node recovers within 30 minutes, relocation of the colocation group
    will not be triggered.

2. Change the priority of colocate tablet repair and balance task from HIGH to NORMAL

3. Add a new FE config allow_replica_on_same_host

    If set to true, when creating table, Doris will allow to locate replicas of a tablet
    on same host. And also the tablet repair and balance will be disabled.
    This is only for local test, so that we can deploy multi BE on same host and create table
    with multi replicas.
2022-01-18 10:26:36 +08:00
946fa2960d [improvement](broker) add some properties that can be set in the broker conf file (#7499) 2022-01-18 10:24:54 +08:00
e1d7233e9c [feature](vectorization) Support Vectorized Exec Engine In Doris (#7785)
# Proposed changes

Issue Number: close #6238

    Co-authored-by: HappenLee <happenlee@hotmail.com>
    Co-authored-by: stdpain <34912776+stdpain@users.noreply.github.com>
    Co-authored-by: Zhengguo Yang <yangzhgg@gmail.com>
    Co-authored-by: wangbo <506340561@qq.com>
    Co-authored-by: emmymiao87 <522274284@qq.com>
    Co-authored-by: Pxl <952130278@qq.com>
    Co-authored-by: zhangstar333 <87313068+zhangstar333@users.noreply.github.com>
    Co-authored-by: thinker <zchw100@qq.com>
    Co-authored-by: Zeno Yang <1521564989@qq.com>
    Co-authored-by: Wang Shuo <wangshuo128@gmail.com>
    Co-authored-by: zhoubintao <35688959+zbtzbtzbt@users.noreply.github.com>
    Co-authored-by: Gabriel <gabrielleebuaa@gmail.com>
    Co-authored-by: xinghuayu007 <1450306854@qq.com>
    Co-authored-by: weizuo93 <weizuo@apache.org>
    Co-authored-by: yiguolei <guoleiyi@tencent.com>
    Co-authored-by: anneji-dev <85534151+anneji-dev@users.noreply.github.com>
    Co-authored-by: awakeljw <993007281@qq.com>
    Co-authored-by: taberylyang <95272637+taberylyang@users.noreply.github.com>
    Co-authored-by: Cui Kaifeng <48012748+azurenake@users.noreply.github.com>


## Problem Summary:

### 1. Some code from clickhouse

**ClickHouse is an excellent implementation of the vectorized execution engine database,
so here we have referenced and learned a lot from its excellent implementation in terms of
data structure and function implementation.
We are based on ClickHouse v19.16.2.2 and would like to thank the ClickHouse community and developers.**

The following comment has been added to the code from Clickhouse, eg:
// This file is copied from
// https://github.com/ClickHouse/ClickHouse/blob/master/src/Interpreters/AggregationCommon.h
// and modified by Doris

### 2. Support exec node and query:
* vaggregation_node
* vanalytic_eval_node
* vassert_num_rows_node
* vblocking_join_node
* vcross_join_node
* vempty_set_node
* ves_http_scan_node
* vexcept_node
* vexchange_node
* vintersect_node
* vmysql_scan_node
* vodbc_scan_node
* volap_scan_node
* vrepeat_node
* vschema_scan_node
* vselect_node
* vset_operation_node
* vsort_node
* vunion_node
* vhash_join_node

You can run exec engine of SSB/TPCH and 70% TPCDS stand query test set.

### 3. Data Model

Vec Exec Engine Support **Dup/Agg/Unq** table, Support Block Reader Vectorized.
Segment Vec is working in process.

### 4. How to use

1. Set the environment variable `set enable_vectorized_engine = true; `(required)
2. Set the environment variable `set batch_size = 4096; ` (recommended)

### 5. Some diff from origin exec engine

https://github.com/doris-vectorized/doris-vectorized/issues/294

## Checklist(Required)

1. Does it affect the original behavior: (No)
2. Has unit tests been added: (Yes)
3. Has document been added or modified: (No)
4. Does it need to update dependencies: (No)
5. Are there any changes that cannot be rolled back: (Yes)
2022-01-18 10:07:15 +08:00