Commit Graph

6164 Commits

Author SHA1 Message Date
490563cfdb [fix](Nereids) support empty array and map literal (#25145) 2023-10-09 01:23:51 -05:00
b41ec6a8a4 [feature](Nereids): Pushdown LimitDistinct Through Join (#25113)
Push down limit-distinct through left/right outer join or cross join.

such as select t1.c1 from t1 left join t2 on t1.c1 = t2.c1 order by t1.c1 limit 1;
2023-10-09 14:19:22 +08:00
5a55e47acd [Enhancement](Load) stream tvf support two phase commit (#23800) 2023-10-09 14:15:56 +08:00
e4100b4ebd [bugfix](DDL) Fix the bug of incorrect partition policy setting (#25021) 2023-10-09 11:28:48 +08:00
0f59f49768 [bugfix](policy) Forbid creating policy with same name with different resource name (#25025) 2023-10-09 11:27:49 +08:00
ffaa145728 align node id in explain with nereids node id (#25068)
it is painful to align node in `explain` and node in `explain physical plan`, since they use two different sets of node IDs.
This pr makes 'explain' command use node IDs of their correspond node in 'explain physical plan'
2023-10-09 10:11:36 +08:00
683546f71f [fix](catalog)fix use regex parse partition may cause backtracking (#24876) 2023-10-08 21:04:10 -05:00
6d8391e8b5 [fix](load)fix use regex split partition may cause backtracking (#24903) 2023-10-08 20:56:26 -05:00
7af4be1ee3 [fix](mysqldb) Fix mysqldb upgrade (#25111)
If user has database with same name mysql, will introduce problem when doing checkpoint.

Solution:

Add check for this situation, if duplicate, exit and print log info to prevent damage of metadata;
Add fe config field: mysqldb_replace_name to make things correct if user already has mysql db.
Related pr: #23087 #22868
2023-10-09 09:40:56 +08:00
fe167da2ff [fix](hudi) hbase-2.5.5 conflict with hudi (#25136)
PR https://github.com/apache/doris/pull/24606 has updated hbase version to 2.5.5, but it conflict with hudi, causing error like:
```
org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unexpected exception: Failed to get hudi partitions
	at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:1021) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:696) ~[doris-fe.jar:1.2-SNAPSHOT]
...
Caused by: java.lang.NullPointerException
	at org.apache.hadoop.fs.FilterFileSystem.getConf(FilterFileSystem.java:524) ~[hadoop-common-3.3.6.jar:?]
	at org.apache.hadoop.hbase.io.hfile.ReaderContext.<init>(ReaderContext.java:53) ~[hbase-server-2.5.5.jar:2.5.5]
	at org.apache.hadoop.hbase.io.hfile.ReaderContextBuilder.build(ReaderContextBuilder.java:106) ~[hbase-server-2.5.5.jar:2.5.5]
```
2023-10-08 23:39:46 +08:00
3a45001447 [fix](Nerids) fix error when the view has lambda functions (#25067)
1. To ensure compatibility with the original optimizer, expose the non-lambda signature of highorder function externally.
2. fix some bugs in toSql function in the original optimizer
2023-10-08 15:45:24 +08:00
541f48a754 [feature](es-catalog) add include_hidden_indexin order to get the hidden index. (#24826) 2023-10-08 14:35:08 +08:00
d517d7ab69 [Fix](point query) Not allow subquery for point query optimization (#25085) 2023-10-08 14:05:41 +08:00
f3b15d859b [Refactor](Export) delete useless code of Export (#24953) 2023-10-08 13:49:09 +08:00
737124aaef [fix](auth)fix use regex verify mysql password may cause backtracking (#24900) 2023-10-07 23:18:20 -05:00
b4e385e926 [fix](export) fix ConcurrentModificationException in export (#25096)
The session variable in export job should be copied from session variable in connection context.
Because both session variable in connection context and in export job may be modified at same time,
cause ConcurrentModificationException like:

2023-10-07 22:56:12,818 WARN (mysql-nio-pool-2|249) [ConnectProcessor.handleQueryException():396] Process one query failed because unknown reason:
java.util.ConcurrentModificationException: null
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) ~[?:1.8.0_131]
        at java.util.HashMap$KeyIterator.next(HashMap.java:1461) ~[?:1.8.0_131]
        at org.apache.doris.qe.VariableMgr.revertSessionValue(VariableMgr.java:238) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:474) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:438) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:353) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:501) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:752) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_131]
This error is reported by external_table_p0/export/test_export_external_table.groovy
2023-10-08 11:33:27 +08:00
feb1cbe9ed [bug](partition_sort)partition sort need sort all data in two phase global (#24960)
#24886 this PR have mark phase in FE, now add those change in BE.
partition sort need sort all data in two pahse global
2023-10-08 10:46:43 +08:00
4e8cde127c [Enhance](catalog)add table cache in paimon jni (#25014)
- fix get old schema after refresh paimon table
- add table cache in paimon jni
2023-10-08 10:36:18 +08:00
fddef8b473 [fix](es-catalog)fix error when querying the index ,elasticsearch version 8.9.1 (#24839)
Issue Number: close #24833
2023-10-08 10:19:45 +08:00
96eb363b01 [fix](help-module)fix use regex match replaceAll may cause backtracking (#24918) 2023-10-07 21:09:17 -05:00
238c349946 [Fix](replayer) Fix FE crash when replaying analysis logs. (#25024)
Issue Number: close #25023

The detail of this bug has been described at the above issue. We can check if current FE is a master node to avoid such problems.
2023-10-07 23:06:34 +08:00
f3e95608cb (Fix)(RoutineLoad)Query the transaction status NPE when the task has not yet started scheduling (#25074) 2023-10-07 07:26:49 -05:00
b380b8b0b5 [bugfix](multi-catalog) Esexternalcatalog is missing LastUpdateTime. (#24559) 2023-10-07 20:21:33 +08:00
26bc749afd [bugfix](set_var) fix sql level exec_mem_limit does not take effect (#25043) 2023-10-07 20:15:25 +08:00
e5fe4e5b83 [refactor](stats) Refactor TableStatsMeta
1. Add a abstraction for column stats status which is required so furthur optimization and feature development
 2. Enable analyze test in p0 that disabled unexpectedly before
2023-10-07 19:48:54 +08:00
5130a6c006 [improvement](jdbc catalog)Adjustment to JDBC External Table Configuration Based on Internal Table Settings (#25059)
This pull request addresses the behavior of the `lower_case_table_names` parameter for jdbc catalog's based on the configuration of the internal table's corresponding parameter.

Changes:
- For internal tables, if `lower_case_table_names` is set to 1 or 2, thejdbc catalog's parameter is forcefully set to `true`.
- For internal tables, if `lower_case_table_names` is set to 0, the jdbc catalog's parameter can be either `true` or `false` with a default value of `false`.

These adjustments ensure consistency and predictability when working with both internal and external table configurations in Doris.
2023-10-07 06:25:52 -05:00
976335e236 [Fix](stream load) stearm load record use valid txn info when two txn with same label #24320
Co-authored-by: wangqingtao6 <wangqingtao6@jd.com>
2023-10-07 16:42:45 +08:00
1405f1efd2 [refactor](nereids) unify withSel/updateRowCountOnly/withRowCount (#24997)
1.refactor statistics functions withSel/updateRowCountOnly/withRowCount,
2. donot use Double.MAX in stats estimation
3. dateLikeType.rangeLength() do not throw DateTimeException.
2023-10-07 16:22:30 +08:00
3c9ff7af39 [feature](Nereids): push down topN through join (#24720)
Push TopN through Join.

JoinType just can be left/right outer join or cross join, because data of their one child can't be filtered.

new TopN is (original limit + original offset, 0) as limit and offset.
2023-10-07 14:58:53 +08:00
47694c5b36 [fix](jdbc catalog )fix jdbc catalog current_timestamp default (#25016)
This problem is caused when you read table data from Mariadb where the datatime type default value is set to current_timestamp().
2023-10-07 01:43:03 -05:00
0f6ea41220 [bug][auth]Show grant causes role errors in the memory. #24783 (#24841) 2023-10-07 14:06:09 +08:00
727fa2c0cd [opt](tvf) refine the class of ExternalFileTableValuedFunction (#24706)
`ExternalFileTableValuedFunction` now has 3 derived classes:

- LocalTableValuedFunction
- HdfsTableValuedFunction
- S3TableValuedFunction

All these tvfs are for reading data from file. The difference is where to read the file, eg, from HDFS or from local filesystem.

So I refine the fields and methods of these classes.
Now there 3 kinds of properties of these tvfs:

1. File format properties

	File format properties, such as `format`, `column_separator`. For all these tvfs, they are common properties.
	So these properties should be analyzed in parenet class `ExternalFileTableValuedFunction`.
	
2. URI or file path

	The URI or file path property indicate the file location. For different storage, the format of the uri are not same.
	So they should be analyzed in each derived classes.
	
3. Other properties

	All other properties which are special for certain tvf.
	So they should be analyzed in each derived classes.
	
There are 2 new classes:

- `FileFormatConstants`: Define some common property names or variables related to file format.
- `FileFormatUtils`: Define some util methods related to file format.

After this PR, if we want to add some common properties for all these tvfs, only need to handled it in
`ExternalFileTableValuedFunction`, to avoid missing handle it in any one of them.

### Behavior change

1. Remove `fs.defaultFS` property in `hdfs()`, it can be got from `uri`
2. Use `\t` as the default column separator of csv format, same as stream load
2023-10-07 12:44:04 +08:00
0e615a531e [Feature](Job)Job tasks support the choice of persistence or storage in memory (#24919) 2023-10-06 23:20:36 -05:00
7b2ff38401 query cpu hard limit based on doris scheduler (#24844) 2023-10-07 12:03:07 +08:00
70f5b0006f [fix](Nereids) ctas throw npe when default value is null (#25009) 2023-10-06 22:39:32 -05:00
ffad945dd1 [opt](optimizer) Recycle expired table stats #24777
Remove table stats when olap table is dropped
2023-10-07 11:31:45 +08:00
f1e948e5f4 [fix](planner)the common type of date and decimal should be double (#24956) 2023-10-07 11:27:19 +08:00
0631ed61b0 [feature](profilev2) Preliminary support for profilev2. (#24881)
You can set the level of counters on the backend using ADD_COUNTER_WITH_LEVEL/ADD_TIMER_WITH_LEVEL. The profile can then merge counters with level 1.
set profile_level = 1;
such as
sql
select count(*) from customer join item on c_customer_sk = i_item_sk

profile

Simple  profile  
  
  PLAN  FRAGMENT  0
    OUTPUT  EXPRS:
        count(*)
    PARTITION:  UNPARTITIONED

    VRESULT  SINK
          MYSQL_PROTOCAL


    7:VAGGREGATE  (merge  finalize)
    |    output:  count(partial_count(*))[#44]
    |    group  by:  
    |    cardinality=1
    |    TotalTime:  avg  725.608us,  max  725.608us,  min  725.608us
    |    RowsReturned:  1
    |    
    6:VEXCHANGE
          offset:  0
          TotalTime:  avg  52.411us,  max  52.411us,  min  52.411us
          RowsReturned:  8

PLAN  FRAGMENT  1

    PARTITION:  HASH_PARTITIONED:  c_customer_sk

    STREAM  DATA  SINK
        EXCHANGE  ID:  06
        UNPARTITIONED

        TotalTime:  avg  106.263us,  max  118.38us,  min  81.403us
        BlocksSent:  8

    5:VAGGREGATE  (update  serialize)
    |    output:  partial_count(*)[#43]
    |    group  by:  
    |    cardinality=1
    |    TotalTime:  avg  679.296us,  max  739.395us,  min  554.904us
    |    BuildTime:  avg  33.198us,  max  48.387us,  min  28.880us
    |    ExecTime:  avg  27.633us,  max  40.278us,  min  24.537us
    |    RowsReturned:  8
    |    
    4:VHASH  JOIN
    |    join  op:  INNER  JOIN(PARTITIONED)[]
    |    equal  join  conjunct:  c_customer_sk  =  i_item_sk
    |    runtime  filters:  RF000[bloom]  <-  i_item_sk(18000/16384/1048576)
    |    cardinality=17,740
    |    vec  output  tuple  id:  3
    |    vIntermediate  tuple  ids:  2  
    |    hash  output  slot  ids:  22  
    |    RowsReturned:  18.0K  (18000)
    |    ProbeRows:  18.0K  (18000)
    |    ProbeTime:  avg  862.308us,  max  1.576ms,  min  666.28us
    |    BuildRows:  18.0K  (18000)
    |    BuildTime:  avg  3.8ms,  max  3.860ms,  min  2.317ms
    |    
    |----1:VEXCHANGE
    |              offset:  0
    |              TotalTime:  avg  48.822us,  max  67.459us,  min  30.380us
    |              RowsReturned:  18.0K  (18000)
    |        
    3:VEXCHANGE
          offset:  0
          TotalTime:  avg  33.162us,  max  39.480us,  min  28.854us
          RowsReturned:  18.0K  (18000)

PLAN  FRAGMENT  2

    PARTITION:  HASH_PARTITIONED:  c_customer_id

    STREAM  DATA  SINK
        EXCHANGE  ID:  03
        HASH_PARTITIONED:  c_customer_sk

        TotalTime:  avg  753.954us,  max  1.210ms,  min  499.470us
        BlocksSent:  64

    2:VOlapScanNode
          TABLE:  default_cluster:tpcds.customer(customer),  PREAGGREGATION:  ON
          runtime  filters:  RF000[bloom]  ->  c_customer_sk
          partitions=1/1,  tablets=12/12,  tabletList=1550745,1550747,1550749  ...
          cardinality=100000,  avgRowSize=0.0,  numNodes=1
          pushAggOp=NONE
          TotalTime:  avg  18.417us,  max  41.319us,  min  10.189us
          RowsReturned:  18.0K  (18000)
---------

Co-authored-by: yiguolei <676222867@qq.com>
2023-10-07 11:16:53 +08:00
813c8f1e5a [Improve](metric) Improve FE DorisMetricRegistry (#24773)
The current implementation needs to iterate all metrics in a lock,
which might cause latency spikes. This PR changes the underlying
data structure to ConcurrentHashMap so that removing metrics doesn't
need to block the entire registry.
2023-10-07 10:25:55 +08:00
42c52037fc Revert "[Fix](Nereids) fix infer predicate lost cast of source expression (#23692)" (#25008)
This reverts commit be3618316f8411ad36d0a77f5b4405f2dbd128fa.
2023-10-06 21:18:29 -05:00
534d942933 [improvement](tablet clone) impr further repair tablet sched priority (#25046) 2023-10-05 22:19:53 +08:00
c298b1ca1a [fix](timezone) fix parse timezone when include GMT or time zone short ids (#25032) 2023-10-03 20:53:16 +08:00
4c94820ff9 [opt](nereids) adjust column stats in filter estimation (#24973)
TPCDS before
query4  9335    8113    8070    8070
query13 3104    1386    1385    1385
query18 1704    1216    1151    1151
query48 840     840     839     839
query61 435     379     383     379
query71 715     570     579     570
query85 2822    2627    2612    2612
query88 1897    1816    1793    1793
Total cold run time: 20852 ms
Total hot run time: 16799 ms

after:
query4  9610    8287    8249    8249
query13 1721    1013    1042    1013
query18 1585    1186    1155    1155
query48 789     777     778     777
query61 384     387     381     381
query71 713     610     584     584
query85 2020    1867    1843    1843
query88 1859    1812    1805    1805
Total cold run time: 18681 ms
Total hot run time: 15807 ms
2023-09-28 21:34:17 +08:00
8eaf0d3a4b [fix](Nereids) ctas varchar length should set to max except column from slot (#25003) 2023-09-28 21:32:33 +08:00
5dd70b8a25 [fix](planner) createColumnAndViewDefs method use wrong analyzer (#25005) 2023-09-28 06:59:04 -05:00
230b7bd15e [test](nereids) Add some tests for PushFilterInsideJoin and FindHashConditionForJoin rule (#24550) 2023-09-28 03:45:05 -05:00
bf4fb32487 [minor](catalog) remove useless compatibilityMatrix in catalog PrimitiveType (#24999) 2023-09-28 02:57:59 -05:00
a574f29d76 [enhancement](Nereids): use enforcer to choose the n-th plan (#22929) 2023-09-28 15:16:24 +08:00
b50c1448df [fix](Nereids) should not replace slot by Alias when do NormalizeSlot (#24928)
when we do NormalizeToSlot, we pushed complex expression and only remain
slot of it. When we do this, we collect alias and their child and
compute its child in bottom project, remain the result slot in current
node. for example

Window(max(...), c1 as a1)

after normalization, we get

Window(max(...), a1)
+-- Project(..., c1 as a1)

But, in some cases, we remove some SlotReference by mistake, for example

Window(max(...), c1, c1 as a1)

after normalization, we get

Window(max(...), a1)
+-- Project(..., c1 as a1)

we lost the SlotReference c1. This PR fix this problem. After this Pr,
we get

Window(max(...), c1, a1)
+-- Project(..., c1, c1 as a1)
2023-09-28 14:51:08 +08:00
377554ee1c [Fix](Job)Job Task does not display error message (#24897) 2023-09-28 14:47:12 +08:00