arthuryangcs opened a new issue #8111: URL: https://github.com/apache/incubator-doris/issues/8111
### 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 trunk ### What's Wrong? Create the table: ``` CREATE TABLE test.result_exprs ( `aid` int(11) NULL, `bid` int(11) NULL ) ENGINE=OLAP DUPLICATE KEY(`aid`) COMMENT "OLAP" DISTRIBUTED BY HASH(`aid`) BUCKETS 7 PROPERTIES ( "replication_num" = "1", "in_memory" = "false", "business_key_column_name" = "", "storage_medium" = "HDD", "storage_format" = "V2" ); ``` insert into data: ``` INSERT INTO result_exprs SELECT a.aid, b.bid FROM (SELECT 3 AS aid)a RIGHT JOIN (SELECT 4 AS bid)b ON (a.aid=b.bid); ``` and then query the result: ``` select * from result_exprs; ``` the result is:  ### What You Expected?  ### How to Reproduce? As shown above. ### Anything Else? I think the insert plan is wrong, It uses 3 instand of the right exprs.  Maybe this is right:  When Doris generates resultExprs in InsertStmt, I think using `queryStmt.getResultExprs()` is more resonable than `queryStmt.getBaseTblResultExprs()`. ### Are you willing to submit PR? - [X] 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 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