boneanxs commented on issue #6412:
URL: https://github.com/apache/hudi/issues/6412#issuecomment-1219205294

   @bithw1 This is caused by different cast result from spark, for 
`BinaryOperator`, spark cast left side to the right side type. you can easily 
see the plan details using `explain`.
   
   ```scala
   spark-sql> explain select "20220816000000" > 20220817073931;
   == Physical Plan ==
   *(1) Project [false AS (CAST(20220816000000 AS BIGINT) > 20220817073931)#7]
   +- *(1) Scan OneRowRelation[]
   
   Time taken: 0.102 seconds, Fetched 1 row(s)
   ```
   
   ```scala
   spark-sql> explain select "20220816000000" > 0;
   == Physical Plan ==
   *(1) Project [null AS (CAST(20220816000000 AS INT) > 0)#13]
   +- *(1) Scan OneRowRelation[]
   
   
   Time taken: 0.034 seconds, Fetched 1 row(s)
   ```
   As casting "20220816000000" to Int gets null value, whereas the compare 
result is null, so you can not get the desired result
   


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

Reply via email to