scovich commented on code in PR #9012:
URL: https://github.com/apache/arrow-rs/pull/9012#discussion_r2636415342


##########
parquet-variant/src/path.rs:
##########
@@ -112,11 +114,7 @@ impl<'a> From<Vec<VariantPathElement<'a>>> for 
VariantPath<'a> {
 /// Create from &str with support for dot notation
 impl<'a> From<&'a str> for VariantPath<'a> {
     fn from(path: &'a str) -> Self {
-        if path.is_empty() {
-            VariantPath::new(vec![])
-        } else {
-            VariantPath::new(path.split('.').map(Into::into).collect())
-        }
+        VariantPath::new(path.split(".").flat_map(parse_path).collect())

Review Comment:
   Now that you mention, it seems like the existing code already had that bug? 
   
   In theory, that should be a malformed path that causes an error. Ditto for 
mismatched `[` or `]`, or e.g. `[a.b]` (which this PR would incorrectly attempt 
to treat as `[a` and `b]`).
   
   It seems like we'll need a more sophisticated (and integrated) parsing 
approach here?



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