Skip to content
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

branch-2.1: [Bug](function)fix json_object function check null nums error as return bool #44321 #44381

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Cherry-picked from #44321

…rn bool (#44321)

### What problem does this PR solve?

Related PR: #https://github.com/apache/doris/pull/34591/files

Problem Summary:
before the SQL report error, as it error change the simd::count_zero_num
function return value static as bool,
so it run into the if check of (not_null_num < size).
but actual it's maybe return int type.


now:
```
mysql [(none)]>select json_object ( CONCAT('k',t.number%30926%3000 + 0),CONCAT('k',t.number%30926%3000 + 0,t.number%1000000) ) from numbers("number" = "2") t order by 1;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| json_object(concat('k', cast((((number % 30926) % 3000) + 0) as VARCHAR(65533))), concat('k', cast((((number % 30926) % 3000) + 0) as VARCHAR(65533)), cast((number % 1000000) as VARCHAR(65533))), '66') |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {"k0":"k00"}                                                                                                                                                                                              |
| {"k1":"k11"}                                                                                                                                                                                              |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.04 sec)
```


before:
```
mysql [(none)]>select json_object
    -> (
    -> CONCAT('k',t.number%30926%3000 + 0),CONCAT('k',t.number%30926%3000 + 0,t.number%1000000)
    -> )
    -> from numbers("number" = "2") t;
ERROR 1105 (HY000): errCode = 2, detailMessage = (10.16.10.8)[INTERNAL_ERROR]function json_object can not input null value , JSON documents may not contain NULL member names.
mysql [(none)]>

```
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Nov 21, 2024
@doris-robot
Copy link

run buildall

Copy link
Contributor Author

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.46% (9521/26113)
Line Coverage: 27.93% (78322/280433)
Region Coverage: 26.59% (40180/151096)
Branch Coverage: 23.40% (20406/87220)
Coverage Report: http://coverage.selectdb-in.cc/coverage/43cf6d45f3b8fe464f5afb0289a74bccb3cd5e0f_43cf6d45f3b8fe464f5afb0289a74bccb3cd5e0f/report/index.html

@yiguolei yiguolei merged commit 92a0919 into branch-2.1 Nov 22, 2024
20 of 22 checks passed
@github-actions github-actions bot deleted the auto-pick-44321-branch-2.1 branch November 22, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants