Commit Graph

6630 Commits

Author SHA1 Message Date
dea40e7095 [fix](Nereids): NullSafeEqual should be in HashJoinCondition (#27127)
Originally, we just put `EqualTo` in `HashJoinCondition`, we also need to allow `NullSafeEqual`
2023-11-21 19:08:14 +08:00
445484270b [fix](Nereids): fill miss slot in having subquery (#27177)
fill miss slot in having subquery.

such as 
```
select * from t group by k having max(k) in (select k from t2)
```

the max(k) should be push down aggregate
2023-11-21 18:54:58 +08:00
7e707f5d64 [fix](fe ut) Fix OlapQueryCacheTest failed (#27305)
1. 
```
java.lang.NullPointerException: null
        at org.apache.doris.catalog.Env.getCurrentSystemInfo(Env.java:793) ~[classes/:?]
        at org.apache.doris.qe.SimpleScheduler$UpdateBlacklistThread.run(SimpleScheduler.java:206) ~[classes/:?]
        at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_382]

java.lang.NullPointerException
        at org.apache.doris.qe.OlapQueryCacheTest.setUp(OlapQueryCacheTest.java:226)
```

2.
```
[ERROR] testSqlCacheKeyWithNestedViewForNereids  Time elapsed: 1.962 s  <<< FAILURE!
java.lang.AssertionError: SELECT command denied to user 'testCluster:testUser'@'192.168.1.1' for table 'internal: testCluster:testDb: appevent'
	at org.apache.doris.qe.OlapQueryCacheTest.parseSqlByNereids(OlapQueryCacheTest.java:579)
	at org.apache.doris.qe.OlapQueryCacheTest.testSqlCacheKeyWithNestedViewForNereids(OlapQueryCacheTest.java:1338)
```

3.
```
[ERROR] Tests run: 28, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 113.63 s <<< FAILURE! - in org.apache.doris.qe.OlapQueryCacheTest
[ERROR] testCacheModeTable  Time elapsed: 1.657 s  <<< ERROR!
java.lang.IllegalArgumentException: Value of type org.apache.doris.qe.QueryState incompatible with return type org.apache.doris.system.SystemInfoService of org.apache.doris.catalog.Env#getCurrentSystemInfo()
        at org.apache.doris.qe.OlapQueryCacheTest.setUp(OlapQueryCacheTest.java:156)
```
2023-11-21 16:47:57 +08:00
dd2e9f682f [Fix](statistics)Fix analyze sql including key word bug (#27321)
Fix analyze sql including key word bug. Need use `` to wrap column names.
2023-11-21 13:15:37 +08:00
Pxl
cee8cc44e2 [Bug](insert)fix insert wrong data on mv when stmt have multiple values (#27297)
fix insert wrong data on mv when stmt have multiple values
2023-11-21 12:55:30 +08:00
0b459e50fb [fix](partial update) keep case insensitivity and use the columns' origin names in partialUpdateCols in origin planner (#27223)
close: #27161
2023-11-20 21:16:28 +08:00
fec94b7278 [feature](Nereids): use session variable to enable rule (#27036) 2023-11-20 20:23:24 +08:00
19b1d5365c [minor](stats) rename stats related session variable name #26936 2023-11-20 18:13:12 +08:00
80c75b6da4 [fix](schema change) fix bug of query failure after rename column (#26300) 2023-11-20 16:54:40 +08:00
34c3cde0de Revert "[feature-wip](catalog) support deltalake catalog step1-metadata (#22493)" (#27095)
This reverts commit 5b641ebd40fff71e632ee9be4ede58b744b602b9.

Currently, Deltalake Catalog is not a usable feature. We will continue to implement it in the datalake plug-in system in the future, so we will delete it from the FE code for now.
2023-11-20 16:10:33 +08:00
d939903753 [improvement](statistics)Use count as ndv for unique/agg olap table single key column (#27186)
Single key column of unique/agg olap table has the same value of count and ndv, for this kind of column,
don't need to calculate ndv, simply use count as ndv.
2023-11-20 15:49:08 +08:00
add6bdb240 [fix](multi-catalog)add the max compute fe ut and fix download expired (#27007)
1. add the max compute fe ut and fix download expired
2. solve memery leak when allocator close
3. add correct partition rows
2023-11-20 10:42:07 +08:00
8c9a22cc4f [fix](tablesample) Fix computeSampleTabletIds NullPointerException (#27165)
```
2023-11-05 22:52:01,914 WARN (mysql-nio-pool-167|1655) [StmtExecutor.analyze():992] Analyze failed. stmt[222101, ec1adf0f9f7b405d-8cb71a522bc50b82]
java.lang.NullPointerException: null
        at org.apache.doris.planner.OlapScanNode.computeSampleTabletIds(OlapScanNode.java:952) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.OlapScanNode.init(OlapScanNode.java:548) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.SingleNodePlanner.createScanNode(SingleNodePlanner.java:2064) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.SingleNodePlanner.createTableRefNode(SingleNodePlanner.java:2213) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.SingleNodePlanner.createSelectPlan(SingleNodePlanner.java:1244) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.SingleNodePlanner.createQueryPlan(SingleNodePlanner.java:266) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:189) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.OriginalPlanner.createPlanFragments(OriginalPlanner.java:160) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.planner.OriginalPlanner.plan(OriginalPlanner.java:101) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.analyzeAndGenerateQueryPlan(StmtExecutor.java:1141) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:975) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:673) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:451) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:422) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:435) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:583) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:834) ~[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:1149) ~[?:1.8.0_333]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_333]
        at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_333]
2023-11-05 22:52:01,914 WARN (mysql-nio-pool-167|1655) [StmtExecutor.executeByLegacy():776] execute Exception. stmt[222101, ec1adf0f9f7b405d-8cb71a522bc50b82]
org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Unexpected exception: null
        at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:993) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:673) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:451) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:422) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:435) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:583) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:834) ~[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:1149) ~[?:1.8.0_333]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_333]
        at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_333]
```
2023-11-20 10:03:47 +08:00
70e070182f [feature](executor)Make workload group property not required (#27229)
* Make workload group property not required

* remove useless  UT
2023-11-19 17:01:51 +08:00
836cda65d8 [refactor](profilev2) split merged profile to a single runtime profile to make the logic more clear (#27184) 2023-11-19 13:21:50 +08:00
b560d863c2 [fix](dynamic) Fix error reporting when dynamic partition properties contain incorrect attributes (#25373) 2023-11-19 09:51:57 +08:00
329abc3452 [feature](nereids) runtime filter prune when column stats are not available (#27099)
1. prune rf when column stats are not available
2. print rf in "explain shape plan", both join side and apply side
3. add regression case to check plan shape/rf/rf prune for tpch_sf1000 (stats are not available)
2023-11-18 19:32:33 +08:00
b42828cf69 [fix](window_function) min/max/sum/avg should be always nullable (#27104)
Co-authored-by: starocean999 <40539150+starocean999@users.noreply.github.com>
2023-11-18 18:41:42 +08:00
2f41e0c823 [FIX](complextype)fix information schema for complex type (#27203)
when we select in information schema , here do not show complex type information
2023-11-18 11:32:32 +08:00
be7273da83 [refactor](executor)Refactor workload meta update to be #26710 2023-11-18 11:19:38 +08:00
38e4779fde [fix](ccr) Mark getBinlog,getBinlogLag,getMeta,getBackendMeta as from master (#27211)
Signed-off-by: Jack Drogon <jack.xsuperman@gmail.com>
2023-11-18 00:25:11 +08:00
2841c5cfd2 [improvement](transaction) txn prune memory after visible (#27128) 2023-11-18 00:09:27 +08:00
c20487888f [refact](fe) Refact GlobalTransactionMgr (#27070)
* Only export `GlobalTransactionMgr` method, avoid
  using `DatabaseTransactionMgr`
2023-11-18 00:08:20 +08:00
9319d173dd [refactor](planner) filter empty partitions in a unified location (#27190) 2023-11-17 23:58:21 +08:00
b477839bce [enhancement](jdbc catalog) Add lowercase column name mapping to Jdbc data source & optimize database and table mapping (#27124)
This PR adds the processing of lowercase Column names in Oracle Jdbc Catalog. In the previous behavior, we changed all Oracle columns to uppercase queries by default, but could not handle the lowercase case. This PR can solve this situation and improve All Jdbc Catalog works
2023-11-17 23:51:47 +08:00
5d548935e0 [improvement](insert) support schema change and decommission for group commit (#26359) 2023-11-17 21:41:38 +08:00
e3e249c584 [Bug](SchemeChange) Loading tasks during alter job cause modify column failed (#26975)
When a table is doing schema-change, it adds _doris_shadow prefix in name of modified columns in shadow index.

The writes during schema-change will generate rowset schema with _doris_shadow prefix in BE.

If the alter task arrives at be after the write request, it will use the rowset schema with max version which has the _doris_shadow prefix.

And an error will be thrown as below:

a shadow column is encountered __doris_shadow_p_retailprice
[INTERNAL_ERROR]failed due to operate on shadow column

This commit will disable shadow prefix in rowset meta schema.
2023-11-17 21:24:53 +08:00
c459408580 [fix](jni) avoid BE crash and NPE when close paimon reader (#27129)
1. Do not use FATAL log when jni encounter error, to avoid crash.
2. Fix NPE when closing PaimonReader, the reader may not be assigned if PaimonReader open failed.
2023-11-17 20:01:08 +08:00
635a339bce [fix](fe ut) fix unstable ut DecommissionTest (#27082) 2023-11-17 19:30:24 +08:00
ee12297cd9 [fix](test) Fix fe ut BDBJEJournalTest not stable (#27192) 2023-11-17 19:24:12 +08:00
a8720e645f [fix](fe ut) Fix borrow oject throw npe (#27072)
occasional failure of fe ut, borrowObject throw npe
```
get agent task request. type: CREATE, signature: 10008, fe addr: null
java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
	at org.apache.commons.pool2.impl.GenericKeyedObjectPool.register(GenericKeyedObjectPool.java:1079)
	at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:347)
get agent task request. type: CREATE, signature: 10012, fe addr: TNetworkAddress(hostname:127.0.0.1, port:56072)
	at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:277)
	at org.apache.doris.common.GenericPool.borrowObject(GenericPool.java:99)
	at org.apache.doris.utframe.MockedBackendFactory$DefaultBeThriftServiceImpl$1.run(MockedBackendFactory.java:219)
	at java.lang.Thread.run(Thread.java:750)
```
2023-11-17 19:16:29 +08:00
52995c528e [fix](iceberg) iceberg use customer method to encode special characters of field name (#27108)
Fix two bugs:
1. Missing column is case sensitive, change the column name to lower case in FE for hive/iceberg/hudi
2. Iceberg use custom method to encode special characters in column name. Decode the column name to match the right column in parquet reader.
2023-11-17 18:38:55 +08:00
f8b61d3d8e [Enhance](fe) select BE local broker to scan Hive table when 'broker.name' in hms catalog is specified (#27122)
Since #24830 introduce `broker.name` in hms catalog, data scan will run on specified brokers.
And [doris operator](https://github.com/selectdb/doris-operator) support BE and broker deployed in same pod, BE access local broker is the fastest approach to access data.
In previous logic, every inputSplit will select one BE to execute,  then randomly select one broker for actual data access, BE and related broker are always located on  separate K8S pod.
This pr optimizes the broker select strategy to prioritize BE-local broker when `broker.name` is specified in hms catalog.
2023-11-17 18:29:55 +08:00
fa7e1b7fc7 [fix](Nereids) result type of add precision is 1 more than expected (#27136) 2023-11-17 04:13:09 -06:00
xy
ab322eaa2b [improvement](detailMessage) add AvailCapacity prompt in detailMessage (#26328)
Co-authored-by: xingying01 <xingying01@corp.netease.com>
2023-11-17 16:54:31 +08:00
9b040b3fbd [fix](nereids) partition prune fails in case of NOT expression (#27047)
* handle not and add regression test
2023-11-17 15:50:09 +08:00
ec92ba4af1 [fix](statistics)Fix alter column stats bug (#27093)
Encode the min and max value with base64 encoder while inject the column stats.
2023-11-17 15:40:47 +08:00
285c617a5f [minor](stats) Add start/end time for analyze job, precise to seconds of TableStats update time #27123 2023-11-17 13:59:53 +08:00
06f0c10c8b [fix](nereids) count in correlated subquery shoud not output null value (#27064)
consider sql: 

SELECT * FROM t1 WHERE t1.a <= (SELECT COUNT(t2.a) FROM t2 WHERE (t1.b = t2.b));

when unnest correlated subquery, we create a left join node.
Assume outer query is left table and subquery is right one.
If there is no match, the row from right table is filled with nulls.
But COUNT function is always not nullable. 
So wrap COUNT with Nvl to ensure it's result is 0 instead of null to get the correct result
2023-11-16 22:31:42 -06:00
43ffcc5012 [fix](fe) Fix enable_nereids_planner forward not take effect (#26782)
* The java reflection method `getFields()` only return public fields,
  but enable_nereids_planner is private
2023-11-17 11:13:07 +08:00
334260dff7 [feature](function) support ip function ipv4stringtonum(ordefault, ornull), inet_aton (#25510) 2023-11-17 10:27:07 +08:00
492a22dced select coordinator node from user's tag when exec streaming load (#27106) 2023-11-16 19:55:50 +08:00
754ca1fa46 [fix](Nereids) nested type coercion should not process struct (#27068) 2023-11-16 00:08:38 -06:00
2b401785ce [fix](Nereids) build array and map literal expression failed (#27060)
1. empty array and map literal
2. multi-layer nested array and map literal
2023-11-16 00:08:24 -06:00
343d58123d [Fix](nereids)Fix nereids fail to parse tablesample rows bug (#26981) 2023-11-16 12:23:37 +08:00
bf6a9383bc [fix](stats) table not exists error msg not print objects name (#27074) 2023-11-15 22:10:50 -06:00
6be74d22ea [fix](nereids)fix bug that query infomation_schema.rowsets fe send fragment to one of muilti be. (#27025)
Fixed the bug of incomplete query results when querying information_schema.rowsets in the case of multiple BEs.

The reason is that the schema scanner sends the scan fragment to one of multiple bes, and be queries the information of fe through rpc. Since the rowsets information requires information about all BEs, the scan fragment needs to be sent to all BEs.
2023-11-16 12:08:22 +08:00
7e82e7651a [Improve](txn) Add some fuzzy test stub in txn (#26712) 2023-11-16 11:50:06 +08:00
624d372dcd [FIX](map)fix map element_at with decimal value (#27030) 2023-11-16 11:49:51 +08:00
f3ee6dd55a [feature](Nereids): eliminate sort under subquery (#26993) 2023-11-16 10:30:28 +08:00