amorynan opened a new pull request, #44923: URL: https://github.com/apache/doris/pull/44923
### 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 ``` 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 | +-------------------------------------------------- ``` Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org