Commit Graph

2175 Commits

Author SHA1 Message Date
6fab1cbf3c [feature-wip](array-type) Add array functions size and cardinality (#9921)
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
2022-06-09 15:03:03 +08:00
050cbba6e5 [fix][hudi] use lowerCase to get hudi fileFormatType (#9873)
use lowerCase of inputFormatName to get hudi fileFormatType
2022-06-09 12:13:02 +08:00
449bfe10d1 fix: fix a thread safe problem in LoadAction.java (#9955) 2022-06-09 00:34:07 +08:00
342ab52270 [fix] Fix type description in PrimitiveType (#9985) 2022-06-09 00:30:32 +08:00
99fb830023 [feature] datetime column type support auto-initialized with default … (#9972) 2022-06-09 00:28:03 +08:00
5f56e17ef2 [feature-wip](multi-catalog)(step2) Introduce Internal Data Source (#9953) 2022-06-08 22:02:22 +08:00
d9bbf67b9e [DefaultConfigChange]enable query vectorization and storage vectorization and storage low cardinality optimization by default (#9848)
Co-authored-by: yiguolei <yiguolei@gmail.com>
2022-06-08 15:29:43 +08:00
2ed523440f [fix](planner) passthrough child in SetOperationNode is wrong when enable vector engine (#9991)
In SetOperationNode we do passthrough, if we child output is same with itself output.
In method isChildPassthrough we only consider memory layout.
When we use vectorized engine, we need to use SlotDesc offset in TupleDesc instead of
memory layout to check whether pass-through can be performed
2022-06-08 14:12:04 +08:00
dcdfc5b32a [fix](coordinator) fix bug that unable to generate query profile (#10002)
This bug was introduced from #9720
2022-06-08 10:59:15 +08:00
e97d835ba7 [feature](statistics) Statistics derivation.Step 2:OtherNode implemen… (#9458)
closed #9644

Second step of statistics derivation: implementation of nodes other than scan_node.
The statistical information derivation interface of all nodes is uniformly placed in DeriveFactory.java.
Added one-sided to verify the derivation is correct.

Statistics derivation for each node is placed in its own *StatsDerive.java
detailed design: https://docs.google.com/document/d/1u1L6XhyzKShoyYRwFQ6kE1rnvY2iFwauwg289au5Qq0/edit
2022-06-07 21:10:28 +08:00
0fa1615147 [fix](fe-ut) Fix FE ut when enable vectorized engine (#9958)
Some node name in query explain result will be changes.
eg:
Aggregate -> VAggregate
2022-06-07 09:13:47 +08:00
856b421086 [feature](priv) Support grant node_priv to other user. (#9951)
Currently, only the root user has node_priv privileges.
That is, only the root user can operate the addition and deletion of nodes.

In the original design of Doris, there is an Operator role. This role can have node_priv for node operations.

This PR supports assigning node_priv to users other than root.
However, only users who have both grant_priv and node_priv can assign node_priv to other users.
This ensures that only the root user has this permission, and users who are given node_priv
cannot continue to expand this permission outward.
2022-06-06 11:04:20 +08:00
24ad11af6a [deps] upgrade fabric8 k8s client to compitable new k8s cluster (#9933) 2022-06-06 10:00:36 +08:00
c18f7a31f1 remove redundant this (#9878)
Co-authored-by: vishalsingh <2018uec1001@gmail.com>
2022-06-05 13:09:14 +08:00
da33a48f39 [refactor](policy) Refactor the hierarchy of Policy. (#9786)
The RowPolicy extends Policy
2022-06-04 11:29:09 +08:00
3031919e8f [fix] (planner) slot nullable does not set correctly when plan outer join with inline view (#9927)
- set inline view's slot descriptor to nullable in register column ref
- propagate slot nullable when generate inline view's query node in SingleNodePlanner
2022-06-03 17:50:10 +08:00
937491098e [fix] fix grammar of ADMIN SHOW TABLET STORAGE FORMAT stmt (#9938) 2022-06-03 17:49:34 +08:00
c996334ad1 [improvement] Optimize send fragment logic to reduce send fragment timeout error (#9720)
This CL mainly changes:
1. Reducing the rpc timeout problem caused by rpc waiting for the worker thread of brpc.
    1. Merge multiple fragment instances on the same BE to send requests to reduce the number of send fragment rpcs
    2. If fragments size >= 3, use 2 phase RPC: one is to send all fragments, two is to start these fragments. So that there
         will be at most 2 RPC for each query on one BE.

3. Set the timeout of send fragment rpc to the query timeout to ensure the consistency of users' expectation of query timeout period.

4. Do not close the connection anymore when rpc timeout occurs.
5. Change some log level from info to debug to simplify the fe.log content.

NOTICE:
1. Change the definition of execPlanFragment rpc, must first upgrade BE.
3. Remove FE config `remote_fragment_exec_timeout_ms`
2022-06-03 15:47:40 +08:00
67fa1fcf2a [fix] fix invalid SQL rewrite for field in materialized view (#9877) 2022-06-02 23:43:13 +08:00
dcf18ac322 [fix](hive) fix bug of invalid user info in external table's scan node (#9908)
Fix the hive external table scan node null exception
Now hive external table query will fail when use local user@ip
2022-06-02 10:41:40 +08:00
fccb7b8055 [fix](planner) Fix the bug of can't query the data of new added partition when set partition_prune_algorithm_version = 2 (#9844) 2022-06-01 23:44:14 +08:00
2082d0a01f [optimize](planner)remove redundant conjuncts on plan node (#9819) 2022-06-01 23:43:08 +08:00
2fc2113b05 [feature] Support show proc BackendLoadStatistic (#9618)
The proc info method already exists in `ClusterLoadStatistic.getBackendStatistic`, I'll add a proc node to show it.
2022-06-01 23:30:10 +08:00
8effdd95a7 [fix](routine-load) fix bug that routine load task can not find backend (#9902)
Introduced from #9492.
2022-06-01 17:55:30 +08:00
92babc7a47 [improvement][fix](planner) Add a rewrite rule to optimize InPredicate. (#9739)
1. Convert child expressions in InPredicate to column type and discard child expressions in them that cannot be converted exactly.
2. Fix the bug of ColumnRange exception caused by InPredicate child expressions type conversion.
3. Fix the problem that the tablet could not be hit due caused by InPredicate child expressions type conversion.
2022-06-01 15:26:32 +08:00
4ab7694a7f [Enhancement](Nereids)rewrite framework used in Memo (#9807)
Issue Number: close #9627 , #9628

This PR introduce two essentials for Nereids

1. pattern match iterator used in memo

pattern match iterator is implemented by two iterators nested within each other: GroupExpressionIterator and GroupIterator.
GroupExpressionIterator use GroupIterator to get all children Plan which matching pattern and use them as children to generate pattern matched plan.
GroupIterator use GroupExpressionIterator to get all pattern matched Plan related to GroupExpressions in itself.

2. plan rewrite framework for memo

Rewrite framework is implemented by two jobs: RewriteTopDownJob and RewriteBottomUpJob
Both of them takes a group, a set of rules that need to be applied, and a context as construction parameters.
RewriteTopDownJob apply these jobs from top to down one by one.
RewriteBottomUpJob apply these jobs from bottom to up one by one.
When one rule rewrites plan tree at a plan node. This plan node will be applied all rules again until no rules can rewrite it.
2022-06-01 15:12:58 +08:00
54e9d49718 [Bug][Vectorized] Fix call nvl function core dump (#9883)
Co-authored-by: lihaopeng <lihaopeng@baidu.com>
2022-05-31 22:18:38 +08:00
e2b93a4165 [feature-wip](multi-catalog) Add basic class and interface for multi catalog support 2022-05-31 11:32:44 +08:00
8092439634 [feature](hudi) Step2: Support query hudi external table(include cow and mor table) (#9752)
support query cow and mor hudi table.
2022-05-30 09:43:36 +08:00
7b98dd438d [feature](function) Add nvl function (#9726) 2022-05-30 09:43:00 +08:00
0683181fef [API changed](parser) Remove merge join syntax (#9795)
Remove merge join sql and merge join node
2022-05-30 09:04:21 +08:00
c5369d3220 [bugfix] Fix create table like when having hidden columns (#9694) 2022-05-29 18:02:16 +08:00
e231273ddf [fix](sql-block-rule) sql block rule NPE (#9778) 2022-05-29 16:21:00 +08:00
ee1bed46be [config] Add backend_rpc_timeout_second in FE config (#9779) 2022-05-27 21:58:09 +08:00
b2c2cdb122 [feature] Support compression prop (#8923) 2022-05-27 21:52:05 +08:00
6698f63dec [fix](function) If function adds type inference (#9728) 2022-05-26 22:43:18 +08:00
e701c057dc [style](fe) wrap and whitespace rules (#9764)
change below rules' severity to error and fix original code error:

- EmptyBlock
- EmptyCatchBlock
- LeftCurly
- RightCurly
- IllegalTokenText
- MultipleVariableDeclarations
- OneStatementPerLine
- StringLiteralEquality
- UnusedLocalVariable
- Indentation
- OuterTypeFilename
- MethodParamPad
- GenericWhitespace
- NoWhitespaceBefore
- OperatorWrap
- ParenPad
- WhitespaceAfter
- WhitespaceAround
2022-05-26 16:56:20 +08:00
32a210f426 [fix](help) fix bug of help command (#9761)
This bug is introduced from #9306, that user need to execute
"help stream-load" to show the help doc.
But actually, it should be "help stream load".
2022-05-26 08:44:00 +08:00
0c70359404 [fix](resource-tag) Consider resource tags when assigning tasks for broker & routine load (#9492)
This CL mainly changes:
1. Broker Load
    When assigning backends, use user level resource tag to find available backends.
    If user level resource tag is not set, broker load task can be assigned to any BE node,
    otherwise, task can only be assigned to BE node which match the user level tags.

2. Routine Load
    The current routine load job does not have user info, so it can not get user level tag when assigning tasks.
    So there are 2 ways:
    1. For old routine load job, use tags of replica allocation info to select BE nodes.
    2. For new routine load job, the user info will be added and persisted in routine load job.
2022-05-26 08:42:09 +08:00
2a11a4ab99 [feature-wip][array-type] Support more sub types. (#9466)
Please refer to #9465
2022-05-26 08:41:34 +08:00
be026addde [security] update canal version to fix fastjson security issue (#9763) 2022-05-25 18:22:37 +08:00
cc9321a09b [Enhancement](Nereids)refactor plan node into plan + operator (#9755)
Close #9623 

Summary:
This pr refactor plan node into plan + operator.

In the previous version in nereids, a plan node consists of children and relational algebra, e.g.
```java
class LogicalJoin extends LogicalBinary {
  private Plan left, right;
}
```
This structure above is easy to understand, but it difficult to optimize `Memo.copyIn`: rule generate complete sub-plan,
and Memo must compare the complete sub-plan to distinct GroupExpression and hurt performance.

First, we need change the rule to generate partial sub-plan, and replace some children plan to a placeholder, e.g. LeafOp in Columbia optimizer. And then mark some children in sub-plan to unchanged, and bind the relate group, so don't have to compare and copy some sub-plan if relate group exists.

Second, we need separate the origin `Plan` into `Plan` and `Operator`, which Plan contains children and Operator, and Operator just denote relation relational algebra(no children/ input field). This design make operator and children not affect each other. So plan-group binder can generate placeholder plan(contains relate group) for the sub-query, don't have to generate current plan node case by case because the plan is immutable(means generate a new plan with replace children). And rule implementer can reuse the placeholder to generate partial sub-plan.

Operator and Plan have the similar inheritance structure like below. XxxPlan contains XxxOperator, e.g. LogicalBinary contains a LogicalBinaryOperator.
```
          TreeNode
             │
             │
     ┌───────┴────────┐                                                   Operator
     │                │                                                       │
     │                │                                                       │
     │                │                                                       │
     ▼                ▼                                                       ▼
Expression          Plan                                                PlanOperator
                      │                                                       │
                      │                                                       │
          ┌───────────┴─────────┐                                             │
          │                     │                                 ┌───────────┴──────────────────┐
          │                     │                                 │                              │
          │                     │                                 │                              │
          ▼                     ▼                                 ▼                              ▼
     LogicalPlan          PhysicalPlan                   LogicalPlanOperator           PhysicalPlanOperator
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          ├───►LogicalLeaf      ├──►PhysicalLeaf                  ├──► LogicalLeafOperator       ├───►PhysicalLeafOperator
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          ├───►LogicalUnary     ├──►PhysicalUnary                 ├──► LogicalUnaryOperator      ├───►PhysicalUnaryOperator
          │                     │                                 │                              │
          │                     │                                 │                              │
          │                     │                                 │                              │
          └───►LogicalBinary    └──►PhysicalBinary                └──► LogicalBinaryOperator     └───►PhysicalBinaryOperator
```

The concrete operator extends the XxxNaryOperator, e.g.
```java
class LogicalJoin extends LogicalBinaryOperator;
class PhysicalProject extends PhysicalUnaryOperator;
class LogicalRelation extends LogicalLeafOperator;
```

So the first example change to this:
```java
class LogicalBinary extends AbstractLogicalPlan implements BinaryPlan {
  private Plan left, right;
  private LogicalBinaryOperator operator;
}

class LogicalJoin extends LogicalBinaryOperator {}
```

Under such changes, Rule must build the plan and operator as needed, not only the plan like before.
for example: JoinCommutative Rule
```java
public Rule<Plan> build() {
  // the plan override function can automatic build plan, according to the Operator's type,
  // so return a LogicalBinary(LogicalJoin, Plan, Plan)
  return innerLogicalJoin().then(join -> plan(
    // operator
    new LogicalJoin(join.op.getJoinType().swap(), join.op.getOnClause()),
    // children
    join.right(),
    join.left()
  )).toRule(RuleType.LOGICAL_JOIN_COMMUTATIVE);
}
```
2022-05-24 20:53:24 +08:00
77297bb7ee Fix some typos in fe/. (#9682) 2022-05-23 12:11:01 +08:00
d8f1b77cc1 [improvement](planner) Backfill the original predicate pushdown code (#9703)
Due to the current architecture, predicate derivation at rewrite cannot satisfy all cases,
because rewrite is performed on first and then where, and when there are subqueries, all cases cannot be derived.
So keep the predicate pushdown method here.

eg.
select * from t1 left join t2 on t1 = t2 where t1 = 1;

InferFiltersRule can't infer t2 = 1, because this is out of specification.

The expression(t2 = 1) can actually be deduced to push it down to the scan node.
2022-05-22 21:35:32 +08:00
d270f4f2d4 [config](checksum) Disable consistency checker by default (#9699)
Disable by default because current checksum logic has some bugs.
And it will also bring some overhead.
2022-05-22 21:31:43 +08:00
ad4da4aa8f [doc] Fix typos in documentation (#9692) 2022-05-22 21:30:22 +08:00
3391de482b [Refactor] simplify some code in routine load (#9532) 2022-05-22 21:25:39 +08:00
31e40191a8 [Refactor] add vpre_filter_expr for vectorized to improve performance (#9508) 2022-05-22 11:45:57 +08:00
8fa677b59c [Refactor][Bug-Fix][Load Vec] Refactor code of basescanner and vjson/vparquet/vbroker scanner (#9666)
* [Refactor][Bug-Fix][Load Vec] Refactor code of basescanner and vjson/vparquet/vbroker scanner
1. fix bug of vjson scanner not support `range_from_file_path`
2. fix bug of vjson/vbrocker scanner core dump by src/dest slot nullable is different
3. fix bug of vparquest filter_block reference of column in not 1
4. refactor code to simple all the code

It only changed vectorized load, not original row based load.

Co-authored-by: lihaopeng <lihaopeng@baidu.com>
2022-05-20 11:43:03 +08:00
6f61af7682 [Vectorized][java-udf] add datetime&&largeint&&decimal type to java-udf (#9440) 2022-05-20 10:26:09 +08:00