venkatsambath / hive-json-serde

Automatically exported from code.google.com/p/hive-json-serde
0 stars 0 forks source link

Convert numbers to strings if need be #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We have a data stream with columns which are usually integers, but sometimes 
strings. To handle this, we use a string column in Hive and convert integers to 
their string representation.

Right now the SerDe requires all objects in a column to be the same type. If 
you feed an integer into a column that is expecting a string you get:

Failed with exception java.io.IOException:java.lang.ClassCastException: 
java.lang.Integer cannot be cast to java.lang.String

Patch attached. If the column is a string, and the JSON data is a Number, 
convert it automatically instead of failing.

Original issue reported on code.google.com by nick.mar...@gmail.com on 14 Jan 2011 at 11:31

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you very much for the patch.

Applied with commit r24.

Original comment by pas...@gmail.com on 31 Jul 2011 at 5:53