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

Projects
None yet
2 participants
@moradology
Contributor

moradology commented Jun 1, 2016

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 from Add detail to avro exception message to Add detail to avro exception message [WIP] Jun 2, 2016

@lossyrob

This comment has been minimized.

Member

lossyrob commented Jun 20, 2016

@moradology what is going on with this PR?

@moradology moradology force-pushed the moradology:fix/avro-type-error-detail branch from 69841b4 to faa831d Jun 22, 2016

@moradology moradology changed the title from Add detail to avro exception message [WIP] to Add detail to avro exception message Jun 22, 2016

@moradology

This comment has been minimized.

Contributor

moradology commented Jun 22, 2016

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.

@moradology moradology force-pushed the moradology:fix/avro-type-error-detail branch from faa831d to e75c336 Jun 22, 2016

@lossyrob lossyrob merged commit 4a80fb9 into locationtech:master Jun 28, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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