You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org> on 2018/12/30 04:10:01 UTC
[jira] [Updated] (AVRO-2070) Tolerate any Number when writing
primitive values in Java in GenericDatumWriter
[ https://issues.apache.org/jira/browse/AVRO-2070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thiruvalluvan M. G. updated AVRO-2070:
--------------------------------------
Component/s: java
> Tolerate any Number when writing primitive values in Java in GenericDatumWriter
> -------------------------------------------------------------------------------
>
> Key: AVRO-2070
> URL: https://issues.apache.org/jira/browse/AVRO-2070
> Project: Apache Avro
> Issue Type: Improvement
> Components: java
> Reporter: Daniil Gitelson
> Priority: Major
>
> Tolerating any Number (instead of concrete Long, Double, Float) makes possible to use mutable Number implmentation for performance reasons (specially for primitive collection iterations)
> Currently, this only works for int only:
> {code:java}
> // Here it works
> case INT: out.writeInt(((Number)datum).intValue()); break;
> // This should be replaced with ((Number)datum).longValue() etc
> case LONG: out.writeLong((Long)datum); break;
> case FLOAT: out.writeFloat((Float)datum); break;
> case DOUBLE: out.writeDouble((Double)datum); break;
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)