@@ -174,14 +174,11 @@ fn fields_mismatch(schema: &[Arc<Field>], body: &Value, schema_version: SchemaVe
174
174
fn valid_type ( data_type : & DataType , value : & Value , schema_version : SchemaVersion ) -> bool {
175
175
match data_type {
176
176
DataType :: Boolean => value. is_boolean ( ) ,
177
- DataType :: Int8 | DataType :: Int16 | DataType :: Int32 | DataType :: Int64 => value. is_i64 ( ) ,
177
+ DataType :: Int8 | DataType :: Int16 | DataType :: Int32 => value. is_i64 ( ) ,
178
178
DataType :: UInt8 | DataType :: UInt16 | DataType :: UInt32 | DataType :: UInt64 => value. is_u64 ( ) ,
179
- DataType :: Float16 | DataType :: Float32 => value. is_f64 ( ) ,
179
+ DataType :: Float16 | DataType :: Float32 | DataType :: Float64 => value. is_f64 ( ) ,
180
180
// All numbers can be cast as Float64 from schema version v1
181
- DataType :: Float64 if schema_version == SchemaVersion :: V1 => {
182
- value. is_number ( ) || is_parsable_as_number ( value)
183
- }
184
- DataType :: Float64 if schema_version != SchemaVersion :: V1 => value. is_f64 ( ) ,
181
+ DataType :: Int64 => value. is_i64 ( ) || is_parsable_as_number ( value) ,
185
182
DataType :: Utf8 => value. is_string ( ) ,
186
183
DataType :: List ( field) => {
187
184
let data_type = field. data_type ( ) ;
@@ -232,5 +229,5 @@ pub fn is_parsable_as_number(value: &Value) -> bool {
232
229
let Value :: String ( s) = value else {
233
230
return false ;
234
231
} ;
235
- s. parse :: < f64 > ( ) . is_ok ( )
232
+ s. parse :: < i64 > ( ) . is_ok ( )
236
233
}
0 commit comments