Commit Graph

2247 Commits

Author SHA1 Message Date
8abd00dcd5 [feature-wip](multi-catalog) Add catalog name to information schema. (#10349)
Information schema database need to show catalog name after multi-catalog is supported.
This part is step 1, add catalog name for schemata table.
2022-06-25 11:53:04 +08:00
3757bd521a [feature](nereids)Convert the expression from nereids to stale expr. (#10343)
Add ExpressionConverter.java to convert the expression from nereids to stale expression
2022-06-25 11:16:52 +08:00
476be35961 [TYPO] fix typo 'destory' -> 'destroy' (#10373) 2022-06-24 19:11:28 +08:00
e82d8433be [feature](nereids) Integrate nereids into current SQL process framework (#10304)
To integrate the nereids optimizer with new SQLParser and Planner to existing SQL process framework, I abstract a interface which named "Planner" and let the Both planner from nereids and stale optimizer implement it, to disguish it
with origin Planner, I rename the Planner to OriginalPlanner.

As we don't want to impact the existing logic too much, I defined a LogicalPlanAdapter to adapt the logicalPlan that is the output of the new paser to the existing code.

Besides, as the MySQL protocol supports sending multiple statements in one packet, so I add Nereids#SparseSQL method to handle this properly.
2022-06-24 18:26:26 +08:00
8f2b2b4457 add dynamic partition DataProperty (#10338) 2022-06-24 16:57:56 +08:00
8a49c7ef04 [chore] Rename Doris binary output format 2022-06-24 15:30:05 +08:00
516f5b1789 [feature-wip](multi-catalog) support to switch catalog (#10381)
Add `switch catalog` stmt with privilege check
2022-06-24 10:42:13 +08:00
2cc670dba6 [fix](vectorized) Support outer join for vectorized exec engine (#10323)
In a vectorized scenario, the query plan will generate a new tuple for the join node.
This tuple mainly describes the output schema of the join node.
Adding this tuple mainly solves the problem that the input schema of the join node is different from the output schema.
For example:
1. The case where the null side column caused by outer join is converted to nullable.
2. The projection of the outer tuple.
2022-06-24 08:59:30 +08:00
e3d549cdfa [fix](proc) Fix bug that TrashProcDir cannot show backend trash detail normally (#10365) 2022-06-24 08:56:32 +08:00
d5be190cf9 [fix](planner)infer predicate rule infer binary pridicate when two slot do not equal by mistake (#10356)
infer predicate rule infer binary predicate when two slot do not equal by mistake
2022-06-24 08:56:12 +08:00
f06a06d623 [chore](fe)remove java doc period end check in checkstyle (#10329)
We do not generate real java doc. All java doc comments is used to help to understand the code logic more easily.
So we need loose java doc style check. Remove period character check in summary java doc check rule.
2022-06-24 08:55:53 +08:00
b8d2c96842 [refactor]Remove load_delete job (#10353) 2022-06-24 00:04:38 +08:00
a5fea86d0a [fix][ldap] fix ldap password null pointer exception. (#10284) 2022-06-23 15:01:18 +08:00
6a54fc2fe5 [feature-wip](multi-catalog)(resubmit) add catalog level privileges (#10345) 2022-06-23 14:10:11 +08:00
e9662e2861 [docs] fix HelpTopic for key words (#10276) 2022-06-23 12:42:49 +08:00
4d444733d3 MOD: sql block rule support exists (#10316) 2022-06-23 12:38:30 +08:00
815ea35578 [fix](multi-catalog) should load datasource before loading cluster (#10330)
A temp DataSourceMgr is created when catalog intializes, and will be
updated in the loadCluster process. However, the loadDatasource process
will create a new DataSourceMgr with no cluster updated, and write such
DatasourceMgr to image. Finally, when the doris starts to recover, no
cluster is available.
2022-06-23 10:59:12 +08:00
46d20818f1 [fix][vectorized] Fix bug the of window function result not match plan nullable (#10340)
Co-authored-by: lihaopeng <lihaopeng@baidu.com>
2022-06-23 08:40:12 +08:00
a2b5020375 [fix](partition-cache) fix result may not write when enable partition cache (#10319)
fix result may not write when enable partition cache
2022-06-22 23:42:46 +08:00
2bd8b0713a [feature](Nereids): cost and stats; (#10199)
feature: cost and stats;

+ Add cost model data struct.
+ Add operator visitor for calculating cost.
+ Add plan context.
2022-06-22 22:46:22 +08:00
8204b41d88 [feature](nereids)temporary disable exploration jobs in cascades (#10290)
Only do implementation in cascades.

In order to achieve the ssb test, at this stage, temporarily comment out the explore rule process in cascades.
It needs to be added in the future.
2022-06-22 20:05:01 +08:00
2a0ac05ce7 [fix] Fix duplicate code for PropertyAnalyzer.analyzeDataProperty() (#10190)
PropertyAnalyzer.analyzeDataProperty(Map<String, String> properties, final DataProperty oldDataProperty) has something not suitable.
Parameter oldDataProperty is the old DataProperty, properties should be used to replace some of its members.
If properties has no some members, old ones need to be left, but not be set to default value.
Function modifyPartitionsProperty() uses analyzeDataProperty(), but create a new DataProperty again, it is duplicate.
2022-06-22 15:28:04 +08:00
239ef84835 [Minor](nereids): Get plan directly (#10270) 2022-06-22 14:07:28 +08:00
531c9abac8 [feature](nereids) Add ssb related expressions and PlanNode (#10227)
Add related expressions and AggPlan and SortPlan.

This PR includes the addition of the following expression types:
Arithmetic/BetweenPredicate/CompoundPredicate/FunctionCall.

PlanNode:
LogicalAggregation/LogicalSort

Add a ut to verify related expressions and node parsing
2022-06-22 11:54:28 +08:00
83803d1968 [feature](nereids) implementation rules. (#10194) 2022-06-21 23:34:08 +08:00
Pxl
b3b054c9ff [fix](schema-change) fix schema_change failed because of emtpy origin_column_name passed and fix ut fail on isFullyQualified (#10281) 2022-06-21 19:53:58 +08:00
47dba440d0 Revert "[feature-wip](multi-catalog) add CatalogPrivTable to support unified authority management of datalake (#10246)" (#10297)
This reverts commit 41cb4c8f9cf1b58fb33a1e46d2b7db803a15a59f.
2022-06-21 15:55:15 +08:00
24732126d2 [feature-wip](Nereids)Add bind slot reference rules and support any/multi/group/multigroup with predicate pattern (#10241)
Add bind slot reference rules and support any/multi/group/multigroup with predicate pattern
2022-06-21 10:51:46 +08:00
41cb4c8f9c [feature-wip](multi-catalog) add CatalogPrivTable to support unified authority management of datalake (#10246)
Supported:
1. Change FeMetaVersion to 111, compatible with upgrade from 110.
2. Add catalog level privileges, and degrade global level privileges to catalog level if FeMetaVersion < 111.
3. Support 'show all grants', 'show roles' statement.
4. Previous version of SQL syntax.

Todo:
1. three-segment format catalog.database.table in SQL syntax.
2. User document for the unified authority management of datalake.
3. LDAP services to provide authentication.
2022-06-21 10:26:50 +08:00
dd39287a0a [fix](compile) Fix compile error in external file scan node (#10274) 2022-06-20 22:39:32 +08:00
8a8d24b4a6 [feature-wip](multi-catalog) External file scan node (#9973) 2022-06-20 17:46:24 +08:00
8531dcb885 [refactor](nereids) Abstract interface of statistics framework for new optimizer reuse (#10240)
As the statistics framework could not be reused by new optmizer before, so I abstract some interface to make it reusable.

1. Make Slot extends the Id
2. Add new interface:ExprStats,PlanStats
3. Move definition of PlanNode.NodeType to statistics sub-directory
2022-06-20 15:16:06 +08:00
087fc596b1 [feature] add remote storage policy config for create table properties (#10159)
Add remote storage policy config for create table properties. It will set storage policy for table and partitions in `CREATE TABLE` and `ALTER TABLE`.
This policy will be used when partition is being migrated from local to remote.
grammy:
1.
`CREATE TABLE TblPxy1
(...)
ENGINE=olap
DISTRIBUTED BY HASH (aa) BUCKETS 1
PROPERTIES(
    "remote_storage_policy" = "testPolicy3"
);`
2.
`ALTER TABLE TblPxy01 SET ("remote_storage_policy" = "testPolicy3");`
3.
`ALTER TABLE TblPxy01 MODIFY PARTITION p2 SET ("remote_storage_policy" = "testPolicy3");`
2022-06-20 12:42:23 +08:00
2f37e108e3 [feature-wip](array-type) add ArrayType support for FeFunctions (#10041)
FEFunctionSignature do not support ArrayType as args, then following SQL failed:
`> select array_contains([1,2,3], 1);`
ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: org.apache.doris.catalog.ArrayType cannot be cast to org.apache.doris.catalog.ScalarType
2022-06-20 09:35:06 +08:00
9a1f1c3864 [improvement](variables) change session variable when set global variable (#10238)
Currently, when setting variables with `global` keywords, it will not affect the
current session variable's value. That is always make user confused.

This CL mainly changes:

1. Change session variable when set global variable
2022-06-20 09:05:50 +08:00
f728fd4933 [fix](auth) Authentication exception when the name of database or table contains an underscore in grant statement. (#10213) 2022-06-19 22:20:01 +08:00
67f341f44e [TLP](step-1) Remove incubator prefix (#10230)
Remove some `incubator-` prefix in source code.
The document is not modified, will be done in next PR.
2022-06-19 19:34:52 +08:00
6b61b970f5 [chore] Fix a warning reported by maven (#10205) 2022-06-19 10:34:27 +08:00
1d3496c6ab [feature] support backup/restore connect to HDFS (#10081) 2022-06-19 10:26:20 +08:00
0e404edf54 [improvement] Change array offset type from UInt32 to UInt64 (#10070)
Now column `Array<T>` contains column `offsets` and `data`, and type of column `offsets` is UInt32 now.
If we call array_union to merge arrays repeatedly, the size of array may overflow.
So we need to extend it before `Array Data Type` release.
2022-06-19 10:24:08 +08:00
b7b78ae707 [style](fe)the last step of fe CheckStyle (#10134)
1. fix all checkstyle warning
2. change all checkstyle rules to error
3. remove some java doc rules
    a. RequireEmptyLineBeforeBlockTagGroup
    b. JavadocStyle
    c. JavadocParagraph
4. suppress some rules for old codes
    a. all java doc rules only affect on Nereids
    b. DeclarationOrder only affect on Nereids
    c. OverloadMethodsDeclarationOrder only affect on Nereids
    d. VariableDeclarationUsageDistance only affect on Nereids
    e. suppress OneTopLevelClass on org/apache/doris/load/loadv2/dpp/ColumnParser.java
    f. suppress OneTopLevelClass on org/apache/doris/load/loadv2/dpp/SparkRDDAggregator.java
    g. suppress LineLength on org/apache/doris/catalog/FunctionSet.java
    h. suppress LineLength on org/apache/doris/common/ErrorCode.java
2022-06-17 21:02:45 +08:00
6baa694bc1 [feature-wip](multi-catalog) Catalog operation syntax (#10033)
Impl catalog operation syntax
2022-06-17 17:50:31 +08:00
d51166dd2a [Enhancement](Nereids) Automatic compute logical properties (#10176)
Automatic compute logical properties
2022-06-17 11:31:05 +08:00
5e47b03595 [feature-wip](array-type) Add array aggregation functions (#10108) 2022-06-17 11:07:49 +08:00
b9f8df0264 [Bug] Compatible with Datagrip, fix checkStyle (#10143)
* Compatible with Datagrip, fix checkStyle

* ADD: comment
2022-06-17 11:05:17 +08:00
67e95276fb [fix](optimizer) Fix the default join reorder algorithm (#10174)
Default join reorder algorithm not working for the most cases.
2022-06-17 10:59:33 +08:00
2a1d1b951a [data lake]Add HMS external data source. (#10088) 2022-06-17 08:49:15 +08:00
44e979e43b [Vectorized][Function] add orthogonal bitmap agg functions (#10126)
* [Vectorized][Function] add orthogonal bitmap agg functions
save some file about orthogonal bitmap function
add some file to rebase
update functions file

* refactor union_count function
refactor orthogonal union count functions

* remove bool is_variadic
2022-06-17 08:48:41 +08:00
f1c9105af1 [feature] Support hive on s3 (#10128)
Support query hive table on S3. Pass AK/SK, Region and s3 endpoint to hive table while creating the external table.

example create table sql:
```
CREATE TABLE `region_s3` (
`r_regionkey` integer NOT NULL,   
`r_name` char(25) NOT NULL,   
`r_comment` varchar(152) ) 
engine=hive 
properties 
("database"="default", 
"table"="region_s3", 
“hive.metastore.uris"="thrift://127.0.0.1:9083",
“AWS_ACCESS_KEY”=“YOUR_ACCESS_KEY",
“AWS_SECRET_KEY”=“YOUR_SECRET_KEY",
"AWS_ENDPOINT"="s3.us-east-1.amazonaws.com", 
“AWS_REGION”=“us-east-1”);
```
2022-06-16 19:15:46 +08:00
4b9d500425 [improvement](profile) Add table name and predicates (#10093) 2022-06-16 10:59:31 +08:00