[fix](function) fixed some nested type func's param type which is not suitable and make result wrong#44923
Merged
eldenmoon merged 6 commits intoapache:masterfrom Dec 11, 2024
Merged
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
morrySnow
reviewed
Dec 3, 2024
Contributor
morrySnow
left a comment
There was a problem hiding this comment.
some function return the first arg's type, so just change FollowToAnyDataType to AnyDataType is not ok
Contributor
Author
|
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 |
morrySnow
reviewed
Dec 4, 2024
...src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
Outdated
Show resolved
Hide resolved
morrySnow
reviewed
Dec 4, 2024
...re/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayApply.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
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 |
Contributor
Author
|
run cloud_p0 |
Contributor
Author
|
run cloud_p0 |
morrySnow
approved these changes
Dec 9, 2024
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
Author
|
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 |
Contributor
Author
|
run compile |
Contributor
Author
|
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 |
github-actions bot
pushed a commit
that referenced
this pull request
Dec 11, 2024
… 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 | +-------------------------------------------------- ```
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)