Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.4.0
-
None
Description
StructType.findNestedField is unable to reach nested fields below two directly nested maps or arrays. Whenever it reaches a map or an array, it'll throw an `invalidFieldName` exception if the child is not a struct.
The following throws 'Field name `a`.`element`.element`.`i` is invalid: `a`.`element`.`element` is not a struct.', even though the access path is valid:
val schema = new StructType() .add("a", ArrayType(ArrayType( new StructType().add("i", "int")))) findNestedField(Seq("a", "element", "element", "i"), schema)