зеркало из https://github.com/github/sqoop.git
Revert ClassWriter aliasing
ClassWriter prefixes columns with names that correspond to Java reserved words with '_'. For example, 'public' becomes '_public'. Later, when we attempt to look up the column in the Hive schema via HCatalog, the aliased column doesn't exist (assuming we've created a Hive schema that exactly mirrors the schema of the source DB). This patch coarsely removes prefixed underscores. A potential improvement would be to check that the column name indeed is a Java reserved word.
This commit is contained in:
Родитель
c0c5a81723
Коммит
a44bed8896
|
@ -166,7 +166,7 @@ public class SqoopHCatImportHelper {
|
|||
for (Map.Entry<String, Object> entry : fieldMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object val = entry.getValue();
|
||||
String hfn = key.toLowerCase();
|
||||
String hfn = key.toLowerCase().replaceFirst("^_", "");
|
||||
boolean skip = false;
|
||||
if (staticPartitionKeys != null && staticPartitionKeys.length > 0) {
|
||||
for (int i = 0; i < staticPartitionKeys.length; ++i) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче