kite-sdk / kite

Kite SDK
http://kitesdk.org/docs/current/
Apache License 2.0
394 stars 263 forks source link

extractAvroPaths does not traverses arrays with the '[]' notation when array is part of a union #435

Closed SOLID-Design closed 8 years ago

SOLID-Design commented 8 years ago

When avro schema contains an array within a union then the '[]' operator does not traverses the array.

Given schema: { "namespace": "org.kitesdk.morphline.avro", "type": "record", "name": "ArrayInUnionTestRecord", "fields": [ {"name": "items", "type": {"type": "array", "items": "string"}}, {"name": "itemsInUnion", "type": ["null", {"type": "array", "items":"string"}], "default": null} ] }

and configuration extractAvroPaths { paths : { "/items[]" : "/items[]" "/itemsInUnion[]" : "/itemsInUnion[]" } }

/items[] is properly extracted but /itemsInUnion[] is not.

whoschek commented 8 years ago

Thanks for the contribution! I committed a fix that pinpoints the issue a bit more precisely, here: https://github.com/kite-sdk/kite/commit/50781c4ddca9763304119185d6caf86f6b1f6ef1