Yulei-Yang opened a new issue, #14128:
URL: https://github.com/apache/doris/issues/14128

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   1.1.3-rc02
   
   ### What's Wrong?
   
   when using json_object in CTAS stmt, you will get wrong result
   
   ### What You Expected?
   
   fix it
   
   ### How to Reproduce?
   
   CREATE TABLE `t1` (
     `c1` varchar(10) NULL,
     `v1` DECIMAL(18,6) NULL COMMENT "",
     `v2` DECIMAL(18,6) NULL COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`c1`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`c1`) BUCKETS 10
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 3",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   
   insert into t1 (c1, v1, v2) values ('r1', 1.1, 1.2),('r2', 2.1, 2.2);
   create table t3 as select c1, json_object('title', 'Amount', 'value', v1) 
from t1;
   
   mysql> select * from t3;
   +------+----------------+
   | c1   | _col0          |
   +------+----------------+
   | r1   | {"title":null} |
   | r2   | {"title":null} |
   +------+----------------+
   
   while only use json_object in select stmt is ok:
   mysql> select c1, json_object('title', 'Amount', 'value', v1) from t1;
   +------+-----------------------------------------------+
   | c1   | json_object('title', 'Amount', 'value', `v1`) |
   +------+-----------------------------------------------+
   | r1   | {"title":"Amount","value":1.1}                |
   | r2   | {"title":"Amount","value":2.1}                |
   +------+-----------------------------------------------+
   
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to