LiBinfeng-01 opened a new pull request, #38961: URL: https://github.com/apache/doris/pull/38961
cherry-pick: 38493 1. fold child when const expr not folded 2. do not fold function `sleep` 3. move all exceptional expression into shouldSkipFold before ```sql mysql [test]>explain select sleep(sign(1)*100); +-----------------------------------------------+ | Explain String(Nereids Planner) | +-----------------------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | sleep(cast((sign(1.0) * 100) as INT))[#0] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 0:VUNION(32) | | constant exprs: | | sleep(CAST((sign(1) * 100) AS int)) | +-----------------------------------------------+ 13 rows in set (15.02 sec) mysql [test]>select sleep(sign(1)*100); +-----------------------------------------------------+ | sleep(cast((sign(cast(1 as DOUBLE)) * 100) as INT)) | +-----------------------------------------------------+ | 1 | +-----------------------------------------------------+ 1 row in set (1 min 55.34 sec) ``` after ```sql mysql [test]>explain select sleep(sign(1)*100); +---------------------------------+ | Explain String(Nereids Planner) | +---------------------------------+ | PLAN FRAGMENT 0 | | OUTPUT EXPRS: | | sleep(100)[#0] | | PARTITION: UNPARTITIONED | | | | HAS_COLO_PLAN_NODE: false | | | | VRESULT SINK | | MYSQL_PROTOCAL | | | | 0:VUNION(32) | | constant exprs: | | sleep(100) | +---------------------------------+ 13 rows in set (0.23 sec) mysql [test]> select sleep(sign(1)*100); +-----------------------------------------------------+ | sleep(cast((sign(cast(1 as DOUBLE)) * 100) as INT)) | +-----------------------------------------------------+ | 1 | +-----------------------------------------------------+ 1 row in set (1 min 40.37 sec) ``` ## Proposed changes Issue Number: close #xxx <!--Describe your changes.--> -- 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