----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/23387/#review47894 -----------------------------------------------------------
Overall looks good. I added a few comments regarding the Avro schema mapping. It would also be useful to update the documentation (https://cwiki.apache.org/confluence/display/Hive/AvroSerDe) with to cover this feature once it is released, especially the type mappings table. serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84124> The doc string here could be the Hive column definition, which would be helpful for debugging. serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84121> VOID is missing - it maps to Schema.Type.NULL in Avro. Also, SHORT and BYTE could map to INT. And CHAR, VARCHAR could map to STRING. serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84123> Are optional fields supported properly? All schemas should probably be wrapped in an Avro null union to allow values to be null: private static Schema optional(Schema schema) { return Schema.createUnion(Arrays.asList(Schema.create(Schema.Type.NULL), schema)); } serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84119> This should be BINARY. BYTE can be mapped to Avro Schema.Type.INT serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84122> Throw an exception if the key type isn't string. serde/src/test/org/apache/hadoop/hive/serde2/avro/TestTypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84126> COLUMN_NAMES serde/src/test/org/apache/hadoop/hive/serde2/avro/TestTypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84125> Pass this as a parameter to getAvroSchemaString() - it's a bit odd to set it in tests then read it in getAvroSchemaString(). serde/src/test/org/apache/hadoop/hive/serde2/avro/TestTypeInfoToSchema.java <https://reviews.apache.org/r/23387/#comment84127> Add a field for each Hive type to test they can all work in the context of a record. Also add a nested record. - Tom White On July 16, 2014, 3:35 a.m., Ashish Singh wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/23387/ > ----------------------------------------------------------- > > (Updated July 16, 2014, 3:35 a.m.) > > > Review request for hive. > > > Bugs: HIVE-6806 > https://issues.apache.org/jira/browse/HIVE-6806 > > > Repository: hive-git > > > Description > ------- > > HIVE-6806: Native avro support > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/io/AvroStorageFormatDescriptor.java > PRE-CREATION > ql/src/java/org/apache/hadoop/hive/ql/io/IOConstants.java > 1bae0a8fee04049f90b16d813ff4c96707b349c8 > > ql/src/main/resources/META-INF/services/org.apache.hadoop.hive.ql.io.StorageFormatDescriptor > a23ff115512da5fe3167835a88d582c427585b8e > ql/src/test/org/apache/hadoop/hive/ql/io/TestStorageFormatDescriptor.java > d53ebc65174d66bfeee25fd2891c69c78f9137ee > ql/src/test/queries/clientpositive/avro_compression_enabled_native.q > PRE-CREATION > ql/src/test/queries/clientpositive/avro_decimal_native.q PRE-CREATION > ql/src/test/queries/clientpositive/avro_joins_native.q PRE-CREATION > ql/src/test/queries/clientpositive/avro_native.q PRE-CREATION > ql/src/test/queries/clientpositive/avro_partitioned_native.q PRE-CREATION > ql/src/test/queries/clientpositive/avro_schema_evolution_native.q > PRE-CREATION > ql/src/test/results/clientpositive/avro_compression_enabled_native.q.out > PRE-CREATION > ql/src/test/results/clientpositive/avro_decimal_native.q.out PRE-CREATION > ql/src/test/results/clientpositive/avro_joins_native.q.out PRE-CREATION > ql/src/test/results/clientpositive/avro_native.q.out PRE-CREATION > ql/src/test/results/clientpositive/avro_partitioned_native.q.out > PRE-CREATION > ql/src/test/results/clientpositive/avro_schema_evolution_native.q.out > PRE-CREATION > serde/src/java/org/apache/hadoop/hive/serde2/avro/AvroSerDe.java > 1fe31e0034f8988d03a0c51a90904bb93e7cb157 > serde/src/java/org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.java > PRE-CREATION > serde/src/test/org/apache/hadoop/hive/serde2/avro/TestTypeInfoToSchema.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/23387/diff/ > > > Testing > ------- > > Added qTests and unit tests > > > Thanks, > > Ashish Singh > >