Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> Schema Coersion

Copy link to this message
Re: Schema Coersion
On Fri, Jun 27, 2014 at 9:40 AM, Pritchard, Charles X. -ND

Not easily today.  Binary string values are a subset of bytes (those
that are valid UTF-8 sequences), so string to bytes would be a
lossless conversion.  Bytes to string however isn't guaranteed to
produce valid data.

Perhaps we should permit one or both of these as a standard type promotion in:


(Int-to-float and long-to-float are both lossy promotions that we
already permit.)

In the meantime, the standard Java APIs won't permit this conversion.
I posted a patch that adds support for promotion from string to bytes.
Would this be useful?  If so, please add comments to the issue.