0497d58943
[FIX]DCHECK error of array functions ( #11335 )
2022-07-30 14:15:13 +08:00
5913c7c52c
[feature-wip](array-type) add function array_slice ( #11054 )
...
array_slice function returns a slice of the array.
2022-07-27 18:43:52 +08:00
babab5d535
[feature-wip] support datetimev2 ( #11085 )
2022-07-23 16:07:59 +08:00
3744321f01
[feature-wip](array-type) add function array_union/array_except/array_intersect ( #10781 )
...
Add array_union/array_except/array_intersect function.
2022-07-22 13:50:13 +08:00
77ef19dbcd
[BugFix](Array)Fix using Array aggregate function caused be coredump ( #10649 )
2022-07-18 13:47:17 +08:00
2d5aca18fb
[feature-wip](array) add the array_sort function ( #10598 )
...
Co-authored-by: hucheng01 <hucheng01@baidu.com >
2022-07-18 10:52:42 +08:00
09d19e3f0f
[feature-wip](array-type) explode support more sub types ( #10673 )
...
1. explode support more sub types;
2. explode support nullable elements;
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com >
2022-07-17 18:08:30 +08:00
cc84cfcc0e
[feature-wip](array-type) add function array_remove ( #10385 )
...
Description:
array_remove function remove all elements in array which is equal to the target.
2022-07-15 17:57:49 +08:00
eb079950cb
[feature-wip] (array-type) add the array_distinct function ( #10388 )
...
* add the array_distinct function
* add the support for decimal and update variable names
* add docs and regression test for array_distinct function
Co-authored-by: hucheng01 <hucheng01@baidu.com >
2022-07-12 17:02:42 +08:00
c9f86bc7e2
[refactor] Refactoring Status static methods to format message using fmt( #9533 )
2022-07-02 18:58:23 +08:00
ec6620ae3e
[feature-wip](array-type) add function arrays_overlap ( #10233 )
2022-06-30 08:12:29 +08:00
ca94867b4e
[Feature-wip] add date v2 type ( #9916 )
2022-06-26 16:07:56 +08:00
89860fd0e3
[opt] delete the redundant parameter of _execute_non_nullable ( #10173 )
...
1. This pr is used to delete the redundant parameter of _execute_non_nullable.
2. This modification will not affect the function "element_at".
2022-06-24 19:22:50 +08:00
0e404edf54
[improvement] Change array offset type from UInt32 to UInt64 ( #10070 )
...
Now column `Array<T>` contains column `offsets` and `data`, and type of column `offsets` is UInt32 now.
If we call array_union to merge arrays repeatedly, the size of array may overflow.
So we need to extend it before `Array Data Type` release.
2022-06-19 10:24:08 +08:00
5e47b03595
[feature-wip](array-type) Add array aggregation functions ( #10108 )
2022-06-17 11:07:49 +08:00
6fab1cbf3c
[feature-wip](array-type) Add array functions size and cardinality ( #9921 )
...
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com >
2022-06-09 15:03:03 +08:00
f377c26bf7
[refactor][be] Optimize headers ( #9708 )
2022-05-30 16:12:10 +08:00
650e3a6ba0
[feature-wip](array-type) array_contains support more nested data types ( #9170 )
...
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com >
2022-05-13 12:42:40 +08:00
4d516bece8
[feature-wip](array-type)Add element_at and subscript functions ( #8597 )
...
Describe the overview of changes.
1. add function element_at;
2. support element_subscript([]) to get element of array, col_array[N] <==> element_at(col_array, N);
3. return error message instead of BE crash while array function execute failed;
element_at(array, index) desc:
> Returns element of array at given **(1-based)** index.
If **index < 0**, accesses elements from the last to the first.
Returns NULL if the index exceeds the length of the array or the array is NULL.
Usage example:
1. create table with ARRAY type column and insert some data:
```
+------+------+--------+
| k1 | k2 | k3 |
+------+------+--------+
| 1 | 2 | [1, 2] |
| 2 | 3 | NULL |
| 4 | NULL | [] |
| 3 | NULL | NULL |
+------+------+--------+
```
2. enable vectorized:
```
set enable_vectorized_engine=true;
```
3. element_subscript([]) usage example:
```
> select k1,k3,k3[1] from array_test;
+------+--------+----------------------------+
| k1 | k3 | %element_extract%(`k3`, 1) |
+------+--------+----------------------------+
| 3 | NULL | NULL |
| 1 | [1, 2] | 1 |
| 2 | NULL | NULL |
| 4 | [] | NULL |
+------+--------+----------------------------+
```
4. element_at function usage example:
```
> select k1,k3 from array_test where element_at(k3, -1) = 2;
+------+--------+
| k1 | k3 |
+------+--------+
| 1 | [1, 2] |
+------+--------+
```
2022-04-02 12:03:56 +08:00
71ce3c4a6e
[feature-wip](array-type) Add codes and UT for array_contains and array_position functions ( #8401 ) ( #8589 )
...
array_contains function Usage example:
1. create table with ARRAY column, and insert some data:
```
> select * from array_test;
+------+------+--------+
| k1 | k2 | k3 |
+------+------+--------+
| 1 | 2 | [1, 2] |
| 2 | 3 | NULL |
| 4 | NULL | [] |
| 3 | NULL | NULL |
+------+------+--------+
```
2. enable vectorized:
```
> set enable_vectorized_engine=true;
```
3. select with array_contains:
```
> select k1,array_contains(k3,1) from array_test;
+------+-------------------------+
| k1 | array_contains(`k3`, 1) |
+------+-------------------------+
| 3 | NULL |
| 1 | 1 |
| 2 | NULL |
| 4 | 0 |
+------+-------------------------+
```
4. also we can use array_contains in where condition
```
> select * from array_test where array_contains(k3,1);
+------+------+--------+
| k1 | k2 | k3 |
+------+------+--------+
| 1 | 2 | [1, 2] |
+------+------+--------+
```
5. array_position usage example
```
> select k1,k3,array_position(k3,2) from array_test;
+------+--------+-------------------------+
| k1 | k3 | array_position(`k3`, 2) |
+------+--------+-------------------------+
| 3 | NULL | NULL |
| 1 | [1, 2] | 2 |
| 2 | NULL | NULL |
| 4 | [] | 0 |
+------+--------+-------------------------+
```
2022-03-22 15:42:40 +08:00