Skip to content

[Bug][Transform-V2][DataValidator] ClassCastException still occurs for BIGINT/FLOAT/DOUBLE fields and non-finite values (follow-up of #11804/#11855) #11919

Closed

Description

@BinTaoMa

Search before asking

  • I had searched in the issues 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

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

bin/seatunnel.sh --config config/job.conf -e local

Error Exception

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions