RunyaoChen commented on PR #39855:
URL: https://github.com/apache/spark/pull/39855#issuecomment-1414156378

   > For my own understanding: it seems that CheckOverflowInTableInsert 
previously assumed a Cast as child (and after 
[SPARK-41991](https://issues.apache.org/jira/browse/SPARK-41991), assumed 
either a Cast or one wrapped by an ExpressionProxy ), but rules like 
PushFoldableIntoBranches make that assumption too rigid, correct?
   
   Yes, rules like `PushFoldableIntoBranches` push the `Cast` down to each 
branch of `CaseWhen`, and what `checkChild` sees is a `CaseWhen` expr with 
`Cast` in each branch (in this case, it sees `CASE WHEN (x#4 = 1) THEN cast(-1 
as decimal(9,0)) ELSE cast((0 - x#4) as decimal(9,0)) END`). 
   
   


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