hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1601545 - in /hive/trunk: data/files/dec.avro serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java
Date Tue, 10 Jun 2014 03:01:44 GMT
Author: xuefu
Date: Tue Jun 10 03:01:43 2014
New Revision: 1601545

URL: http://svn.apache.org/r1601545
Log:
HIVE-7174: Do not accept string as scale and precision when reading Avro schema (Jacec via
Xuefu)

Modified:
    hive/trunk/data/files/dec.avro
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java

Modified: hive/trunk/data/files/dec.avro
URL: http://svn.apache.org/viewvc/hive/trunk/data/files/dec.avro?rev=1601545&r1=1601544&r2=1601545&view=diff
==============================================================================
Binary files - no diff available.

Modified: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java?rev=1601545&r1=1601544&r2=1601545&view=diff
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java (original)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroDeserializer.java Tue
Jun 10 03:01:43 2014
@@ -240,7 +240,7 @@ class AvroDeserializer {
 
       int scale = 0;
       try {
-        scale = fileSchema.getJsonProp(AvroSerDe.AVRO_PROP_SCALE).getValueAsInt(0);
+        scale = fileSchema.getJsonProp(AvroSerDe.AVRO_PROP_SCALE).getIntValue();
       } catch(Exception ex) {
         throw new AvroSerdeException("Failed to obtain scale value from file schema: " +
fileSchema, ex);
       }

Modified: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java?rev=1601545&r1=1601544&r2=1601545&view=diff
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java (original)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.java Tue
Jun 10 03:01:43 2014
@@ -113,8 +113,8 @@ class SchemaToTypeInfo {
       int precision = 0;
       int scale = 0;
       try {
-        precision = schema.getJsonProp(AvroSerDe.AVRO_PROP_PRECISION).getValueAsInt();
-        scale = schema.getJsonProp(AvroSerDe.AVRO_PROP_SCALE).getValueAsInt(0);
+        precision = schema.getJsonProp(AvroSerDe.AVRO_PROP_PRECISION).getIntValue();
+        scale = schema.getJsonProp(AvroSerDe.AVRO_PROP_SCALE).getIntValue();
       } catch (Exception ex) {
         throw new AvroSerdeException("Failed to obtain scale value from file schema: " +
schema, ex);
       }



Mime
View raw message