Commit Graph

13226 Commits

Author SHA1 Message Date
01ea024497 [fix](nereids) runtimefilter not generated after postprocessor (#23948)
fix bug: rf not generated
2023-09-08 17:37:04 +08:00
1abf5e779d [pipelineX](refactor) refactor debug string (#24083) 2023-09-08 16:58:53 +08:00
161520feb4 [feature](Nereids): enable convert CASE WHEN to IF (#24050)
enable rule to convert CASE WHEN to IF.
2023-09-08 16:58:33 +08:00
c0a41dc0f8 [fix](nereids) external scan use STORAGE_ANY instead of ANY as distibution (#24039) 2023-09-08 16:25:35 +08:00
d8bdd6c137 [fix](nereids) avoid throw analysis exception for unsupported type to make ext table goes nereids (#24089)
void throw analysis ex for unsupported type to make ext table goes nereids.
this will improve the nereids' availability for external table if unsupported type is in the basic table schema but not referenced in the real sql.

tested in external table env.

Consider the following case:
select pu.pk_ct_pu as id
  from fms_rd_nc65_zb.NC65P.CT_PU pu
  left join fms_rd_nc65_zb.NC65P.PUB_WF_INSTANCE pwi
    on pu.pk_ct_pu = pwi.billid 
    and pu.vtrantypecode=pwi.billtype
 left join fms_rd_nc65_zb.NC65P.SM_USER su
    on pu.creator = su.cuserid
 where pu.pk_ct_pu='1001A110000000K8XPVN'; 

PUB_WF_INSTANCE table has a BLOB type column and currently it will throw analysis exception and fallback to old optimizer, although this column is not referenced in the real sql. The old optimizer doesn't have the outer join -> inner join rule and the "pu.pk_ct_pu='1001A110000000K8XPVN'; " is not pushed down and the performance will drop down. After the pr, we add the unsupported type instead of throw exception directly, it will decide the unused case and can continue goes nereids and use all advanced optimization for the sql.
2023-09-08 15:56:29 +08:00
82dc970916 [feature](insert) Support group commit insert (#22829) 2023-09-08 15:51:03 +08:00
741665d37f [Fix](regression) Fix test_partial_update_schema_change (#23960) 2023-09-08 15:40:07 +08:00
84c1f5692e [Fix](autobucket) use single replica partition size to calc bucket number #24045 2023-09-08 14:54:02 +08:00
576855acb2 [fix](Nereids): fix regression-test (#24065) 2023-09-08 14:14:48 +08:00
2965b9b3b4 fix update delete bitmap when rowset is blank (#24075)
If the rowset (derived from a clone) does not have a segment, there is no need to update the delete bitmap.
2023-09-08 12:43:42 +08:00
c68e6a9ca8 [Fix](catalog) Doris datetime type conversion failed (#23906)
1. The catalog is connected to an old version of Doris, and an error is reported when using the datetime field type on the Doris surface .
2. error message [fe]:
  Caused by: java.lang.NumberFormatException: For input string: "DATETIM"
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_291]
  at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_291]
  at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_291]
  at org.apache.doris.datasource.jdbc.client.JdbcMySQLClient.dorisTypeToDoris(JdbcMySQLClient.java:401) ~[doris-fe.jar:1.2- 
 SNAPSHOT]
2023-09-08 10:49:35 +08:00
cb29d1a395 fix compile error with gcc12 (#24049) 2023-09-08 10:36:30 +08:00
b73f345479 [fix](intersect) fix wrong result of intersect node (#24044)
Issue Number: close #24046
2023-09-08 10:27:37 +08:00
3927ceac95 [Bug](runtime filter) Fix runtime filter initialization (#24063)
In be.WARNING, print lots of logs like 'runtime filter params meet error'. This is misleading message
2023-09-08 10:27:20 +08:00
a27349c83a [fix](Export) Concatenation the outfile sql for Export (#23635)
In the original logic, the `Export` statement generates `Selectstmt` for execution. But there is no way to make the `SelectStmt` use the new optimizer.

Now, we change the `Export` statement to generate the `outfile SQL`, and then use the new optimizer to parse the SQL so that outfile can use the new optimizer.
2023-09-08 10:20:18 +08:00
cdb1b341c7 [pipelineX](runtime filter) Support runtime filter (#24054) 2023-09-08 10:17:22 +08:00
Pxl
ac6028a731 [Bug](partition) fix cannot delete from partitions (#24053) 2023-09-08 10:11:30 +08:00
b6b8ef3a18 [chore](script) avoid failed while buiding on non-git repository (#23982)
Co-authored-by: yiguolei <676222867@qq.com>
2023-09-08 10:08:00 +08:00
0bdd078b41 [fix](jdbc catalog) fixed the sqlserver jdbc url parm concatenation error (#23841) 2023-09-08 09:58:20 +08:00
fb5a77b726 [Fix](statistics)Handle external table in statistics cleaner. (#23843)
Before, Statistics Cleaner only handles olap db and table.
External db and tables would be removed without verification. So that external stats could stored no more than 2 days, which is the interval of Stats cleaner thread.
This pr is to add verification for external db and tables.
2023-09-08 09:43:46 +08:00
cb43f07487 [Improvement](statistics)Support basic jdbc external table stats collection (#23963)
Support jdbc external table stats collection.
2023-09-08 09:40:13 +08:00
68acb8597b [fix](nested_loop_join) null value should be output in semi-anti join (#23971)
create table t1
        (k1 bigint, k2 bigint)
        ENGINE=OLAP
DUPLICATE KEY(k1, k2)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(k2) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"is_being_synced" = "false",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
create table t3
        (k1 bigint, k2 bigint)
        ENGINE=OLAP
DUPLICATE KEY(k1, k2)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(k2) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"is_being_synced" = "false",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
Data:

insert into t1 values (1,null),(null,1),(1,2), (null,2),(1,3), (2,4), (2,5), (3,3), (3,4), (20,2), (22,3), (24,4),(null,null);
insert into t3 values (1,null),(null,1),(1,4), (1,2), (null,3), (2,4), (3,7), (3,9),(null,null),(5,1);
Query:

 select t1.* from t1 where not exists ( select k1 from t3 where t1.k2 < t3.k2 );
Result:

Empty set
Expect result:

+------+------+
| k1   | k2   |
+------+------+
| NULL | NULL |
|    1 | NULL |
+------+------+
2023-09-08 09:28:55 +08:00
0dee7246bc Revert "[opt](stats) remove table stats when table has been removed (#23803)" (#24058)
This reverts commit 66d3371400207f568c7ff6ff6bf5f4f0da32bd2c.
Reverts #23803
2023-09-07 23:25:09 +08:00
26337543bf [fix](Nereids) make TVF's distribution spec always be RANDOM (#24020)
Nereids make TVF number as Gather distribution if backend num = 1.
But coordinator could not process gather fragment with scan node.
In the long run, we need to get coordinators to support this scenario.
But it is need a lot of refactor. So, we just forbid Gather distribution
for ScanNode now.
2023-09-07 22:06:45 +08:00
Pxl
ab7c2b9d22 [Bug](type) fix wildcard char's tostring get wrong result (#24041)
fix wildcard char's tostring get wrong result
2023-09-07 20:25:38 +08:00
f0bd2c9c53 [opt](Nereids) optimize error msg of unbound slot (#23933)
for example:
```sql
select avg(c3) from (select c2 from t2) v;
```
the error msg before this PR
```
Invalid call to c3.getDataType() on unbound object
```
the error msg after this PR
```
Unknown column 'c3' in 'table list' in AGGREGATE clause
```
2023-09-07 20:15:59 +08:00
4b6552e929 [fix](regression) create table failed in 'map_agg' (#24030)
Co-authored-by: yiguolei <676222867@qq.com>
2023-09-07 20:14:07 +08:00
b2ca281395 [fix](Nereids) record wrong best plan properties (#23973)
when output meet order by not meet distribution. we use a trick way to
do enforce by set current output to any. but when we do enforce later,
we still use the old output. So when we do choose best plan, we could
not find the older output's plan, since we have replace it by any.
For example:

```
  lowest Plan(cost, properties, plan, childrenRequires)

    18.0 ANY
     id:138#4 cost=0 [0/0/0/] estRows=4 children=[@0 ] (plan=PhysicalWindow[139]@4 ( windowFrameGroup=(Funcs=[row_number() WindowSpec(PARTITION BY b#1, a#0 ROWS BETWEEN UNBOUNDED_PRECEDING AND CURRENT_ROW) AS `r1`#2], PartitionKeys=[b#1, a#0], OrderKeys=[], WindowFrame=WindowFrame(ROWS, UNBOUNDED_PRECEDING, CURRENT_ROW)), requiredProperties=[DistributionSpecHash ( orderedShuffledColumns=[1, 0], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1], [0]], exprIdToEquivalenceSet={0=1, 1=0} ) Order: ([b#1 asc, a#0 asc])], stats=null ))
     [DistributionSpecHash ( orderedShuffledColumns=[0], shuffleType=NATURAL, tableId=3547296, selectedIndexId=3547297, partitionIds=[3547295], equivalenceExprIds=[[0]], exprIdToEquivalenceSet={0=0} ) Order: ([b#1 asc, a#0 asc])]

    32.01171875 DistributionSpecHash ( orderedShuffledColumns=[1], shuffleType=REQUIRE, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1]], exprIdToEquivalenceSet={1=0} ) Order: ([b#1 asc])
     id:161#4 cost=14 [4/4/4/] estRows=4 children=[@4 ] (plan=PhysicalQuickSort[162]@4 ( orderKeys=[b#1 asc], phase=LOCAL_SORT, stats=null ))
     [DistributionSpecHash ( orderedShuffledColumns=[0], shuffleType=NATURAL, tableId=3547296, selectedIndexId=3547297, partitionIds=[3547295], equivalenceExprIds=[[0]], exprIdToEquivalenceSet={0=0} ) Order: ([b#1 asc, a#0 asc])]

    32.01171875 DistributionSpecHash ( orderedShuffledColumns=[1], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1]], exprIdToEquivalenceSet={1=0} ) Order: ([b#1 asc])
     id:161#4 cost=14 [4/4/4/] estRows=4 children=[@4 ] (plan=PhysicalQuickSort[162]@4 ( orderKeys=[b#1 asc], phase=LOCAL_SORT, stats=null ))
     [DistributionSpecHash ( orderedShuffledColumns=[1], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1]], exprIdToEquivalenceSet={1=0} ) Order: ([])]

    18.01171875 DistributionSpecHash ( orderedShuffledColumns=[1], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1]], exprIdToEquivalenceSet={1=0} ) Order: ([])
     id:157#4 cost=0 [0/0/0/] estRows=4 children=[@4 ] (plan=PhysicalDistribute[158]@4 ( distributionSpec=DistributionSpecHash ( orderedShuffledColumns=[1], shuffleType=EXECUTION_BUCKETED, tableId=-1, selectedIndexId=-1, partitionIds=[], equivalenceExprIds=[[1]], exprIdToEquivalenceSet={1=0} ), stats=null ))
     [DistributionSpecHash ( orderedShuffledColumns=[0], shuffleType=NATURAL, tableId=3547296, selectedIndexId=3547297, partitionIds=[3547295], equivalenceExprIds=[[0]], exprIdToEquivalenceSet={0=0} ) Order: ([b#1 asc, a#0 asc])]
```

the last one require a natural shuffle type property from this group.
but this property already been removed when we do
enforceDistributionButMeetSort. So, such exception will be thrown

```
Caused by: org.apache.doris.nereids.exceptions.AnalysisException: Failed to choose best plan
    at org.apache.doris.nereids.NereidsPlanner.chooseBestPlan(NereidsPlanner.java:340) ~[classes/:?]
    at org.apache.doris.nereids.NereidsPlanner.chooseBestPlan(NereidsPlanner.java:323) ~[classes/:?]
    ... 18 more
Caused by: org.apache.doris.nereids.exceptions.AnalysisException: lowestCostPlans with physicalProperties(DistributionSpecHash ( orderedShuffledColumns=[0], shuffleType=NATURAL, tableId=3547296, selectedIndexId=3547297, partitionIds=[35
47295], equivalenceExprIds=[[0]], exprIdToEquivalenceSet={0=0} ) Order: ([b#1 asc, a#0 asc])) doesn't exist in root group
    at org.apache.doris.nereids.NereidsPlanner.lambda$chooseBestPlan$1(NereidsPlanner.java:318) ~[classes/:?]
    at java.util.Optional.orElseThrow(Optional.java:408) ~[?:?]
    at org.apache.doris.nereids.NereidsPlanner.chooseBestPlan(NereidsPlanner.java:317) ~[classes/:?]
    at org.apache.doris.nereids.NereidsPlanner.chooseBestPlan(NereidsPlanner.java:323) ~[classes/:?]
    ... 18 more
```
2023-09-07 20:12:53 +08:00
f2ebe65ea4 [enhancement](exchange) not use thread pool to handle exchange block (#23970)
Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-09-07 19:40:48 +08:00
20b3e5eafe [feature](Datetime) add from_microsecond / from_millisecond function (#23902) 2023-09-07 19:03:49 +08:00
c200b81988 [fix](case) enable case test_bitmap_index (#23964)
enable case test_bitmap_index
2023-09-07 18:55:01 +08:00
66d3371400 [opt](stats) remove table stats when table has been removed (#23803) 2023-09-07 18:02:44 +08:00
fdb7a44f57 Revert "[Feature](partitions) Support auto partition" (#24024)
* Revert "[Feature](partitions) Support auto partition (#23236)"

This reverts commit 6c544dd2011d731b8c9c51384c77bcf19c017981.

* Update config.h
2023-09-07 17:08:26 +08:00
4a455f6a4c [feature](Nereids) multi array contains to array overlap (#23864)
transform

```
 array_contains ( c_array, '1' )
 OR array_contains ( c_array, '2' )
```

to

```
array_overlap(c_array, ['1', '2'])
```
2023-09-07 15:00:40 +08:00
7adab1138c [improvement](index) support CANCEL BUILD INDEX (#23760)
Currently, BUILD INDEX can not be canceled. 
This pr add CANCEL BUILD INDEX as follows:
`CANCEL BUILD INDEX index_name ON table_name [(jobid1,jobid2)]`
2023-09-07 14:48:13 +08:00
e40a4d4ae3 [fix](auth)Fix create user no permissions of information_schema database (#23898)
When creating a new user, this user does not have the information_schema database permission.
2023-09-07 12:55:52 +08:00
Pxl
f13d3008a2 [Bug](type) coredump on get_type_as_primitive_type #24012 2023-09-07 11:28:41 +08:00
349c090469 [fix](move-memtable) lock when send data in load stream stub (#23949) 2023-09-07 11:19:21 +08:00
9b494f4b36 [Fix](autoinc) skip to fill the auto increment column when the input column is not nullable (#23905) 2023-09-07 11:13:22 +08:00
3acf026172 [Enhancement](inverted index) add bkd index query cache to improve perf (#23952)
use query cache to accelerate bkd query performance, especially for high concurrency.
2023-09-07 10:24:27 +08:00
4144e62c5f [pipeline](log) disable some unless error status warning log (#23961) 2023-09-07 10:22:05 +08:00
xy
45dfbeb8b3 [feature](agg) add the aggregation function 'array_agg' #23474
This function requires one arguments just as ARRAY_AGG(col) and col means the column whose values you want to aggregate.
This function Aggregates the values including NULL in a column into an array and returns a value of the ARRAY data type.
2023-09-07 10:21:55 +08:00
537369f4e2 [Fix](http) Fix curl return HTTP_ERROR && Add not_found HttpClientTest, fix (#23984)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
2023-09-07 10:10:51 +08:00
2f8b075b71 [improvement](bitmap) support version for ser/deser of bitmap (#23959) 2023-09-07 09:55:29 +08:00
a532a08944 [Feature](Nereids)support insert overwrite for Nereids (#23682)
- support insert overwrite for Nereids
- Solving the problem of table ID changing(When no partition is specified,automatically specify all partitions for table )

todo: 
- Under the current processing logic, if the master restarts midway, it will generate dirty data (temp partition)
- for old planner ,insert overwrite table ,table id will change
2023-09-06 22:48:15 +08:00
d183e08f6d [opt](MergedIO) optimize merge small IO, prevent amplified read (#23849)
There were two vulnerabilities in the previous fix(https://github.com/apache/doris/pull/20305):
1. `next_content` may not necessarily be a truly readable range
2. The last range of the merged data may be the hollow

This PR fundamentally solves the problem of reading amplification by rechecking the calculation range. According to the algorithm, there is only one possibility of generating read amplification, with only a small content of data within the 4k(`MIN_READ_SIZE `) range. However, 4k is generally the minimum IO size and there is no need for further segmentation.
2023-09-06 22:45:31 +08:00
95ae5376f3 [Fix](BinaryPrefixPage) stop to read values when current pos reached the end of the page in BinaryPrefixPageDecoder::next_batch (#23855) 2023-09-06 16:34:38 +08:00
6c544dd201 [Feature](partitions) Support auto partition (#23236)
Co-authored-by: zhangstar333 <2561612514@qq.com>
2023-09-06 16:26:45 +08:00
cb9acf4918 [fix](planner)fix 'char' function's toSql implementation is wrong (#23860) 2023-09-06 16:16:16 +08:00
df1f4f843a [feature](nereids)push runtime filter to right child of left outer join #23767
A inner join (B left outer join C)

runtimer filter A->C is valid, and can be pushed to C.
2023-09-06 15:47:00 +08:00