Commit Graph

8289 Commits

Author SHA1 Message Date
ec4347ad39 [enhancement](Nereids) support StatementContext, SET_VAR, and Plan pre/post processor (#11654)
1. add StatementContext, and PlannerContext is renamed to CascadsContext. CascadsContext belong to a StatementContext, and StatementContext belong to a ConnectionContext, and the lifecycle increases in turn. StatementContext can wrap some statement's lifecycle-related state, such as ExpressionId, TableLock. MemoTestUtil can simplify create a CascadesContext and Memo for test.
2. add PlanPreprocessor to process parsed logical plan before copy into memo. and add a PlanPostprocessor to process physical plan after copy out from memo.
3. utilize PlanPreprocessor to process SET_VAR hint, the class is EliminateLogicalSelectHint
4. pass the limit clause in regression test case, in set_var.groovy
2022-08-12 14:49:11 +08:00
a3ae1494ef [Enhancement](admin show replica distribution) size percent should be 0.00% when size is zero #11711
Co-authored-by: wuhangze <wuhangze@jd.com>
2022-08-12 13:58:56 +08:00
800bc100af [feature-wip](unique-key-merge-on-write) show enable_unique_key_merge_on_write property when get ddl (#11664)
* [feature-wip](unique-key-merge-on-write) show enable_unique_key_merge_on_write property when get ddl

* update
2022-08-12 12:14:04 +08:00
7d97aa194b [feature-wip](datev2) Support to use datev2 as partition column (#11618) 2022-08-12 11:54:01 +08:00
6c6328fc6d [fix](join)fix outer join bug when a subquery as nullable side #11700 2022-08-12 11:50:15 +08:00
32e451e6ad [minor](recycle) add log to observe bug (#11687) 2022-08-12 11:40:20 +08:00
Pxl
f5fe622a1b [Bug](materialized view) fix create materialized view fail
1. remove referenced_column(seems unused now).
2. fix mv slot ref id wrong.
3. add type check for hll_hash.
4. enable non-nullable column change to nullable column.
2022-08-12 09:49:16 +08:00
5d66839035 [feature-wip](unique-key-merge-on-write) push down runtime filter on unique key with merge on write table (#11695) 2022-08-11 22:50:13 +08:00
2d5ffac590 [fix](optimization) InferFiltersRule bug: a self inner join on a view, which contains where clause, will cause mis-inference. (#11566) 2022-08-11 17:13:26 +08:00
9214346603 [Bug] fix cancel fragment bug (#11683)
Co-authored-by: chenjie <chenjie@cecdat.com>
2022-08-11 16:48:18 +08:00
aa24c8f973 [Feature](multi-catalog) Support refresh catalog metadata (#11656) 2022-08-11 15:14:05 +08:00
7e828ad85b [Enhancement](profile format) Print fragment and instance in a better format (#11671) 2022-08-11 14:05:41 +08:00
180cc35815 [Feature](nereids) support sub-query and alias in FromClause (#11035)
Support sub-query and alias for TPC-H,for example:
select * from (select * from (T1) A join T2 as B on T1.id = T2.id) T;
2022-08-11 12:42:19 +08:00
d831322806 [refactor](planner): make Table abstract. (#11642) 2022-08-11 12:07:25 +08:00
56ce8c0c5c [feature](http) add api for showing current queries and kill query (#11657) 2022-08-11 10:32:46 +08:00
04d26ddf22 [feature-wip](multi-catalog)Support use catalog.db and show databases from catalog stmt (#11338)
Support use catalog.db and show databases from catalog stmt.
2022-08-11 09:50:32 +08:00
02a3f21b65 [fix](analyzer) InferFilterRule bug: equations in on clause of outer/anti join are not inferable. (#11515) 2022-08-11 09:36:43 +08:00
d8427037be [Bug](doe) Fix some bug (#11594) 2022-08-10 21:00:05 +08:00
976e7685db [minor](*): remove redundant log and unused code. (#11620) 2022-08-10 19:28:04 +08:00
8c344d33e6 [Enhancement](meta) sort result by tablename when show tables like show data (#11638)
* [improvement] sort result by tablename when show tables like 'show data'
2022-08-10 19:26:30 +08:00
c8418d13b5 [improvement](config)Use session variable to replace configuration for 'enable_function_pushdown' (#11641) 2022-08-10 19:25:02 +08:00
89d3809a0e [feature](Nereids): Enable the costAndEnforcerJob (#11604)
1. Enable the costAndEnforcerJob
2. Fix some bug of enforcer.
3. polish property name and method
2022-08-10 15:17:15 +08:00
ae90d45594 [Bug](show data skew)fix show data skew logic (#11616)
Co-authored-by: wuhangze <wuhangze@jd.com>
2022-08-10 08:18:39 +08:00
169996d8e4 [feature](information_schema) add rowsets table into information_s… (#11266)
* [feature](information_schema) add 'segments' table into information_schema
2022-08-09 18:15:54 +08:00
7b67661262 add plan checker (#11619)
This PR proposes to add a plan checker to facilitate plan checking in unit tests.

Usage of plan checker is like below:
```java
new PlanChecker()
  .plan(myPlan)
  .applyBottomUp(myRule)
  .matches(expectedPattern);
```
2022-08-09 17:19:30 +08:00
cc6c92935a [minor](log) add a warn log to observer invalid query profile (#11588)
I try to fix the bug in #10095. the error occurred when I first create a empty table and query it.
But I can't reproduced it again.
So I add a warn log here to observer
2022-08-09 14:10:03 +08:00
2cadf85988 [improvement](alter) modify table's default replica if table is unpartitioned (#11550)
Before, if a table is unpartitioned, when executing following alter stmt:
```
alter table tbl1 set ("replication_num" = "1");
```
Only the tbl1 partition's replication_num is changed
(for unpartitioned table, it also has a single partition with same name as table's)
But the table's default replication_num is unchanged.
So when executing `show create table tbl1`, you will find that the replication_num is still the origin value.

This CL mainly changes:
1. For unpartitioned table, if user change it's replication num, both table's and partition's replication_num will be changed.
2022-08-09 14:09:38 +08:00
436ee0dd1d [feature-wip](statistics) step4.1: manually inject statistics for a table or column (#11030)
This pr mainly to supplement the syntax of the previous pr(#8861),
it supports users to manually inject statistics, including table, partition, and column statistics. 

table/partition stats type:
- row_count
- data_size

column stats type:
- ndv
- avg_size
- max_size
- num_nulls
- min_value
- max_value

Modify table or partition statistics:
```
ALTER TABLE table_name 
SET STATS ('k1' = 'v1', ...) [PARTITIONS(p_name1, p_name2...)]
```

Modify column statistics:
```
ALTER TABLE table_name MODIFY COLUMN columnName 
SET STATS ('k1' = 'v1', ...) [PARTITIONS(p_name1, p_name2...)]
```

Some notes:
- Only support statistics injected into olap type tables.
- Statistics injected into temporary partitions are not supported.
- When injecting statistics, if it is a partitioned table, users need to specify a partition name.
- If multiple partitions are specified, the same stats will be injected on multiple partitions.
- The current code also has mock statistics @zhengshij
2022-08-09 11:24:23 +08:00
2b918eaccd [fix](Doris On ES) Fix es not support aliases error (#11547)
1. Fix es not support aliases error
2. Fix multicatalog query es error
3. add ut
2022-08-09 09:36:05 +08:00
f9b151744d optimize topn query if order by columns is prefix of sort keys of table (#10694)
* [feature](planner): push limit to olapscan when meet sort.

* if olap_scan_node's sort_info is set, push sort_limit, read_orderby_key
and read_orderby_key_reverse for olap scanner

* There is a common query pattern to find latest time serials data.
 eg. SELECT * from t_log WHERE t>t1 AND t<t2 ORDER BY t DESC LIMIT 100

If the ORDER BY columns is the prefix of the sort key of table, it can
be greatly optimized to read much fewer data instead of read all data
between t1 and t2.

By leveraging the same order of ORDER BY columns and sort key of table,
just read the LIMIT N rows for each related segment and merge N rows.

1. set read_orderby_key to true for read_params and _reader_context
   if olap_scan_node's sort info is set.
2. set read_orderby_key_reverse to true for read_params and _reader_context
   if is_asc_order is false.
3. rowset reader force merge read segments if read_orderby_key is true.
4. block reader and tablet reader force merge read rowsets if read_orderby_key is true.

5. for ORDER BY DESC, read and compare in reverse order
5.1 segment iterator read backward using a new BackwardBitmapRangeIterator and
    reverse the result block before return to caller.
5.2 VCollectIterator::LevelIteratorComparator, VMergeIteratorContext return
    opposite result for _is_reverse order in its compare function.

Co-authored-by: jackwener <jakevingoo@gmail.com>
2022-08-09 09:08:44 +08:00
b9f7f63c81 [Fix](planner) Fix wrong planner with count(*) optmizer for cross join optimization (#11569) 2022-08-09 09:01:25 +08:00
7c950c7cd5 [feature](Nereids) support cross join in Nereids (#11502)
support cross join in Nereids

1. add PhysicalNestedLoopJoin
2. Translate PhysicalNestedLoopJoin to CrossJoinNode in PhysicalPlanTranslator
2022-08-08 22:14:27 +08:00
1701ffa7c0 [fix](planner)push constant expr in predicate to outer join's other conjuncts by mistake (#11527)
constant expr in predicate should not be pushed to outer join's other conjuncts
2022-08-08 20:56:08 +08:00
4f60b37402 [feature](Nereids):refactor and add outer join LAsscom. (#11531)
refactor and add outer join LAsscom.
Extract the common function to LAsscomHelper.
2022-08-08 20:08:12 +08:00
Fy
647b6e843a [feature](nereids)add InPredicate in expressions (#11264)
1. Add InPredicate expression parser and translator
2. Add regression-test for In predicate (in nereids_syntax)
3. Support NOT EqualTo and NOT InPredicate in ExpressionTranslator#visitNot()
2022-08-08 19:59:54 +08:00
c1c635e944 [Refactor](Nereids) Fix expression constant and improve SlotExtractor (#11513)
1. Fix expression constant and add unit test.
2. Improve logic in SlotExtractor and remove useless class IterationVisitor.
2022-08-08 17:36:21 +08:00
411254c128 [Enhancement](hdfs) Support loading hdfs config from hdfs-site.xml (#11571) 2022-08-08 14:18:28 +08:00
4f5db35990 [fix](date) fix the value may be changed during the parsing of date and datetime types (#11573)
* [fix](date) fix the value may be changed during the parsing of date and datetime types
2022-08-08 08:58:30 +08:00
8802a41918 fix profile may cause query slow (#11386)
Co-authored-by: Wang Bo <wangbo36@meituan.com>
2022-08-07 20:52:52 +08:00
683a1261c6 [Enhancement](vectorized) Runtime Filter support equivalent slot of outer join (#11530) 2022-08-06 08:10:28 +08:00
57b7a416d2 [chore](build) add apache snapshot maven repo to repositories (#11549) 2022-08-06 07:15:28 +08:00
3070318f95 [Enhancement](IdGenerator) Use IdGeneratorBuffer to get better performance for creating tablet in fe when do alter table job (#11524)
Co-authored-by: caiconghui1 <caiconghui1@jd.com>
2022-08-05 23:27:29 +08:00
d88d1239c5 [feature] (Nereids) support limit clause (#11209)
including:
1. limit clause parser
2. implementation rule to transform LogicalLimit to PhysicalLimit
2022-08-05 11:58:45 +08:00
6eb8ac0ebf [feature-wip][multi-catalog]Support caseSensitive field name in file scan node (#11310)
* Impl case sentive in file scan node
2022-08-05 08:03:16 +08:00
d4e6e3edfd [bugfix]fix time accuracy (#11521) 2022-08-04 21:36:20 +08:00
e11024f5cc [enhancement](Nereids)set default join type to CROSS_JOIN (#11459)
set default join type to CROSS_JOIN on join that has no equal on condition when parse sql string.
2022-08-04 21:25:24 +08:00
6dc41d57f3 [enhancement](Nereids)support count, min and avg function (#11374)
1. add count function
2. add min function
3. add avg function
2022-08-04 21:19:32 +08:00
591b7f3f92 [multi-catalog](oss)Support hive external table on Ali oss. (#11489) 2022-08-04 17:44:34 +08:00
95091256b0 [chore](deps) update bdbje tp doris bdbje, update libhdfs3 to improve performance (#11497) 2022-08-04 17:10:56 +08:00
9f221a703b [feature-wip](statistics) step5: show statistics job information (#8862)
This pull request includes some implementations of the statistics(https://github.com/apache/incubator-doris/issues/6370), it will not affect any existing code and users will not be able to create statistics job.

It implements the display of statistics job information, with the following syntax, users will be able to view the corresponding job information.

syntax:
```
SHOW ANALYZE
    [TABLE | ID]
    [
        WHERE
        [STATE = ["PENDING"|"SCHEDULING"|"RUNNING"|"FINISHED"|"FAILED"|"CANCELLED"]]
    ]
    [ORDER BY ...]
    [LIMIT limit][OFFSET offset];
```

e.g.
| id    | create_time             | start_time              | finish_time             | error_msg | scope               | progress | state    |
| ----- | ----------------------- | ----------------------- | ----------------------- | --------- | ------------------- | -------- | -------- |
| 60051 | 2022-07-21 01:26:26.173 | 2022-07-21 01:26:26.186 | 2022-07-21 01:26:27.104 |           | table1(citycode,pv) | 5/5      | FINISHED |
2022-08-04 16:10:49 +08:00