see-you-at-Zihuatanejo opened a new issue, #23749:
URL: https://github.com/apache/doris/issues/23749

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   1.2.4
   
   ### What's Wrong?
   
   When using the JSONB data type, if there are integers less than -128 in the 
JSON data, the stored data is incorrect (it seems like an overflow?). However, 
if it is a floating-point number or a positive integer, it will not occur.
   使用JSONB数据类型时,若JSON数据中出现小于-128的整数,则保存的数据错误(感觉像是溢出了?)假如是浮点数、正整数则不会
   ```sql
   CREATE TABLE test2.test_json (
     id INT,
     name JSONB
   )
   DUPLICATE KEY(id)
   DISTRIBUTED BY HASH(id) BUCKETS 1
   PROPERTIES (
        "replication_allocation" = "tag.location.default: 1"
   );
   
   INSERT INTO test2.test_json (id, name)
   VALUES
        (0, '{"value":-129}'),
        (1, '{"value":-129.0}'),
        (2, '{"value":-128}'),
        (3, '{"value":0}'),
        (4, '{"value":200}');
   
   SELECT * FROM test2.test_json
   ORDER BY id;
   ```
   
![2023-09-01_14-57-11](https://github.com/apache/doris/assets/74521242/2e72642d-d695-4a65-bef3-71a8310c09a4)
   
   
   ### What You Expected?
   
   When using the JSONB data type, the data is stored correctly when saving 
negative integers.
   使用JSONB数据类型时,保存负整数时,保存的数据是正确的
   
   ### How to Reproduce?
   
   ```sql
   CREATE TABLE test2.test_json (
     id INT,
     name JSONB
   )
   DUPLICATE KEY(id)
   DISTRIBUTED BY HASH(id) BUCKETS 1
   PROPERTIES (
        "replication_allocation" = "tag.location.default: 1"
   );
   
   INSERT INTO test2.test_json (id, name)
   VALUES
        (0, '{"value":-129}'),
        (1, '{"value":-129.0}'),
        (2, '{"value":-128}'),
        (3, '{"value":0}'),
        (4, '{"value":200}');
        
   
   SELECT * FROM test2.test_json
   ORDER BY id;
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.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

Reply via email to