Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 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
<[EMAIL PROTECTED]> wrote:

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:

http://avro.apache.org/docs/current/spec.html#Schema+Resolution

(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.

https://issues.apache.org/jira/browse/AVRO-1533

Doug

 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB