BinTaoMa opened a new issue, #11919:
URL: https://github.com/apache/seatunnel/issues/11919

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   ### Description
   Issue #11804 reported a ClassCastException when the RANGE rule of the 
DataValidator
   transform validates a DECIMAL field. It was fixed by PR #11855, but that fix 
only
   covers DECIMAL fields with numeric bounds.
   
   The same ClassCastException still occurs in these normal scenarios:
   1. BIGINT field (Long value) + integer bounds -> java.lang.Integer cannot be 
cast to java.lang.Long
   2. DOUBLE/FLOAT field + integer bounds -> java.lang.Integer cannot be cast 
to java.lang.Double
   3. Field value is NaN / +/-Infinity + integer bounds -> same crash
   
   ### SeaTunnel Version
   
   2.3.13 (also reproducible on the dev branch)
   
   ### SeaTunnel Config
   
   ```conf
   ### Config (reproduction)
   transform {
     DataValidator {
       plugin_input = "Jdbc"
       plugin_output = "DataValidator"
       field_rules = [
         { field_name = "quantity"
           rules = [ { rule_type = "RANGE", min_value = 0, max_value = 1000 } ] 
}
       ]
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   bin/seatunnel.sh --config config/job.conf -e local
   ```
   
   ### Error Exception
   
   ```log
   java.lang.ClassCastException: class java.lang.Integer cannot be cast to 
class java.lang.Long
       at java.lang.Long.compareTo(Long.java:...)
       at 
org.apache.seatunnel.transform.validator.rule.RangeValidationRule.validate(...)
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to