SQOOP-1071 Avro import is failing when columns are starting with underscore
Review Request #11748 - Created June 8, 2013 and submitted
The issue is hiding in fact that ClassWriter will use toJavaIdentifier() method to generate attribute name, however AvroSchemaGenerator is using only toIdentifier(). I've changed the AvroSchemaGenerator to generate the proper schema in the same way as is doing the ClassWriter. This is backward incompatible change, however considering that Sqoop was not able to import anything without this, I would assume that consequences will be minimal if there will be any.
I've added test that will fail without the fix and refactored a bit BaseSqoopTestCase to allow override column names. All tests seems to be passing.
Posted (June 10, 2013, 8:24 p.m.)
LGTM. It looks like java identifiers will also be prepended with _ now but that should not affect the consumption of the schema in other scenarios.
Review request changed
Updated (July 22, 2013, 9:49 p.m.)
- changed from pending to submitted