Commit Graph

4587 Commits

Author SHA1 Message Date
4ccaa0dfc5 [Bug] (load) Broker load kerberos auth fail (#9494) 2022-05-12 15:43:29 +08:00
a0b95d8fcb [fix](storage) fix core for string predicate in storage layer (#9500)
Co-authored-by: Wang Bo <wangbo36@meituan.com>
2022-05-12 15:41:39 +08:00
4cd579b155 [refactor] Check status precise_code instead of construct OLAPInternalError (#9514)
* check status precise_code instead of construct OLAPInternalError
* move is_io_error to Status
2022-05-12 15:39:29 +08:00
d26f5d22be [refactor]Cleanup unused empty files (#9497) 2022-05-12 14:58:28 +08:00
d7705ace65 [fix](binlog-load) binlog load fails because txn exceeds the default value (#9471)
binlog load Because txn exceeds the default value, resume is a failure,
and a friendly prompt message is given to the user, instead of prompting success now,
it still fails after a while, and the user will feel inexplicable
Issue Number: close #9468
2022-05-12 13:31:22 +08:00
cfbf13710b [fix](broker-load) can't load parquet file with column name case sensitive with Doris column (#9358) 2022-05-12 13:27:03 +08:00
122cc3b772 [chore](fe code style)add suppressions to fe check style (#9429)
Current fe check style check all files. But some rules should be only applied on production files.
Add suppressions to suppress some rules on test files.
2022-05-12 12:16:55 +08:00
f11d320213 [feature] support row policy filter (#9206) 2022-05-11 22:11:10 +08:00
289608cc20 [fixbug]fix bug for OLAP_SUCCESS with Status (#9427) 2022-05-11 20:04:06 +08:00
e3bac86b43 [bugfix](vtablet_sink) fix max_pending_bytes for vtablet_sink (#9462)
Co-authored-by: yixiutt <yixiu@selectdb.com>
2022-05-11 18:00:56 +08:00
3ba5ff4705 [doc] update fe checkstyle doc (#9373) 2022-05-11 15:44:29 +08:00
74352c807e [refactor](Nereids): cascades refactor (#9470)
Describe the overview of changes.

- rename GroupExpression
- use `HashSet<GroupExpression> groupExpressions` in `memo`
- add label of `Nereids` for CI
- remove `GroupExpr` from Plan
2022-05-11 11:07:58 +08:00
ad88eb739b [fix](http) Hardening Recommendations Disable TRACE/TRAC methods (#9479) 2022-05-11 09:41:59 +08:00
8fa0122ed0 [refactor](backend) Refactor the logic of selecting Backend in FE. (#9478)
There are many places in FE where a group of BE nodes needs to be selected according to certain requirements. for example:
1. When creating replicas for a tablet.
2. When selecting a BE to execute Insert.
3. When Stream Load forwards http requests to BE nodes.

These operations all have the same logic. So this CL mainly changes:
1. Create a new `BeSelectionPolicy` class to describe the set of conditions for selecting BE.
2. The logic of selecting BE nodes in `SystemInfoService` has been refactored, and the following two methods are used uniformly:
    1. `selectBackendIdsByPolicy`: Select the required number of BE nodes according to the `BeSelectionPolicy`.
    2. `selectBackendIdsForReplicaCreation`: Select the BE node for the replica creation operation.

Note that there are some changes here:
For the replica creation operation, the round-robin method was used to select BE nodes before,
but now it is changed to `random` selection for the following reasons:
1. Although the previous logic is round-robin, it is actually random.
2. The final diff of the random algorithm will not be greater than 5%, so it can be considered that the random algorithm
     can distribute the data evenly.
2022-05-11 09:40:57 +08:00
a738d385db [regression] add regression test for compaction (#9437)
Trigger compaction via REST API in this case.
2022-05-11 09:40:21 +08:00
375c1bf5c0 [feature](mysql-table) support utf8mb4 for mysql external table (#9402)
This patch supports utf8mb4 for mysql external table.

if someone needs a mysql external table with utf8mb4 charset, but only support charset utf8 right now.

When create mysql external table, it can add an optional propertiy "charset" which can set character fom mysql connection, 
default value is "utf8". You can set "utf8mb4" instead of "utf8" when you need.
2022-05-11 09:39:23 +08:00
092a12e983 [feature] show create materialized view (#9391) 2022-05-11 09:29:55 +08:00
718a51a388 [refactor][style] Use clang-format to sort includes (#9483) 2022-05-10 21:25:35 +08:00
ce926a7abb [refactor] delete OLAP_LOG_WARNING related macro definition (#9484)
Co-authored-by: BePPPower <fangtiewei@selectdb.com>
2022-05-10 20:53:45 +08:00
b34ed43ec9 [feature-wip] (memory tracker) (step6, End) Fix some details (#9301)
1. Fix LoadTask, ChunkAllocator, TabletMeta, Brpc, the accuracy of memory track.
2. Modified some MemTracker names, deleted some unnecessary trackers, and improved readability.
3. More powerful MemTracker debugging capabilities.
4. Avoid creating TabletColumn temporary objects and improve BE startup time by 8%.
5. Fix some other details.
2022-05-10 18:17:09 +08:00
99b8e08a5f [Enhancement](Optimizer) Nereids pattern matching base framework (#9474)
This pr provide a new pattern matching framework for Nereids optimizer.

The new pattern matching framework contains this concepts:

1. `Pattern`/`PatternDescriptor`: the tree node's multiple hierarchy shape, e.g. `logicalJoin(logicalJoin(), any()` pattern describe a plan that root is a `LogicalJoin` and the left child is `LogicalJoin` too.
2. `MatchedAction`: a callback function when the pattern matched, usually you can create new plan to replace the origin matched plan.
3. `MatchingContext`: the param pass through MatchedAction, contains the matched plan root and the PlannerContext.
4. `PatternMatcher`: contains PatternDescriptor and MatchedAction
5. `Rule`: a rewrite rule contains RuleType, PatternPromise, Pattern and transform function(equals to MatchedAction)
6. `RuleFactory`: the factory can help us build Rules easily. RuleFactory extends Patterns interface, and have some predefined pattern descriptors.

for example, Join commutative:
```java
public class JoinCommutative extends OneExplorationRuleFactory {
    @Override
    public Rule<Plan> build() {
        return innerLogicalJoin().thenApply(ctx -> {
            return new LogicalJoin(
                JoinType.INNER_JOIN,
                ctx.root.getOnClause(),
                ctx.root.right(),
                ctx.root.left()
            );
        }).toRule(RuleType.LOGICAL_JOIN_COMMUTATIVE);
    }
}
```

the code above show the three step to create a Rule
1. 'innerLogicalJoin()' declare pattern  is an inner logical join. 'innerLogicalJoin' is a predefined pattern.
2. invoke 'thenApply()' function to combine a MatchedAction, return a new LogicalJoin with exchange children.
3. invoke 'toRule()' function to convert to Rule

You can think the Rule contains three parts: 
1. Pattern
2. transform function / MatchedAction
3. RuleType and RulePromise

So
1. `innerLogicalJoin()` create a `PatternDescriptor`, which contains a `Pattern`
2. `PatternDescriptor.then()` convert `PatternDescriptor` to `PatternMatcher,` witch contains Pattern and MatchedAction
3. `PatternMatcher.toRule()` convert `PatternMatcher` to a Rule

This three step inspired by the currying in function programing.

It should be noted, #9446 provide a generic type for TreeNode's children, so we can infer multiple hierarchy type in this pattern matching framework, so you can get the really tree node type without unsafely cast. like this:
```java
logicalJoin(logicalJoin(), any()).then(j -> {
     // j can be inferred type to LogicalJoin<LogicalJoin<Plan, Plan>, Plan>
     // so j.left() can be inferred type to LogicalJoin<Plan, Plan>,
     // so you don't need to cast j.left() from 'Plan' to 'LogicalJoin'
     var node = j.left().left();
})
```
2022-05-10 10:06:04 +08:00
e61d296486 [Refactor] Replace '#ifndef' with '#pragma once' (#9456)
* Replace '#ifndef' with '#pragma once'
2022-05-10 09:25:59 +08:00
51db78d375 [refactor] modify all OLAP_LOG_WARNING to LOG(WARNING) (#9473)
Co-authored-by: BePPPower <fangtiewei@selectdb.com>
2022-05-10 09:25:25 +08:00
76154f11b7 [docs][typo] Fix some typoes in "update.md" content. (#9455)
Fix some typoes in "update.md" content
2022-05-10 09:02:04 +08:00
70642e3bff [Doc] 添加CTAS文档 (#9454)
* ADD: 添加CTAS文档
2022-05-10 09:01:42 +08:00
eec1dfde3a [feature] (vec) instead of converting line to src tuple for stream load in vectorized. (#9314)
Co-authored-by: xiepengcheng01 <xiepengcheng01@xafj-palo-rpm64.xafj.baidu.com>
2022-05-09 11:24:07 +08:00
d1b85d51a0 [code style](fe) Include test sources (#9366)
Include test sources, we also need to check them.
2022-05-09 09:40:44 +08:00
ae01862ae4 [fix](ut) fix DeltaWriter::close_wait parameter mismatch in delta_writer_test (#9457) 2022-05-09 09:38:12 +08:00
7e86c1beab [fix] UT MathFunctionTest.round_test fix (#9447)
Function round support two format round(double) and round(double, int), the argument is variadic.
But FunctionBinaryArithmetic not support variadic argument now, make get_function for round(double, int) failed.

reproduce steps:
1. set enable_vectorized_engine=true;
2. try to call round(double, int);
```
> select round(10.12345,2);
ERROR 1105 (HY000): errCode = 2, detailMessage = Function round is not implemented
```
2022-05-09 09:37:27 +08:00
6834fb23ca [fix](s3) fix s3 Temp file may write failed because of has no space on disk (#9421) 2022-05-09 09:28:43 +08:00
5df5d39161 [doc] update data-model.md and data-partition.md (#9448)
update data-model.md and data-partition.md
2022-05-09 09:19:09 +08:00
35f0725387 [doc] Update DECIMAL.md (#9451)
* Update DECIMAL.md
2022-05-09 09:17:24 +08:00
327f61b796 Update data-partition.md (#9450)
Update data-partition.md
2022-05-09 09:17:00 +08:00
8932fcaf59 [Doc] fix doc link suffix .html to .md (#9442)
* fix doc link suffix html to md
2022-05-09 09:16:06 +08:00
580ce38a3f [fix](schema_hash) Fix bug that introduced by removing schema_hash (#9449) 2022-05-08 21:03:10 +08:00
c633402ce3 [feature] (sql-digest) support sql digest (#8919) 2022-05-08 17:25:41 +08:00
52a2db18c0 [Enhancement](Optimizer) Optimize nereids tree node structure (#9446)
This pr optimize nereids tree node structure for generic parameter and Nary abstract tree node.
It can facilitate the use of pattern match framework.
2022-05-08 16:56:00 +08:00
7234c964ae [Bug] Missing error tablet list when close_wait return error (#9418) 2022-05-08 06:45:28 +08:00
181aa1b4a9 [style]add IntelliJ code style xml (#9438) 2022-05-08 06:41:46 +08:00
68fae88b36 improve doc spark3.2.0 (#9445) 2022-05-08 06:39:58 +08:00
1746f61388 [refactor](test) Refactor FE unit test framework that starts a FE server. (#9388)
Currently, we use `UtFrameUtils` to start a FE server in the FE unit test. 
Each test class has to do some initialization and clean up stuff with the JUnit4
`@BeforeClass` and `@AfterClass` annotation. It's redundant and boring.
Besides, almost all the APIs in `UtFrameUtils` has a `ConnectContext` parameter, which is not easy to use.

This PR proposes to use an inherit-manner, i.e., wrap all the common logic in base class `TestWithFeService`,
leveraging the 
JUnit5 `@BeforeAll` and `@AfterAll` annotation to narrow down the setup and cleanup lifecycle to each test class instance.
At the same time, the derived concrete test class could directly use utility methods inherited from the base class,
without calling a util class and passing a `ConnectContext` argument.

`UtFrameUtils` and `DorisAssert`  are marked as deprecated. We could remove these two classes
if this refactor works well for a time.
2022-05-07 21:28:42 +08:00
fd11a6b493 [fix][feature](Function) fix return type && support hll_union_agg/group_concat agg to window function (#9119) 2022-05-07 20:44:04 +08:00
e5a88dd0a4 [fix](rewrite) The where condition cannot be pushed down because there is no derivation (#8980)
Fix a bug.
The where condition cannot be pushed down because there is no derivation

eg:
select * from tb1 left join tb2 on tb1.id = tb2.id where tb2.id = 1;

The correct case is that the condition of "=1" needs to be deduced to tb1.id,
but the current implementation does not do the deduction
2022-05-07 20:41:11 +08:00
4235db8902 [refactor] some code cleanup for min/max function. (#8874) 2022-05-07 20:39:44 +08:00
9bae0a61ed [fix]Stream load 307 temporary redirection authentication information is lost (#9363) 2022-05-07 19:22:45 +08:00
816aaa7fd1 [doc]Add create java udf document (#9430)
* Add create java udf document

* Add create java udf document
2022-05-07 19:20:56 +08:00
ca92297030 [FE Code Style] Fix wrong checkstyle action configuration (#9370) 2022-05-07 19:18:00 +08:00
b6a74cfea5 [Bug][CTAS] create table by partition list (#9412)
Co-authored-by: Rongqian Li <rongqian_li@idgcapital.com>
2022-05-07 19:17:39 +08:00
ba2cc98cc0 [doc]fix typo in en faq and format pattern (#9423) 2022-05-07 19:16:59 +08:00
a5a7d1276b [DOC]Improve fe idea dev (#9431) 2022-05-07 19:15:35 +08:00