martin-g commented on code in PR #656:
URL: https://github.com/apache/avro-rs/pull/656#discussion_r3950687287


##########
avro/src/schema/mod.rs:
##########
@@ -588,7 +597,16 @@ impl Schema {
             let json = json.as_ref();
             let schema: JsonValue = 
serde_json::from_str(json).map_err(Details::ParseSchemaJson)?;
             if let JsonValue::Object(inner) = &schema {
-                let name = Name::parse(inner, None)?;
+                // Only clone the keys needed for the name parsing, can be a 
significant time/memory

Review Comment:
   ```suggestion
                   // Only clone the values needed for the name parsing, can be 
a significant time/memory
   ```



##########
avro/src/schema/mod.rs:
##########
@@ -546,7 +546,16 @@ impl Schema {
             let json = json.as_ref();
             let schema: JsonValue = 
serde_json::from_str(json).map_err(Details::ParseSchemaJson)?;
             if let JsonValue::Object(inner) = &schema {
-                let name = Name::parse(inner, None)?;
+                // Only clone the keys needed for the name parsing, can be a 
significant time/memory

Review Comment:
   ```suggestion
                   // Only clone the values needed for the name parsing, can be 
a significant time/memory
   ```



##########
avro/src/schema/parser.rs:
##########
@@ -450,15 +438,18 @@ impl Parser {
                 }
                 // In this case, of an unknown logical type, we just pass 
through the underlying
                 // type.
-                _ => {}
+                _ => {
+                    // re-insert unknown logical type
+                    complex.insert(key, Value::String(t));
+                }
             },
             // The spec says to ignore invalid logical types and just pass 
through the
             // underlying type. It is unclear whether that applies to this 
case or not, where the
             // `logicalType` is not a string.
-            Some(value) => return 
Err(Details::GetLogicalTypeFieldType(value.clone()).into()),
+            Some((_, value)) => return 
Err(Details::GetLogicalTypeFieldType(value.clone()).into()),

Review Comment:
   ```suggestion
               Some((_, value)) => return 
Err(Details::GetLogicalTypeFieldType(value).into()),
   ```
   does it need the clone ?!



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