Commit Graph

8289 Commits

Author SHA1 Message Date
1f631c388d [enhance](cooldown)accelerate cooldown task produce efficiency (#16089) 2023-02-10 16:58:27 +08:00
c08c643ca0 [fix](test) disable failed ut 'SelectRollupIndexTest#testPreAggHint' temporarily (#16593)
UT 'SelectRollupIndexTest#testPreAggHint' failed caused by #16286
Disable it temporarily to avoid block CI/CD
2023-02-10 16:36:15 +08:00
b99e2dc727 [bug](jdbc) fix jdbc can't get object of PGobject (#16496)
when pg table have some  unsupported column type like: point, polygon, jsonb......
jdbc catalog will convert it to string type in doris. but get result set in java is org.postgresql.util.PGobject
 
Some test need this pr: #16442
2023-02-10 16:19:02 +08:00
ae325f546a [refactor](Nereids): mv AggregateStrategies to implementation rules (#16551) 2023-02-10 14:10:59 +08:00
d9924c9b8e [Improvement](topn) add limit threashold session variable and fuzzy for topn optimizations (#16514)
1. add limit threshold for topn runtime pushdown and key topn optimization
2. use unified session variable topn_opt_limit_threshold for all topn optimizations
3. add fuzzy support for topn_opt_limit_threshold
2023-02-10 12:56:33 +08:00
8758cd412f [feature](auth)Implementing privilege management with rbac model (#16091)
change implement of auth to rbac

each user has one default role which can not be drop;

if you grant priv to user,it will grant to default role ,

In the current pr, the user can still only have one role other than the default role, but in the future, the user and role will be many-to-many

rename PaloRole,PaloAuth,PaloPrivilege to Role,Auth,Privilege
2023-02-10 12:30:49 +08:00
e9cd1d64ed (fix)[multi-catalog][nereids] Reset ExternalFileScanNode required slots after Nereids planner do projection. #16549
The new Nereids planner do column projection after creating scan node. For ExternalFileScanNode, this may cause the columns in required_slots mismatch with the slots after projection. This pr is to reset the required_slots after projection.
2023-02-10 11:28:01 +08:00
1b3902baa2 [Feature](Complex-type) Add struct and map type to Doris (#16444)
This commit support:
1、Insert + select for struct/map type
2、Json stream load for struct type
3、m[key] function for map type

How to use:
Set the fe config to create table for struct and map type
1、admin set frontend config("enable_struct_type" = "true");
2、admin set frontend config("enable_map_type" = "true");

#16547

Co-authored-by: xy720 <xuyang25@baidu.com>
Co-authored-by: amory <wangqiannan@selectdb.com>
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
Co-authored-by: hucheng01 <hucheng01@baidu.com>
2023-02-10 11:00:33 +08:00
0c20c607b2 fix stats (#16556) 2023-02-10 11:00:01 +08:00
885fe1516f [refactor](datev2) refine logics of auto conversion (#16552)
* [refactor](datev2) refine logics of auto conversion

* uodate

* update

* Revert "uodate"

This reverts commit 2609a13b4022b4a603bf992fad64c133def266e0.
2023-02-10 10:06:47 +08:00
48780dcea0 [BugFix](cooldown) push correct cooldownttl to be (#16553)
There were cooldownttl and cooldownttlms in StoragePolicy, it's so error-prone because they served nearly the same.
For example, the init function would only assign the ttl timestamp to cooldownttl, which would end up pushing cooldownttl 0 to be.
2023-02-10 08:45:04 +08:00
438daaaf1c [enchancement](mv) forbidden craete useless mv in fe (#16286)
forbidden create useless mv in fe
2023-02-09 23:00:09 +08:00
ab34f418c3 [bugfix](information schema) sometimes fe throw thrift_rpc_error (#16555)
mysql> SELECT TABLE_NAME, CHECK_OPTION, IS_UPDATABLE, SECURITY_TYPE, DEFINER FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = 'test' ORDER BY TABLE_NAME ASC;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 0
Current database: *** NONE ***

ERROR 1105 (HY000): RpcException, msg: org.apache.doris.rpc.RpcException: failed to call frontend service/n @ 0x563a2b11b6ea doris::Status::ConstructErrorStatus()
@ 0x563a2bcd638f doris::ThriftRpcHelper::rpc<>()
@ 0x563a2b78b777 doris::SchemaHelper::list_table_status()
@ 0x563a2b7a0972 doris::SchemaViewsScanner::get_new_table()
@ 0x563a2b7a0b00 doris::SchemaViewsScanner::get_next_row()
@ 0x563a2ccd0c93 doris::vectorized::VSchemaScanNode::get_next()
@ 0x563a2b7450d6
---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-02-09 21:49:33 +08:00
05ed1f751b [fix](planner)(Nereids) add date and datev2 signature to greatest and least function (#16565) 2023-02-09 21:36:53 +08:00
ab4c718478 [fix](iceberg) remove s3 default temporary credentials #16543
remove TemporaryAWSCredentialsProvider in global s3 source

Co-authored-by: jinzhe <jinzhe@selectdb.com>
2023-02-09 15:36:35 +08:00
ba4b6aa0c0 [hot-fix](cooldown) Fix unknown module cooldownJob when load fe image #16545 2023-02-09 15:36:01 +08:00
4b093d1ef6 [Bug](point query) when prepared statement used lazyEvaluateRangeLocations should clear bucketSeq2locations to avoid memleak (#16531)
When JDBC client enable server side prepared statement, it will cache OlapScanNode and reuse it for performance, but each
time call `addScanRangeLocations` will add new item to `bucketSeq2locations`, so the `bucketSeq2locations` lead to a memleak if OlapScanNode
cached in memory
2023-02-09 14:41:07 +08:00
531616b8ee [Fix](bucket)fix partition with no history data && AutoBucketUtilsTest (#16516)
fix partition with no history data && AutoBucketUtilsTest (#16515)
2023-02-09 10:17:25 +08:00
e1f1386395 [fix](cooldown) Rewrite update cooldown conf (#16488)
Remove error-prone CooldownJob, and use CooldownConfHandler to update Tablet's cooldown conf.
Some bug fix about cooldown.
2023-02-09 09:12:55 +08:00
d1c6b81140 [Bug](log) add some log to find out bug (#16518) 2023-02-08 21:23:02 +08:00
f0b0eedbc5 [fix](planner)group_concat lost order by info in second phase merge agg (#16479) 2023-02-08 20:48:52 +08:00
a512469537 [fix](planner) cannot process more than one subquery in disjunct (#16506)
before this PR, Doris cannot process sql like that
```sql
CREATE TABLE `test_sq_dj1` (
    `c1` int(11) NULL,
    `c2` int(11) NULL,
    `c3` int(11) NULL
) ENGINE=OLAP
DUPLICATE KEY(`c1`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`c1`) BUCKETS 3
PROPERTIES (
    "replication_allocation" = "tag.location.default: 1",
    "in_memory" = "false",
    "storage_format" = "V2",
    "disable_auto_compaction" = "false"
);

CREATE TABLE `test_sq_dj2` (
    `c1` int(11) NULL,
    `c2` int(11) NULL,
    `c3` int(11) NULL
) ENGINE=OLAP
DUPLICATE KEY(`c1`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`c1`) BUCKETS 3
PROPERTIES (
    "replication_allocation" = "tag.location.default: 1",
    "in_memory" = "false",
    "storage_format" = "V2",
    "disable_auto_compaction" = "false"
);

insert into test_sq_dj1 values(1, 2, 3), (10, 20, 30), (100, 200, 300);
insert into test_sq_dj2 values(10, 20, 30);

-- core
SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2) OR c1 IN (SELECT c1 FROM test_sq_dj2) OR c1 < 10;

-- invalid slot
SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2) OR c1 IN (SELECT c2 FROM test_sq_dj2) OR c1 < 10;
```

there are two problems:
1. we should remove redundant sub-query in one conjuncts to avoid generate useless join node
2. when we have more than one sub-query in one disjunct. we should put the conjunct contains the disjunct at the top node of the set of mark join nodes. And pop up the mark slot to the top node.
2023-02-08 18:46:06 +08:00
bb334de00f [enhancement](load) Change transaction limit from global level to db level (#15830)
Add transaction size quota for database

Co-authored-by: wuhangze <wuhangze@jd.com>
2023-02-08 18:04:26 +08:00
666f7096f2 [Fix](multi catalog)(planner) Fix external table statistic collection bug (#16486)
Add index id to column statistic id. Refresh statistic cache after analyze.
2023-02-08 16:51:30 +08:00
b06e6b25c9 [improvement](fuzzy) print fuzzy session variable in FE audit log (#16493)
* [improvement](fuzzy) print fuzzy session variable in FE audit log
2023-02-08 16:38:04 +08:00
e11437d1fe [fix](planner) npe in RewriteBinaryPredicatesRule (#16401)
RewriteBinaryPredicatesRule rewrite expression like 
`cast(A decimal) > decimal` to `A > some_other_bigint`
in order to:
1. push down the rewrite predicate 
2. avoid convert column A to decimal

We get the datatype of `A` by `expr0.getSrcSlotRef().getColumn().getType()`.
However, when A is result of a function from sub-query, this rule is not applicable.
For example:
```
select * 
from (
       select TIMESTAMPDIFF(MINUTE,startTime,endTime) AS timediff 
        from CNC_SliceSate) T  
where timediff > 5.0;
```
we cannot push predicate down to OlapScan(CNC_SliceSate) to save effort.
2023-02-08 15:57:35 +08:00
2883f67042 [fix](iceberg) update iceberg docs and add credential properties (#16429)
Update iceberg docs
Add new s3 credential and properties
2023-02-08 13:53:01 +08:00
41947c73eb [Feature](array-function) Support array functions for nested type datev2 and datetimev2 (#16382) 2023-02-08 12:51:07 +08:00
98c741d664 [fix](Nereids): FilterOrSelf shouldn't And all predicates.. (#16491) 2023-02-08 12:42:22 +08:00
583001bd92 [Bug](share hash table) Support shared hash table on Nereids (#16474) 2023-02-08 11:51:27 +08:00
254790c564 [fix](nereids) FE nereids use DateV2Literal instead of 'cast datev2' (#16386)
BE already support DateV2Literal, and hence, remove code in FE which convert DateV2Literal to Cast datev2
2023-02-08 10:51:35 +08:00
81dbed70c2 [fix](Nereids) back off on tpch p1 (#16478)
adjust nullable on empty set should apply after unnested sub-query
some function should propagate nullable when args are datev2 or datetimev2
add back tpch sf0.1 nereids regression test
2023-02-08 10:43:13 +08:00
a4c28e6efa [Fix](Nereids) runtime filter cannot generate when expression is cast. (#16120) 2023-02-07 20:28:07 +08:00
1d0fdff98a [Bug](sort) disable 2phase read for sort by expressions exclude slotref (#16460)
```
create table tbl1 (k1 varchar(100), k2 string) distributed by hash(k1) buckets 1 properties("replication_num" = "1");

insert into tbl1 values(1, "alice");

select cast(k1 as INT) as id from tbl1 order by id limit 2;
```

The above query could pass `checkEnableTwoPhaseRead` since the order by element is SlotRef but actually it's an function call expr
2023-02-07 19:42:54 +08:00
796d51ae2e [enhance](fuzzy)set rewriteOrToInPredicateThreshold=2/10000 in fuzzy mode (#16456)
* set rewriteOrToInPredicateThreshold=2/10000 in fuzzy mod

* fmt
2023-02-07 12:45:27 +08:00
6fdd35a6f2 [enhancement](mpp process) remove unused method and make report process more clear (#16441)
both update status and open_vectorized_internal will call send_report and stop report thread. move update_status code to open method and remove unnecessary send_report and stop_report_thread.


---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-02-07 12:28:55 +08:00
bed1ab7c19 [Feature](Nereids) Add hint to enable pre-aggregation when scan OLAP table. (#15614)
This pr added support for the pre-aggregation hint. Users could use /*+PREAGGOPEN*/ to enable pre-preaggregation for OLAP table.
For example:
Let's say we have an aggregate-keys table t (k1 int, k2 int, v1 int sum, v2 int sum). Pre-aggregation could be enabled by query with a hint: select k1, v1 from t /*+PREAGGOPEN*/.
2023-02-07 11:59:10 +08:00
0b8c6315fb [fix](broker load) Fix hll_hash(null) in broker load report incorrect Exception (#16293)
Co-authored-by: wuhangze <wuhangze@jd.com>
2023-02-07 11:32:20 +08:00
a13beca0de [Fix](load)Use lower case for load column names. #16422
The columns name in stream load and broker load are case sensitive, make it case insensitive. This would be consist with query, because query sql columns name are case insensitve.
2023-02-07 09:18:37 +08:00
dcbcec0775 [regression](fuzzy)fuzzy enable_fold_constant_by_be (#16448)
* [fuzzy](test) fuzzy some session variables stably according to pull_request_id

* fuzzy enable_fold_constant_by_be

---------

Co-authored-by: stephen <hello_stephen@@qq.com>
2023-02-07 09:17:50 +08:00
3334e3f393 [fix](restore) do not set default replication_allocation when restore with property reserve_replica = true (#15562)
Signed-off-by: nextdreamblue <zxw520blue1@163.com>
2023-02-06 22:38:03 +08:00
737c73dcf0 [Improvement](topn) order by key topn query optimization (#15663) 2023-02-06 15:36:05 +08:00
719b8ca340 [enhance](Nereids): polish code (#16368) 2023-02-06 12:06:55 +08:00
a17fbe2b4c [fix](MTMV) Use current db to identify the MTMV tasks and jobs (#16419)
Show MTMV JOB/Task will list all the jobs and tasks among different databases in spite of the current database.

Now use current db to identify the mtmv tasks and jobs. Only the user who did not use a database can list all job and tasks among different databases.
2023-02-06 12:03:29 +08:00
dccd04a3ba [fix](fe)predicate is wrongly pushed through CUBE function (#15831) 2023-02-06 11:29:15 +08:00
a390252893 [fix](keywork) add TIME to keyword (#16277) 2023-02-06 11:07:11 +08:00
f940cf4cf6 [fix](multi-catalog) fix recursive get schema cache bug (#16415) 2023-02-06 09:23:07 +08:00
b1b2697cc7 [fix](iceberg) fix iceberg catalog (#16372)
1. Fix iceberg catalog access s3
2. Fix iceberg catalog partition table query
3. Fix persistence
2023-02-05 13:15:28 +08:00
df3a6e2412 [fix](fe)only set column info for slots in sortTupleDesc (#16407) 2023-02-04 23:14:25 +08:00
e5d624ce9c [Enhancement](profile) lazy load profileContent string (#16354)
Sometimes the profileContent of ProfileElement is very large (more than 30MB), and this kind of huge string object may cause performance problems for gc. But we use them only when we invoke profile relevant restful apis (such as /profile/{format}/{query_id}, /api/profile and so on), so we need to lazy load them.
2023-02-04 22:53:44 +08:00