hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RD <>
Subject Does hive/ql/src/test/queries/clientpositive/avro_decimal.q violate avro schema evolution?
Date Tue, 22 Nov 2016 04:39:51 GMT
I ask because I was re-looking at and how to support newer
data types (Decimal, Varchar, Char)

In this qtest, we write using a schema containing a decimal having
precision 5 and scale 2 (decimal(5,2)) , but when reading the same data we
set the read schema having a decimal data type of decimal(4,1) . This test
produces correct results* (because the AvroSerde uses the file schema and
not the reader schema to read the decimal type)* but is the schema
evolution  for the decimal type valid?

Avro schema evolution spec is not very clear what is a valid evolution rule
for decimal types. From the Avro spec ( I see the following

*For the purposes of schema resolution, two schemas that
> are decimal logical types match if their scales and precisions match.*

Is this effectively saying that reading schema for decimal type should
match in precision and scale with the writer schema?

View raw message