Commit Graph

2471 Commits

Author SHA1 Message Date
92cad69fc4 [Fix](parquet-reader) Fix reading fixed length byte array decimal in parquet reader. (#30535) 2024-01-31 23:53:40 +08:00
77b366fc4b [fix](join) incorrect result of mark join (#30543)
incorrect result of mark join
2024-01-31 23:53:40 +08:00
8aaae4c873 [fix](Nereids) div priority is not right (#30575) 2024-01-31 23:53:40 +08:00
Pxl
bf582cd5d3 [Chore](case) reset all variables at start on set_and_unset_variable case (#30580)
reset all variables at start on set_and_unset_variable case
2024-01-31 23:53:39 +08:00
19f57b544e support cosh math function (#30602)
Co-authored-by: Rohit Satardekar <rohitrs1983@gmail.com>
2024-01-31 23:53:39 +08:00
e6fbccd3ed [Feature](Variant) support row store for variant type (#30052) 2024-01-31 23:53:39 +08:00
8b61b7c6cd [exec](function) Add tanh func (#30555) 2024-01-31 23:53:39 +08:00
7d037c12bf [bugfix](paimon)fix paimon testcases (#30514)
1. set default timezone
2. not supported `char` type to pushdown
2024-01-31 23:53:39 +08:00
221308f78a [fix](datatype) fix bugs for IPv4/v6 datatype and add some basic regression test cases (#30261) 2024-01-31 23:53:39 +08:00
12827ceb16 [fix](Nereids): fix wrong regression test (#30520) 2024-01-30 15:33:40 +08:00
4648902350 [bugfix](iceberg)fix read NULL with date partition (#30478)
* fix date

* fix date

* add case
2024-01-30 15:32:43 +08:00
5731ed7aad [fix](Nereids): add order by when testing pkfk to avoid unstable res #30507 2024-01-30 15:32:42 +08:00
b712f0b810 [improvement](index)add index_id column in show index stmt (#30431) 2024-01-30 15:32:42 +08:00
009bca9652 [regression test](broker load) add partition load case (#28259) 2024-01-30 15:30:39 +08:00
5f20d7c5d0 [regression test](stream load) test for enable_profile (#28534) 2024-01-30 15:30:39 +08:00
57a8c75ddc [regression test](schema change) add case for column type change (#30472) 2024-01-30 15:30:39 +08:00
f7e01ceffa [bug](node) add dependency for set operation node (#30203)
These sinks must be completed one by one in order, eg: child(1) must wait child(0) build finish
2024-01-30 15:30:39 +08:00
f17d29090e [feat](Nereids): drop foreign key after dropping primary key that is referenced by the foreign key (#30417) 2024-01-29 19:03:48 +08:00
0f81d2d533 [FIX](complextype)fix complex type nested version type but not hide version (#30419) 2024-01-29 19:03:47 +08:00
dce6c8bd65 [Improvement](Nereids) Support aggregate rewrite by materialized view with complex expression (#30440)
materialized view definition is

>            select
>            sum(o_totalprice) as sum_total,
>            max(o_totalprice) as max_total,
>            min(o_totalprice) as min_total,
>           count(*) as count_all,
>            bitmap_union(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (1, 3) then o_custkey else null end)) >cnt_1,
>            bitmap_union(to_bitmap(case when o_shippriority > 2 and o_orderkey IN (2) then o_custkey else null end)) as >cnt_2
>            from lineitem
>            left join orders on l_orderkey = o_orderkey and l_shipdate = o_orderdate;
   

the query following can be rewritten by materialized view above.
it use the aggregate fuction arithmetic calculation in the select 

>            select
>            count(distinct case when O_SHIPPRIORITY > 2 and o_orderkey IN (2) then o_custkey else null end) as cnt_2,
>            (sum(o_totalprice) + min(o_totalprice)) * count(*),
>            min(o_totalprice) + count(distinct case when O_SHIPPRIORITY > 2 and o_orderkey IN (2) then o_custkey else null >end)
>            from lineitem
>            left join orders on l_orderkey = o_orderkey and l_shipdate = o_orderdate;
2024-01-29 19:03:47 +08:00
3b85e3de1b [fix](planner)avg function may use wrong decimal precision and scale (#30364) 2024-01-29 19:03:47 +08:00
779a9a1fbb [opt](planner) use string for varchar in ctas if original table is not olap (#30323) 2024-01-29 19:03:47 +08:00
930e3bb701 [feature](Nereids): double eager support mix function (#30468) 2024-01-29 19:03:47 +08:00
ae38f28280 [feature](invert index) does not create an inverted index to support the match_phrase_prefix feature. (#30414) 2024-01-29 19:02:46 +08:00
7667fe8570 [Improve)(Variant) do not allow fall back to legacy planner (#30430) 2024-01-29 19:02:46 +08:00
658c869aac [improvement](mtmv)mtmv support partition by hms table (#29989) 2024-01-29 19:02:46 +08:00
7e19224a6c [fix](function) fix ipv4 funcs get failed error, improve an ipv6 func and exception message (#30269) 2024-01-28 18:25:31 +08:00
5986d5415e [opt](Nereids) make runtime filter target support expression (#30131)
the target expression should be:
1. only one numeric slot, or
2. cast for any data type

example:
select * from T1 join T2 on abs(T1.a) = T2.a
RF T2.a->abs(T1.a)
2024-01-27 10:07:10 +08:00
04237f60e0 [feature](Nereids): eager aggreagate support mix agg function (#30400) 2024-01-27 09:11:02 +08:00
713798d549 [feature](nereids)support mark join (#30133)
Co-authored-by: Jerry Hu <mrhhsg@gmail.com>
2024-01-27 09:09:53 +08:00
f25af15842 [Fix](Nereids) Fix lost predicate when query has a filter at the right input of the outer join (#30374)
materialized view def is as following:
>        select l_shipdate, o_orderdate, l_partkey, l_suppkey, o_orderkey  
>        from lineitem 
>        left join (select * from orders where o_orderdate = '2023-12-10' ) t2 
>        on lineitem.l_orderkey = t2.o_orderkey;
    
the query as following, should add filter `o_orderdate = '2023-12-10'` on mv when query rewrite by materialized view
>        select l_shipdate, o_orderdate, l_partkey, l_suppkey, o_orderkey 
>         from lineitem 
>         left join orders 
>        on lineitem.l_orderkey = orders.o_orderkey 
>         where o_orderdate = '2023-12-10' order by 1, 2, 3, 4, 5;
2024-01-27 09:09:02 +08:00
5e4674ab66 [fix](partial update) mishandling of exceptions in the publish phase may result in data loss (#30366) 2024-01-27 09:09:02 +08:00
8543167195 [Nereids](Variant) Implement variant type and support new sub column access method (#30348)
* [Nereids](Variant) Implement variant type in Variant and support new sub column access method

The query SELECT v["a"]["b"] from simple_var WHERE cast(v["a"]["b"] as int) = 1

1. During the binding stage, the expression element_at(var, "xxx") is transformed into a SlotReference with a specified path. This conversion is tracked in the StatementContext, where the parent slot is the primary key and the paths are secondary keys. This structure, known as subColumnSlotRefMap in the StatementContext, helps to eliminate duplicates of the same slot derived from identical paths.

2. A new rule, BindSlotWithPaths, is introduced in the analysis stage. This rule is responsible for converting slots with paths into their respective slot suppliers. To ensure that slots with paths are correctly associated with the appropriate LogicalOlapScan, an additional mapping, slotToRelation, is added to the StatementContext. This mapping links the top-level slot to its corresponding relation (i.e., LogicalOlapScan). Consequently, subsequent slots with paths can determine the correct LogicalOlapScan to merge with and modify accordingly.
2024-01-27 09:09:02 +08:00
9aaa6ba351 [Fix](Variant) fix variant lost null info after cast_column (#30153)
This could result incorrect output in hirachinal cases

```
 sql """insert into ${table_name} values (-3, '{"a" : 1, "b" : 1.5, "c" : [1, 2, 3]}')"""
    sql """insert into  ${table_name} select -2, '{"a": 11245, "b" : [123, {"xx" : 1}], "c" : {"c" : 456, "d" : "null", "e" : 7.111}}'  as json_str
            union  all select -1, '{"a": 1123}' as json_str union all select *, '{"a" : 1234, "xxxx" : "kaana"}' as json_str from numbers("number" = "4096") limit 4096 ;"""

mysql> select v["c"] from var_rs where k = -3 or k = -2;
+----------------------+
| element_at(`v`, 'c') |
+----------------------+
| [1,2,3]              |
| []                   |
+----------------------+
2 rows in set (0.04 sec)
```
2024-01-27 09:08:29 +08:00
a954bab81a [fix](function) fix error result in time_to_sec and timediff (#30248) 2024-01-27 09:08:29 +08:00
6f8c133a37 [chore] Remove unused test_show_create_catalog.out (#30290) 2024-01-27 09:07:13 +08:00
2ecc6ed0d4 [opt](inverted index)Add RAM directory null cases (#30353) 2024-01-25 21:37:33 +08:00
01c394acc2 [fix](inverted index)support merge null_bitmap during index compaction (#30326)
`null_bitmap` file is not considered in index compaction process. This will lead wrong query result when doc is contain `NULL` values.
2024-01-25 13:24:52 +08:00
Pxl
5b462194d1 [Feature](materialized-view) support rewrite case when to if on legacy planner to make mv work (#30320)
support rewrite case when to if on legacy planner to make mv work
2024-01-25 13:24:52 +08:00
bee6ae73c7 [minor](Nereids): enable PushDownTopNDistinctThroughJoin (#30275) 2024-01-25 13:24:52 +08:00
86d7a8be44 [improvement](statistics nereids)Nereids support select mv. (#30267) 2024-01-25 13:24:09 +08:00
83ea486b15 [fix](Nereids): Except just can merge with left deep shape (#30270) 2024-01-25 13:24:09 +08:00
Pxl
7e60369ba2 [Feature](materialized-view) support create mv with count(*) (#30313)
support create mv with count(*)
2024-01-25 13:24:09 +08:00
101b2593fc [regression test](schema change) add case for tinyint/smallint/int/bigint/float/double type in agg (#30193) 2024-01-25 13:24:09 +08:00
df504df475 [regression test](schema change) add case for partition (#30195) 2024-01-25 13:24:09 +08:00
ca5a314765 [fix](function) make STRLEFT and STRRIGHT and SUBSTR function DEPEND_ON_ARGUMENT (#28352)
make STRLEFT and STRRIGHT function DEPEND_ON_ARGUMENT
2024-01-25 13:23:59 +08:00
2f68aac885 [Improvement](Nereids) Support to query rewrite by materialized view when join input has aggregate (#30230)
Support to query rewrite by materialized view when join input has aggregate, the aggregate should be simple
For example as following:
The materialized view def is 
>            select
>              l_linenumber,
>              count(distinct l_orderkey),
>              sum(case when l_orderkey in (1,2,3) then l_suppkey * l_linenumber else 0 end),
>              max(case when l_orderkey in (4, 5) then (l_quantity *2 + part_supp_a.qty_max) * 0.88 else 100 end),
>              avg(case when l_partkey in (2, 3, 4) then l_discount + o_totalprice + part_supp_a.qty_sum else 50 end)
>            from lineitem
>            left join orders on l_orderkey = o_orderkey
>            left join 
>              (select ps_partkey, ps_suppkey, sum(ps_availqty) qty_sum, max(ps_availqty) qty_max,
>                min(ps_availqty) qty_min,
>                avg(ps_supplycost) cost_avg
>                from partsupp
>                group by ps_partkey,ps_suppkey) part_supp_a
>              on l_partkey = part_supp_a.ps_partkey
>                and l_suppkey = part_supp_a.ps_suppkey
>            group by l_linenumber;

when query is like following, it can be rewritten by mv above
>            select
>              l_linenumber,
>              sum(case when l_orderkey in (1,2,3) then l_suppkey * l_linenumber else 0 end),
>              avg(case when l_partkey in (2, 3, 4) then l_discount + o_totalprice + part_supp_a.qty_sum else 50 end)
>            from lineitem
>            left join orders on l_orderkey = o_orderkey
>            left join 
>              (select ps_partkey, ps_suppkey, sum(ps_availqty) qty_sum, max(ps_availqty) qty_max,
>                min(ps_availqty) qty_min,
>                avg(ps_supplycost) cost_avg
>                from partsupp
>                group by ps_partkey,ps_suppkey) part_supp_a
>              on l_partkey = part_supp_a.ps_partkey
>                and l_suppkey = part_supp_a.ps_suppkey
>            group by l_linenumber;
2024-01-25 13:23:59 +08:00
f85b04c2c6 [fix](datatype) fixed decimal type implicit cast handling in BinaryPredicate (#30181) 2024-01-25 13:23:12 +08:00
c7360fd014 [feature](function) support ip function named ipv4_cidr_to_range(addr, cidr) (#29819)
* support ip function ipv4_cidr_to_range

* fix ipv4_cidr_to_range function only support ipv4 type
2024-01-24 10:02:03 +08:00
1b9f1f6483 [feature](Planner): Push down TopNDistinct through Join (#30216)
Push down TopNDistinct through Outer/Cross Join
2024-01-24 09:59:13 +08:00