Commit Graph

10768 Commits

Author SHA1 Message Date
dcdc81844f [fix](nereids)use same decimalv3 type for params and return types (#20101) 2023-05-26 20:15:51 +08:00
9458a24cd7 [fix](multi-catalog) values in sqlserver should be enclosed by single quotes (#19971)
Fix errors when inserting string/date/datetime values into SQLServer:

ERROR 1105 (HY000): errCode = 2, detailMessage = (172.21.0.101)[INTERNAL_ERROR]UdfRuntimeException: JDBC executor sql has error:
CAUSED BY: SQLServerException: Invalid column name '2021-10-30'.
When using double quotes enclose string values, it will be parsed as column name, so we should enclose string values with single quotes.
2023-05-26 20:04:45 +08:00
ce45d6119d [FIX](regress-test) fix struct_export out data (#20111)
fix struct_export out data
2023-05-26 19:57:51 +08:00
a928b21434 [improvement](exception-safe) sort node is completely exception safe #20041 2023-05-26 18:29:02 +08:00
Pxl
c287e308ab [Chore](java-udf) add some java-udf function name to asan_suppr #20093 2023-05-26 18:05:31 +08:00
d6c2ef4727 [opt](Nereids) support use the string as the hint name key (#20053)
We can not use the string as the variable key to use in the hint.
Before this PR

mysql> SET enable_nereids_planner=true;
Query OK, 0 rows affected (0.01 sec)

mysql> set enable_fallback_to_original_planner=false;
Query OK, 0 rows affected (0.10 sec)

mysql> explain select /*+ SET_var("enable_nereids_planner" = "false") */ 1;
ERROR 1105 (HY000): Exception, msg: Nereids cannot parse the SQL, and fallback disabled. caused by: 


no viable alternative at input 'select /*+ SET_var("enable_nereids_planner"'(line 1, pos 27)
After this PR

mysql> SET enable_nereids_planner=true;
Query OK, 0 rows affected (0.01 sec)

mysql> set enable_fallback_to_original_planner=false;
Query OK, 0 rows affected (0.10 sec)

mysql> select /*+ SET_var("enable_nereids_planner" = "false") */ 1; 
+------+
| 1    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)
Describe your changes.
Support the string for the hint key in the Parser.
2023-05-26 18:04:04 +08:00
b7fd481dcb [Fix](Nereids) Using switch to control minidump input serialize (#20049)
Before change, when doing optimize use Nereids planner, input will serialize to memory first. And when bug happen, it would be dump to minidump file when catching the exception.
We found that serialization process will cause the performance when statistic message too large or when optimization time be small enough.
So the user minidump using should change to ONLY YOU OPEN MINIDUMP SWITCH(set enable_minidump=true;) can you use it.
2023-05-26 18:03:34 +08:00
9e70a9ef84 [opt](compaction) add pick rowset to compact interval config (#19868) 2023-05-26 17:39:02 +08:00
Pxl
041081f081 [Chore](decimal) make decimal value parse fail information readable #20057 2023-05-26 16:17:40 +08:00
a842b9787f [fix](Nereids) should allow identity project when generate bitmap runtime filter (#20062) 2023-05-26 16:08:57 +08:00
317338913c [Bug](topn) Fix topn fetch set real default value (#20074)
1. Before this PR if rowset does not contain column which should be read for related SlotDescriptor will call `insert_default` to column, but it's not this real defautl value.Real default value relevant information should be provided by the frontend side.

2. Support fetch when light schema change is not enabled, but disable for AGG or UNIQUE MOR model
2023-05-26 16:06:55 +08:00
50ced3c3a6 [improve] (jdbc catalog) better handling of postresql bit(1) types with bool type (#20022)
When the postgresql bit type size is 1, it reads as a java.lang.boolean via jdbc, and if we match against string,
it will display true or false. But the normal display should be a number,
so when I detect that the size of bit is 1, I will match it with boolean
2023-05-26 16:06:38 +08:00
488c9ba7c2 [improvement](exchange) test: data stream sender stop sending data to receiver if it returns eos early (#20081) 2023-05-26 16:05:38 +08:00
b481045372 [improvement](k8s)when the IP of be is different from the IP specified by the master, obey it (#19951)
When FE is deployed on a virtual machine and CN is deployed on k8s, FE needs to use a proxy IP to communicate with 
CN nodes, and BE cannot resolve the proxy IP from the local network card. 
We change the previous verification rules and obey the IP assigned by the master
2023-05-26 15:40:29 +08:00
635a9f7a0e [fix](ui)(fe-system) fix fe System Info query error when the fe server run in Windows. (#20072) (#20073)
1. Fix duplicate '/' in front-end request URI.
2. When the FileSystemSeparator is '\\', replace '\\' as '/'

Co-authored-by: labuladuo <labuladuo@douyu.tv>
2023-05-26 15:25:44 +08:00
0ed817ed1a [improvement](status) should send query timeout status to be, instead of internal error (#20016)
If a query is cancelled, the reason is very unclear and we do not know the call stack.



---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
2023-05-26 15:11:17 +08:00
b81e9e2521 [fix](resource-group) Fix resource group memory isolation may release too much memory (#20066)
Suppose three queries are executed in a resource group with a memory_limit of 8G, and they consume memory of query_a = 3G, query_b = 3G, and query_c = 3G. The total memory used is counted as 9G when the resource group GC is executed, which exceeds the resource group limit and cancels query_a.

When the resource group is next GC, the memory of query_a may not be freed yet, and it will be counted again in the total memory consumed by that resource group, which again exceeds the resource group limit and cancels query_b.

From the user's perspective, it is fine to execute query_a and query_b at the same time, but executing query_ a, query_b and query_c will be cancelled for two queries, which is not as expected.

This pr skips the queries that are cancelled when counting the memory used by the resource group. If this causes the process memory to grow, the process gc will handle it.
2023-05-26 14:50:12 +08:00
Pxl
43aa062fb1 [Chore](hash-join) remove useless conditions and add some case (#20050) 2023-05-26 14:45:24 +08:00
047311171d [deps](libhdfs) change hadoop libhdfs to source compile (#20058)
compile it as other deps, instead of downloading prebuild binary.
Only for linux platform
2023-05-26 14:37:49 +08:00
315b30c23d [testcase](union) add test case for union of decimal (#20080) 2023-05-26 14:12:14 +08:00
ee34b6de2d [Refact] (serde) refact mysql serde with data type (#19543)
refact mysql output (de)serialize with data type serde , avoid accoriding switch case Primitive type writed in mysqlWriter
2023-05-26 14:11:17 +08:00
9bc01d3968 [doc](fix)Supplementary array type description #20079 2023-05-26 14:10:18 +08:00
Pxl
15a7420661 [Chore](ub) fix some undefined behaviors (#19986)
/home/zcp/repo_center/doris_master/doris/be/src/olap/rowset/segment_v2/column_reader.cpp:895:21: runtime error: load of value 423208544, which is not a valid value for type 'doris::ReaderType'

/home/zcp/repo_center/doris_master/doris/be/src/vec/columns/column_decimal.cpp:260:33: runtime error: load of misaligned address 0x7fa3348b301c for type 'int64_t' (aka 'long'), which requires 8 byte alignment

/home/zcp/repo_center/doris_master/doris/be/src/olap/block_column_predicate.cpp:82:24: runtime error: variable length array bound evaluates to non-positive value 0

/home/zcp/repo_center/doris_master/doris/be/src/vec/columns/column_string.h:225:26: runtime error: null pointer passed as argument 2, which is declared to never be null
2023-05-26 14:08:40 +08:00
dee9c2240f [feature](Nereids) pushdown filter through window (#18784)
Support the operator `PartitionTopN`, which can partition first and do the topn operation later in each partition. It used in the following case
```
-- Support push the filter down to the window and generate the PartitionTopN.
-- The plan change from `window -> filter` to `partitionTopN -> window -> filter`.
explain select *  from (select * , row_number() over(partition by b order by a) as num from t ) tt where  num <= 10;

-- Support push the limit down to the window and generate the PartitionTopN. 
-- The plan change from `window -> limit` to `partitionTopN -> window -> limit `.
explain select row_number() over(partition by b order by a) as num from t limit 10;

-- Support push the topn down to the window and generate the PartitionTopN. 
-- The plan change from `window -> topn` to `partitionTopN -> window -> topn `.
explain select row_number() over(partition by b order by a) as num from t order by num limit 10;
```

The FE part detail design:
1. Add the following rewrite rules:
    - PUSHDOWN_FILTER_THROUGH_WINDOW
    - PUSH_LIMIT_THROUGH_PROJECT_WINDOW
    - PUSH_LIMIT_THROUGH_WINDOW
    - PUSHDOWN_TOP_N_THROUGH_PROJECTION_WINDOW
    - PUSHDOWN_TOP_N_THROUGH_WINDOW
2. Add the PartitionTopN node(LogicalPlan/ PhysicalPlan/ TranslatorPlan)
3. For the rewrite plan, there are several requests that need to meet:
    - For the `Filter` part, only consider `</ <=/ =` conditions. And the filter conditions will be stored.
    - For the `Window` part, we only support one window function. And we support the `row_number`, `rank`, `dense_rank` window functions. And the `partition by` key and `order by` key can not be empty at the same time. The `Window Frame` should be `UNBOUNDED to CURRENT`.
4. For the `PhysicalPartitionTopN`, the requested property is `Any`and the output property is its children's property.

That's the main details that are very important. For the other part, you can directly check the code.

Issue Number #18646

BE Part #19708
2023-05-26 11:23:48 +08:00
558f625d3b [fix](planner) The group by part should be substituted in the same way as select part (#20019) 2023-05-26 11:05:02 +08:00
92a6122f74 [feature](profile)Add the filtering information of the Bloom filter in profile. (#19789) 2023-05-26 10:56:58 +08:00
9c22fc4130 [fix](multi catalog)Support Hive partiton manually removed (#20024)
If the user manually removed a hive partition (remove the partition dir through hdfs), doris will failed to query the hive 
table with an error message get file split failed for table. That is because the Hive metadata still contains the removed partition.
This pr is to fix this bug. Skip the not exist dirs.
2023-05-26 10:32:45 +08:00
281a0971c8 [Fix](multi catalog, metadata)Init logType in ExternalCatalog while replay meta data to avoid NPE. Remove type variable in ExternaCatalog (#20009)
The variable logType in ExternalCatalog is not persistent to disk, after refresh, it will be set to NULL and cause NPE. This pr is to fix the bug.
Also, remove the old type variable in ExternalCatalog, use logType instead.
2023-05-26 10:31:34 +08:00
8a8d3bcb59 [improvement](multi catalog, nereids)Support collect hive table statistics by sql (#19955)
Support collect hive external table statistics by running sql against hive table.
By running sql, we could collect all the statistics collected for Olap table, including the min, max value of String column.

With 3 BE (16 core, 64 GB), it cost less than 2 minutes to collect TPCH 100GB statistics for all columns of all tables.
Also less than 2 minutes to collect all columns statistics for SSB 100GB tables.
2023-05-26 10:31:02 +08:00
5621ae08e6 [fix](Nereids) function ABS return type not same between constant folding and function signature (#20059)
The abs return the wrong type for the integer type. Return the int type when the arg's type is integer
2023-05-26 10:24:32 +08:00
f1b949ad59 [fix](Nereids) local sort should not translate to unpartitioned partition (#20031)
1. local sort should not update current fragment partition to UNPARTITIONED
2. should set input fragment dest exchange node after create dest fragment
2023-05-26 10:18:56 +08:00
dca0ebb281 [fix](Nereids) constant folding to null should retain data type (#20070) 2023-05-26 10:14:08 +08:00
56360ba04a [fix](memory) Load flush memtable no check memory exceed #20036 2023-05-26 09:57:00 +08:00
bc4e0e97f2 [enhance](S3FileWriter) abort when s3 file writer abnormally quite and optimize s3 buffer pool (#19944)
1. reduce s3 buffer pool's ctor cost
2. before this pr, if one s3 file writer return err when calling append or close function, the caller will not call abort function which result in one confusing DCHECK failed like the following picture
2023-05-26 09:14:38 +08:00
3c2b2361be [docs](memory) debug-tools memory part description Jemalloc #20054 2023-05-26 08:58:57 +08:00
9185b202c5 [Fix](multi-catalog) Fix compilation errors in Column.java. (#20075) 2023-05-25 23:51:29 +08:00
dfaa2db653 [typo](docs) modify the en url to zh url in 2.0 alpha release zh doc (#20038) 2023-05-25 21:08:19 +08:00
d6998723e8 Comment stats unstable cases (#20034) 2023-05-25 21:08:00 +08:00
3f971889b7 [Enhancement](multi catalog) Support hudi mor only java side ,be side not support (#19909)
Support reading Hudi MOR table by using jni connector.
Note:
the FE part of the current PR is not completed all, and the BE part will be supplemented in next PR.
2023-05-25 20:37:01 +08:00
5ee13ce2ac [fix](Nereids): memo skipProject() shouldn't skip NotEliminated project (#20051) 2023-05-25 20:01:31 +08:00
686711adda [fix](publish) dot use wait_for for publish synchorization (#20029)
It leads to use after free problem.
2023-05-25 20:01:06 +08:00
0dce725120 [fix](nereids)fix decimalv3 type error of mod operator (#20039) 2023-05-25 17:25:11 +08:00
3598518e59 [fix](revert) data stream sender stop sending data to receiver if it returns eos early (#19847)" (#20040)
* Revert "[fix](sink) fix END_OF_FILE error for pipeline caused by VDataStreamSender eof (#20007)"

This reverts commit 2ec1d282c5e27b25d37baf91cacde082cca4ec31.

* [fix](revert) data stream sender stop sending data to receiver if it returns eos early (#19847)"

This reverts commit c73003359567067ea7d44e4a06c1670c9ec37902.
2023-05-25 16:50:17 +08:00
694b8b6cd3 [test](pipline) adjust mem limit to 50% (#20030) 2023-05-25 15:51:32 +08:00
Pxl
618961053f [Bug](materialized-view) forbid create mv/rollup on mow table (#20001)
forbid create mv/rollup on mow table
2023-05-25 15:30:12 +08:00
002c76e06f [vectorized](udaf) support udaf function work with window function (#19962) 2023-05-25 14:38:47 +08:00
04415d0b35 [opt](balance) add config balance_slot_num_per_path (#19869)
Make balance_slot_num_per_path configurable.
2023-05-25 13:39:42 +08:00
99e0f7b184 [opt](Nereids) restore the set_var hint after finish the execution (#20004)
# Proposed changes
Before the change:
```
mysql> SET enable_nereids_planner=true;
Query OK, 0 rows affected (0.01 sec)

mysql> explain select /*+ SET_var(enable_nereids_planner = false) */ year_floor(cast('2023-04-28' as date));
-- omit the result here
10 rows in set (0.01 sec)

mysql> select @@enable_nereids_planner;
+--------------------------+
| @@enable_nereids_planner |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (0.00 sec)
```

After the change:
```
mysql> SET enable_nereids_planner=true;
Query OK, 0 rows affected (0.01 sec)

mysql> explain select /*+ SET_var(enable_nereids_planner = false) */ year_floor(cast('2023-04-28' as date));
-- omit the result here
10 rows in set (0.14 sec)

mysql> select @@enable_nereids_planner;
+------+
| TRUE |
+------+
|    1 |
+------+
1 row in set (0.25 sec)
```

# Problem summary
We have already recorded the old session vars when we use the `Nereids` to handle the `set_var` hint.
But after we change the optimizer to the old one, it will handle the `set_var` hint again. But it has already taken effect before. So the old value has already changed. But we will use the changed value to overwrite again.

# Describe your changes.
We will check the old session var value when we want to record it first. If there exists the value, just skip it.
2023-05-25 12:32:01 +08:00
3ebd6e1649 [feat](stats) Support delete expired auto analysis tasks (#19922) 2023-05-25 12:25:11 +08:00
e04b9cb47e [vectorized](function) fix array_map funtion return type maybe get wrong (#19320) 2023-05-25 11:30:28 +08:00