-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](function) fixed some nested type func's param type which is not suitable and make result wrong #44923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
morrySnow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some function return the first arg's type, so just change FollowToAnyDataType to AnyDataType is not ok
|
run buildall |
TPC-H: Total hot run time: 40344 ms |
TPC-DS: Total hot run time: 197342 ms |
ClickBench: Total hot run time: 32.87 s |
...src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayApply.java
Outdated
Show resolved
Hide resolved
|
run buildall |
TPC-H: Total hot run time: 39634 ms |
TPC-DS: Total hot run time: 197439 ms |
ClickBench: Total hot run time: 32.19 s |
|
run cloud_p0 |
|
run cloud_p0 |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
eldenmoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
run buildall |
TPC-H: Total hot run time: 39935 ms |
TPC-DS: Total hot run time: 191048 ms |
ClickBench: Total hot run time: 32.2 s |
|
run compile |
|
run buildall |
TPC-H: Total hot run time: 39785 ms |
TPC-DS: Total hot run time: 196774 ms |
ClickBench: Total hot run time: 32.22 s |
eldenmoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… suitable and make result wrong (#44923) nereids funcs signature for some nested type func's param type defined not right which will make result wrong such as ``` mysql> SELECT array_position([1,258],257),array_position([2],258); +-------------------------------+-------------------------------------------+ | array_position([1, 258], 257) | array_position([2], cast(258 as TINYINT)) | +-------------------------------+-------------------------------------------+ | 0 | 1 | +-------------------------------+-------------------------------------------+ 1 row in set (0.14 sec) mysql> select array_apply([258], '>' , 257), array_apply([1,2,3], '>', 258); +------------------------------+---------------------------------------------------+ | array_apply([258], '>', 257) | array_apply([1, 2, 3], '>', cast(258 as TINYINT)) | +------------------------------+---------------------------------------------------+ | [258] | [3] | +------------------------------+---------------------------------------------------+ 1 row in set (0.11 sec) mysql> select array_contains([258], 257), array_contains([1,2,3], 258); +----------------------------+-------------------------------------------------+ | array_contains([258], 257) | array_contains([1, 2, 3], cast(258 as TINYINT)) | +----------------------------+-------------------------------------------------+ | 0 | 1 | +----------------------------+-------------------------------------------------+ 1 row in set (0.12 sec) mysql> mysql> select array_pushfront([258], 257), array_pushfront([1,2,3], 258); +-----------------------------+--------------------------------------------------+ | array_pushfront([258], 257) | array_pushfront([1, 2, 3], cast(258 as TINYINT)) | +-----------------------------+--------------------------------------------------+ | [257, 258] | [2, 1, 2, 3] | +-----------------------------+--------------------------------------------------+ 1 row in set (0.12 sec) mysql> select array_pushback([1,258], 257), array_pushback([1,2,3], 258); +-------------------------------+-------------------------------------------------+ | array_pushback([1, 258], 257) | array_pushback([1, 2, 3], cast(258 as TINYINT)) | +-------------------------------+-------------------------------------------------+ | [1, 258, 257] | [1, 2, 3, 2] | +-------------------------------+-------------------------------------------------+ 1 row in set (0.10 sec) mysql> select array_remove([1,258], 257), array_remove([1,2,3], 258); +-----------------------------+-----------------------------------------------+ | array_remove([1, 258], 257) | array_remove([1, 2, 3], cast(258 as TINYINT)) | +-----------------------------+-----------------------------------------------+ | [1, 258] | [1, 3] | +-----------------------------+-----------------------------------------------+ 1 row in set (0.12 sec) mysql> select map_contains_key(map(1,258), 257), map_contains_key(map(1,2), 258); +-----------------------------------------------------+---------------------------------------------------+ | map_contains_key(map(1, 258), cast(257 as TINYINT)) | map_contains_key(map(1, 2), cast(258 as TINYINT)) | +-----------------------------------------------------+---------------------------------------------------+ | 1 | 0 | +-----------------------------------------------------+---------------------------------------------------+ 1 row in set (0.12 sec) mysql> select map_contains_key(map(1,258), 257), map_contains_key(map(1,3), 258); +-----------------------------------------------------+---------------------------------------------------+ | map_contains_key(map(1, 258), cast(257 as TINYINT)) | map_contains_key(map(1, 3), cast(258 as TINYINT)) | +-----------------------------------------------------+---------------------------------------------------+ | 1 | 0 | +-----------------------------------------------------+---------------------------------------------------+ 1 row in set (0.11 sec) mysql> select map_contains_key(map(1,258), 257), map_contains_key(map(3,1), 258); +-----------------------------------------------------+---------------------------------------------------+ | map_contains_key(map(1, 258), cast(257 as TINYINT)) | map_contains_key(map(3, 1), cast(258 as TINYINT)) | +-----------------------------------------------------+---------------------------------------------------+ | 1 | 0 | +-----------------------------------------------------+---------------------------------------------------+ ``` but true result is ``` mysql> SELECT array_position([1,258],257),array_position([2],258); +-------------------------------+---------------------------------------------------+ | array_position([1, 258], 257) | array_position(cast([2] as ARRAY<SMALLINT>), 258) | +-------------------------------+---------------------------------------------------+ | 0 | 0 | +-------------------------------+---------------------------------------------------+ 1 row in set (0.73 sec) mysql> select array_apply([258], '>' , 257), array_apply([1,2,3], '>', 258); +------------------------------+-----------------------------------------------------------+ | array_apply([258], '>', 257) | array_apply(cast([1, 2, 3] as ARRAY<SMALLINT>), '>', 258) | +------------------------------+-----------------------------------------------------------+ | [258] | [] | +------------------------------+-----------------------------------------------------------+ 1 row in set (0.10 sec) mysql> select array_contains([258], 257), array_contains([1,2,3], 258); +----------------------------+---------------------------------------------------------+ | array_contains([258], 257) | array_contains(cast([1, 2, 3] as ARRAY<SMALLINT>), 258) | +----------------------------+---------------------------------------------------------+ | 0 | 0 | +----------------------------+---------------------------------------------------------+ 1 row in set (0.09 sec) mysql> select array_pushfront([258], 257), array_pushfront([1,2,3], 258); +-----------------------------+----------------------------------------------------------+ | array_pushfront([258], 257) | array_pushfront(cast([1, 2, 3] as ARRAY<SMALLINT>), 258) | +-----------------------------+----------------------------------------------------------+ | [257, 258] | [258, 1, 2, 3] | +-----------------------------+----------------------------------------------------------+ 1 row in set (0.11 sec) mysql> select array_remove([1,258], 257), array_remove([1,2,3], 258); +-----------------------------+-------------------------------------------------------+ | array_remove([1, 258], 257) | array_remove(cast([1, 2, 3] as ARRAY<SMALLINT>), 258) | +-----------------------------+-------------------------------------------------------+ | [1, 258] | [1, 2, 3] | +-----------------------------+-------------------------------------------------------+ 1 row in set (0.09 sec) mysql> select countequal([1,258], 257), array_count_equal([1,2,3], 258); ERROR 1105 (HY000): errCode = 2, detailMessage = Can not found function 'array_count_equal' mysql> select countequal([1,258], 257), countequal([1,2,3], 258); +---------------------------+-----------------------------------------------------+ | countequal([1, 258], 257) | countequal(cast([1, 2, 3] as ARRAY<SMALLINT>), 258) | +---------------------------+-----------------------------------------------------+ | 0 | 0 | +---------------------------+-----------------------------------------------------+ 1 row in set (0.08 sec) mysql> select map_contains_key(map(1,258), 257), map_contains_key(map(2,1), 258); +--------------------------------------------------------------------+-----------------------------------------------------------------+ | map_contains_key(cast(map(1, 258) as MAP<SMALLINT,SMALLINT>), 257) | map_contains_key(cast(map(2, 1) as MAP<SMALLINT,TINYINT>), 258) | +--------------------------------------------------------------------+-----------------------------------------------------------------+ | 0 | 0 | +--------------------------------------------------------------------+-----------------------------------------------------------------+ 1 row in set (0.09 sec) mysql> select map_contains_value(map(1,1), 257), map_contains_value(map(1,2), 258); +-------------------------------------------------------------------+-------------------------------------------------------------------+ | map_contains_value(cast(map(1, 1) as MAP<TINYINT,SMALLINT>), 257) | map_contains_value(cast(map(1, 2) as MAP<TINYINT,SMALLINT>), 258) | +-------------------------------------------------------------------+-------------------------------------------------------------------+ | 0 | 0 | +-------------------------------------------------- ```
What problem does this PR solve?
nereids funcs signature for some nested type func's param type defined not right which will make result wrong such as
but true result is
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)