sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kathl...@apache.org
Subject sqoop git commit: SQOOP-2783: Query import with parquet fails on incompatible schema (Jarek Jarcec Cecho via Kate Ting)
Date Sat, 16 Jan 2016 00:01:27 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 1e310ad9f -> 926d92bac


SQOOP-2783: Query import with parquet fails on incompatible schema
 (Jarek Jarcec Cecho via Kate Ting)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/926d92ba
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/926d92ba
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/926d92ba

Branch: refs/heads/trunk
Commit: 926d92bac13ff8171d503aa0f7b429e030284e2f
Parents: 1e310ad
Author: Kate Ting <kathleen@apache.org>
Authored: Fri Jan 15 16:00:34 2016 -0800
Committer: Kate Ting <kathleen@apache.org>
Committed: Fri Jan 15 16:00:34 2016 -0800

----------------------------------------------------------------------
 src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/926d92ba/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java b/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
index dcffb99..0a693d0 100644
--- a/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
+++ b/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
@@ -48,6 +48,8 @@ public class AvroSchemaGenerator {
   private final ConnManager connManager;
   private final String tableName;
 
+  private final String DEFAULT_SCHEMA_NAME = "AutoGeneratedSchema";
+
   public AvroSchemaGenerator(final SqoopOptions opts, final ConnManager connMgr,
       final String table) {
     this.options = opts;
@@ -78,7 +80,7 @@ public class AvroSchemaGenerator {
     }
 
     TableClassName tableClassName = new TableClassName(options);
-    String shortClassName = tableClassName.getShortClassForTable(tableName);
+    String shortClassName = tableName == null ? DEFAULT_SCHEMA_NAME : tableClassName.getShortClassForTable(tableName);
     String avroTableName = (tableName == null ? TableClassName.QUERY_RESULT : tableName);
     String avroName = schemaNameOverride != null ? schemaNameOverride :
         (shortClassName == null ? avroTableName : shortClassName);


Mime
View raw message