Commit Graph

8323 Commits

Author SHA1 Message Date
9ffd109b35 [fix](datetimev2) Fix BE datetimev2 type returning wrong result (#15885) 2023-01-20 22:25:20 +08:00
6b110aeba6 [test](Nereids) add regression cases for all functions (#15907) 2023-01-20 22:17:27 +08:00
5514b1c1b7 [enhancement](tablet_report) accelerate deleteFromBackend function to avoid tablet report task blocked (#16115) 2023-01-20 20:11:58 +08:00
0305aad097 [fix](privilege)fix grant resource bug (#16045)
GRANT USAGE_PRIV ON RESOURCE * TO user;
user will see all database

Describe your changes.

Set a PrivPredicate for show resources and remove USAGE under PrivPredicate in SHOW_ PRIV
2023-01-20 19:00:44 +08:00
3b08a22e61 [test](Nereids) add p0 regression test for Nereids (#15888) 2023-01-20 18:50:23 +08:00
956070e17f fix english number of tpch (#16116) 2023-01-20 17:27:10 +08:00
171404228f [improvement](vertical compaction) cache segment in vertical compaction (#16101)
1.In vertical compaction, segments will be loaded for every column group, so
we should cache segment ptr to avoid too many repeated io.
2.fix vertical compaction data size bug
2023-01-20 16:38:23 +08:00
a4265fae70 [enhancement](query) Make query scan nodes more evenly distributed (#16037)
Add replicaNumPerHost into consideration while schedule scan node to host to make final query scan nodes more evenly distributed in cluster
2023-01-20 16:24:49 +08:00
13d93cb2b4 [typo](doc)nvl add 1.2 label (#15856) 2023-01-20 15:11:58 +08:00
419f433d21 [fix](Nereids) topn arg check is not compatible with legacy planner (#16105) 2023-01-20 15:08:10 +08:00
72df283344 [fix](planner) extract common factor rule should consider not only where predicate (#16110)
This PR #14381 limit the `ExtractCommonFactorsRule` to handle only `WHERE` predicate,
but the predicate in `ON` clause should also be considered. Such as:

```
CREATE TABLE `nation` (
  `n_nationkey` int(11) NOT NULL,
  `n_name` varchar(25) NOT NULL,
  `n_regionkey` int(11) NOT NULL,
  `n_comment` varchar(152) NULL
)
DUPLICATE KEY(`n_nationkey`)
DISTRIBUTED BY HASH(`n_nationkey`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);


select * from
nation n1 join nation n2
on (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
```

There should be predicates:
```
PREDICATES: `n1`.`n_name` IN ('FRANCE', 'GERMANY')
PREDICATES: `n2`.`n_name` IN ('FRANCE', 'GERMANY')
```
On each scan node.

This PR fix this issue by removing the limit of `ExtractCommonFactorsRule`
2023-01-20 14:53:48 +08:00
1638936e3f [fix](oracle catalog) oracle catalog support TIMESTAMP dateType of oracle (#16113)
`TIMESTAMP` dateType of Oracle will map to `DateTime` dateType of Doris
2023-01-20 14:47:58 +08:00
726427b795 [refactor](fe) refactor and upgrade dependency tree of FE and support AWS glue catalog (#16046)
1. Spark dpp
 
	Move `DppResult` and `EtlJobConfig` to sparkdpp package in `fe-common` module.
	So taht `fe-core` is longer depends on `spark-dpp` module, so that the `spark-dpp.jar`
	will not be moved into `fe/lib`, which reduce the size of FE output.
	
2. Modify start_fe.sh

	Modify the CLASSPATH to make sure that doris-fe.jar is at front, so that
	when loading classes with same qualified name, it will be got from doris-fe.jar firstly.
	
3. Upgrade hadoop and hive version

	hadoop: 2.10.2 -> 3.3.3
	hive: 2.3.7 -> 3.1.3
	
4. Override the IHiveMetastoreClient implementations from dependency

	`ProxyMetaStoreClient.java` for Aliyun DLF.
	`HiveMetaStoreClient.java` for origin Apache Hive metastore.

	Because I need to modified some of their method to make them compatible with
	different version of Hive.
	
5. Exclude some unused dependencies to reduce the size of FE output

	Now it is only 370MB (Before is 600MB)
	
6. Upgrade aws-java-sdk version to 1.12.31

7. Support AWS Glue Data Catalog

8. Remove HudiScanNode(no longer support)
2023-01-20 14:42:16 +08:00
3652cb3fe9 [test](Nereids)add test aboule dateType and dateTimeType (#16098) 2023-01-20 14:15:54 +08:00
101bc568d7 [fix](Nereids) fix bugs about date function (#16112)
1. when casting constant, check the value is whether in the range of targetType
2. change the scale of dateTimeV2 to 6
2023-01-20 14:11:17 +08:00
cbb203efd2 [fix](nereids) fix test_join regression test for nereids (#16094)
1. add TypeCoercion for (string, decimal) and (date, decimal)
2. The equality of LogicalProject node should consider children in some case
3. don't push down join condition like "t1 join t2 on true/false"
4. add PUSH_DOWN_FILTERS after FindHashConditionForJoin
5. nestloop join should support all kind of join
6. the intermediate tuple should contains slots from both children of nest loop join.
2023-01-20 14:02:29 +08:00
116e17428b [Enhancement](point query optimize) improve performace of point query on primary keys (#15491)
1. support row format using codec of jsonb
2. short path optimize for point query
3. support prepared statement for point query
4. support mysql binary format
2023-01-20 13:33:01 +08:00
3ebc98228d [feature wip](multi catalog)Support iceberg schema evolution. (#15836)
Support iceberg schema evolution for parquet file format.
Iceberg use unique id for each column to support schema evolution.
To support this feature in Doris, FE side need to get the current column id for each column and send the ids to be side.
Be read column id from parquet key_value_metadata, set the changed column name in Block to match the name in parquet file before reading data. And set the name back after reading data.
2023-01-20 12:57:36 +08:00
ab4127d0b2 [Fix][regression-test] Fix test_hdfs_tvf.groovy by update HDFS conf URI to uri and better error msg handling. (#16029)
Fix test_hdfs_tvf.groovy by update HDFS conf URI to uri and better error msg handling.
test_hdfs_tvf.groovy didn't passed.
2023-01-20 12:40:25 +08:00
ba71516eba [feature](jdbc catalog) support SQLServer jdbc catalog (#16093) 2023-01-20 12:37:38 +08:00
60231454cc [fix](nereids) fix bug in multiply return data type (#15949) 2023-01-20 11:44:24 +08:00
2ed4eac6f8 [feature](Nereids) add scalar function width_bucket (#16106) 2023-01-20 11:31:17 +08:00
73621bdb18 [enhance](Nereids) process DELETE_SIGN_COLUMN of OlapTable(#16030)
1. add DELETE_SIGN_COLUMN in non-visible-columns in LogicalOlapScan
2. when the table has a delete sign, add a filter `delete_sign_coumn = 0`
3. use output slots and non-visible slots to bind slot
2023-01-20 11:27:35 +08:00
6485221ffb [Feature-WIP](inverted index)(bkd) Support try query before query bkd to improve query efficiency (#16075) 2023-01-20 11:19:36 +08:00
6c5470b163 [typo](docs) fix error path in ssb/tpch docs (#16108)
* fix docs error path

* commit suggestionns
2023-01-20 11:07:12 +08:00
5b2191a496 [fix](multi-catalog)Make ES catalog and resource compatible (#16096)
close #16099 

1. Make ES resource compatible with `username` property. Keep the same behavior with ES catalog.
2. Change ES catalog `username` to `user` to avoid confusion.
3. Add log in ESRestClient and make debug easier.
2023-01-20 09:31:57 +08:00
b230b704d2 [Update](thirdparty) omit BUILD_TYPE for clucene, ignore other build type except RelWithDebInfo (#16076)
omit BUILD_TYPE for clucene, ignore other build type except RelWithDebInfo
2023-01-20 09:10:58 +08:00
85c2060862 [Minor](Nereids): minor fix (#16095) 2023-01-20 00:53:11 +08:00
43dade0f68 [fix](doc): fix some spelling mistaks (#16097) 2023-01-19 23:31:45 +08:00
2018b49ef0 [opt](test) scalar_types_p0 use 100k lines dataset and scalar_types_p2 use 1000k (#16104) 2023-01-19 22:59:29 +08:00
69a3ecfd51 [Fix](inverted index) fix add nulls bug for inverted fulltext index (#16078)
We found a problem with inverted index when parser=english,
if there were nulls in columns when flushing inverted index for them, it can cause CLucene throwing an exception.
2023-01-19 21:21:44 +08:00
379ba73675 [enhance](nereids) tightestCommonType of datetime and datev2 is datev2 (#16086)
in original planner, tightestCommonType of datetime and datev2 is datev2.
make nereids compatible with original planner.
2023-01-19 19:55:19 +08:00
6cff651f71 [enhancement](statistics) add some methods to use histogram statistics (#15755)
1. Fix the histogram document
2. Add some methods for histogram statistics

TODO:
1. use histogram statistics for the optimizer
2023-01-19 19:20:18 +08:00
c1dd1fc331 [fix](nereids): fix all bugs in mergeGroup(). (#16079)
* [fix](Nereids): fix mergeGroup()

* polish code

* fix replace children of PhysicalEnforcer

* delete `deleteBestPlan`

* delete `getInputProperties`

* after merge GroupExpression, clear owner Group
2023-01-19 19:15:05 +08:00
dd869077f8 [fix](nereids) do not generate compare between Date to Date (#16061)
BE storage Engine has some bug in Date comparison, and hence if we push down predicates like Date'x' < Date 'y', we get error results.
This pr just convert expr like ’Date'x' < Date 'y',‘ to DateTime'x' < DateTime 'y'

TODO:
do storage engine support date slot compare with datetime?
if it support, we could avoid add cast on the slot
and then, this expression could push down to storage engine.
2023-01-19 15:56:51 +08:00
74c0677d62 [fix](planner) fix bugs in uncheckedCastChild (#15905)
1. `uncheckedCastChild` may generate redundant `CastExpr` like `cast( cast(XXX as Date) as Date)`
2. generate DateLiteral to replace cast(IntLiteral as Date)
2023-01-19 15:51:08 +08:00
21b78cb820 [fix](nereids) Fix bind failed of the slots in the group by clause (#16077)
Child's slot with same name to the slots in the outputexpression would be discarded which would cause the bind failed, since the slots in the group by expressions cannot find the corresponding bound slots from the child's output
2023-01-19 15:36:13 +08:00
0144c51ddb [fix](nereids) fix bug in CaseWhen.getDataType and add some missing case for findTightestCommonType (#15776) 2023-01-19 15:30:25 +08:00
f9406234c6 [ComputeNode](Doc)Add document for compute node (#15743)
Issue Number: close #13144
2023-01-19 15:16:14 +08:00
47aa53fa72 [fix](multi-catalog)switching catalogs after dropping will get NPE. (#16067)
Issue Number: close #16066
2023-01-19 15:13:21 +08:00
b9f1e4a17f [typo](doc)update jfs docs (#16090) 2023-01-19 15:10:49 +08:00
6e090e4daf [Bug](predicate) fix date predicate (#16053) 2023-01-19 14:14:48 +08:00
c5beab39c0 [fix](nereids) Bind slot in having to its direct child instead of grand child (#16047)
For example, in this case, the `date` in having clause should be bind to alias which has same name, instead of `date` field of the relation

SELECT date_format(date, '%x%v') AS `date` FROM `tb_holiday` WHERE `date` between 20221111 AND 20221116 HAVING date = 202245 ORDER BY date;
2023-01-19 13:19:16 +08:00
abdf56bfa5 [fix](Nereids) wrong result of group_concat with order by or null args (#16081)
1. signatures without order element are wrong
2. signature with one arg is miss
3. group_concat should be NullableAggregateFunction
4. fold constant on fe should not fold NullableAggregateFunction with null arg

TODO
1. reorder rewrite rules, and then only forbid fold constant on NullableAggregateFunction with alwaysNullable == true
2023-01-19 11:22:30 +08:00
e846e8c0fd [enhance](Nereids): remove Group constructor for UT. (#16005) 2023-01-19 11:13:23 +08:00
05f0f63718 [fix](daemon) should use GetMonoTimeMicros() (#16070) 2023-01-19 10:44:06 +08:00
0b5e71d3b4 [refactor](refactor field) remove unused method (#16068) 2023-01-19 10:16:09 +08:00
3894de49d2 [Enhancement](topn) support two phase read for topn query (#15642)
This PR optimize topn query like `SELECT * FROM tableX ORDER BY columnA ASC/DESC LIMIT N`.

TopN is is compose of SortNode and ScanNode, when user table is wide like 100+ columns the order by clause is just a few columns.But ScanNode need to scan all data from storage engine even if the limit is very small.This may lead to lots of read amplification.So In this PR I devide TopN query into two phase:
1. The first phase we just need to read `columnA`'s data from storage engine along with an extra RowId column called `__DORIS_ROWID_COL__`.The other columns are pruned from ScanNode.
2. The second phase I put it in the ExchangeNode beacuase it's the central node for topn nodes in the cluster.The ExchangeNode will spawn a RPC to other nodes using the RowIds(sorted and limited from SortNode) read from the first phase and read row by row from storage engine.

After the second phase read, Block will contain all the data needed for the query
2023-01-19 10:01:33 +08:00
c7a72436e6 [Feature](multi-catalog)Add support for JuiceFS (#15969)
The broker implements the interface to juicefs,It supports loading data from juicefs to doris through broker.
At the same time, it also implements the multi catalog to read the hive data stored in juicefs
2023-01-19 08:54:16 +08:00
wxy
7288f1f1d4 [Fix](profile) do not send export profile when enable_profile=false. (#15996) 2023-01-19 08:06:39 +08:00