allisonwang-db commented on pull request #32488:
URL: https://github.com/apache/spark/pull/32488#issuecomment-879315179


   Hi @cfmcgrady this check
   
https://github.com/apache/spark/blob/fbf53dee37129a493a4e5d5a007625b35f44fbda/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala#L162
   can fail with the following case
   ```sql
   CREATE TABLE tbl (d decimal(33, 27)) USING PARQUET
   SELECT d FROM tbl WHERE d NOT IN (d + 1)
   ```
   Here `in.list` can be a `CheckOverflow` expression:
   ```
   cast(d#240 as decimal(34,27)) IN 
(CheckOverflow((promote_precision(cast(d#240 as decimal(34,27))) + 
1.000000000000000000000000000), DecimalType(34,27), true))
   ```
   cc @cloud-fan 


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