RedHatInsights / expandjsonsmt

Kafka Connect SMT to expand JSON field
Apache License 2.0
17 stars 18 forks source link

#17ArrayListValidation #18

Open ecararus opened 11 months ago

ecararus commented 11 months ago

Given message contains an array of values the DataType will be inferred based on value if it's in a particular range. This breaks the validation where Data type of array elements are expected to be the same.

To reproduce consider following message {"data": [2146192818, 2146574830, 2147639482]}" Where last value Falls under Int64 range so therefor com.redhat.insights.expandjsonsmt.SchemaParser#getArrayElement throws ""Field is not a homogenous array Int32 x Int64"

Proposed PR is to treat all elements the same dataType if at least one has is in higher range, applicable only for Inte32 and 64 at the moment.