Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detail to avro exception message #1505

Merged
merged 2 commits into from
Jun 28, 2016

Conversation

moradology
Copy link
Contributor

This PR adds a little bit of information necessary to properly understand why the Avro decoding process fails in some circumstances and is a response to #1477

The new error looks something like:

org.apache.avro.AvroTypeException: Found geotrellis.raster.ByteArrayTile, expecting geotrellis.raster.ArrayMultibandTile, missing required field bands. If attempting to read multiband tiles, use a Reader[K, MultibandTile] rather than Reader[K, Tile]

@moradology moradology changed the title Add detail to avro exception message Add detail to avro exception message [WIP] Jun 2, 2016
@lossyrob
Copy link
Member

@moradology what is going on with this PR?

@moradology moradology changed the title Add detail to avro exception message [WIP] Add detail to avro exception message Jun 22, 2016
@moradology
Copy link
Contributor Author

I investigated a few paths one might take to address this issue and ended up deciding the best path at this point is also the simplest. It seems as though we might want to consider parameterizing the names of generic avro codecs - this would give us a greater capacity to intelligently handle certain errors and to provide useful information in the case of failure.

For instance, the name here (https://github.com/geotrellis/geotrellis/blob/master/spark/src/main/scala/geotrellis/spark/io/avro/codecs/KeyValueRecordCodec.scala#L13) could be parameterized on the names of the underlying Key and Value codecs

Here's an example of the exception thrown after applying this PR: org.apache.avro.AvroTypeException: Found geotrellis.raster.ByteArrayTile, expecting geotrellis.raster.ArrayMultibandTile, missing required field bands. Check to ensure that the proper type parameters for this Reader have been provided.

@lossyrob lossyrob merged commit 4a80fb9 into locationtech:master Jun 28, 2016
@lossyrob lossyrob added this to the 1.0 milestone Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants