sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1208: Sqoop2: job ID column is too small
Date Wed, 02 Oct 2013 01:08:34 GMT
Updated Branches:
  refs/heads/sqoop2 c0f409fa2 -> 0a5a80cbf


SQOOP-1208: Sqoop2: job ID column is too small


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

Branch: refs/heads/sqoop2
Commit: 0a5a80cbfaa92c9acf87b125831ed92451b86050
Parents: c0f409f
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Oct 1 18:07:40 2013 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Oct 1 18:07:40 2013 -0700

----------------------------------------------------------------------
 .../apache/sqoop/repository/derby/DerbyRepoConstants.java   | 9 +++++++--
 .../sqoop/repository/derby/DerbyRepositoryHandler.java      | 3 +++
 .../org/apache/sqoop/repository/derby/DerbySchemaQuery.java | 9 +++++++--
 .../org/apache/sqoop/repository/derby/DerbyTestCase.java    | 2 +-
 4 files changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/0a5a80cb/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java
index bb01f03..200293d 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepoConstants.java
@@ -31,9 +31,14 @@ public final class DerbyRepoConstants {
    * History:
    * 0 - empty/unknown state
    * 1 - First two releases (1.99.1, 1.99.2)
-   * 2 - added SQ_SYSTEM
+   * 2 - added SQ_SYSTEM, SQ_CONNECTION add column ENABLED,
+   *     SQ_CONNECTION add column CREATION_USER, SQ_CONNECTION add column UPDATE_USER,
+   *     SQ_JOB add column ENABLED, SQ_JOB add column CREATION_USER,
+   *     SQ_JOB add column UPDATE_USER, SQ_SUBMISSION add column CREATION_USER,
+   *     SQ_SUBMISSION add column UPDATE_USER
+   * 3 - SQ_SUBMISSION modified SQS_EXTERNAL_ID varchar(50)
    */
-  public static final int VERSION = 2;
+  public static final int VERSION = 3;
 
   private DerbyRepoConstants() {
     // Disable explicit object creation

http://git-wip-us.apache.org/repos/asf/sqoop/blob/0a5a80cb/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
index f6bd5b5..851e36c 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
@@ -395,6 +395,9 @@ public class DerbyRepositoryHandler extends JdbcRepositoryHandler {
       runQuery(QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_CREATION_USER, conn);
       runQuery(QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_UPDATE_USER, conn);
     }
+    if(version <= 2) {
+      runQuery(QUERY_UPGRADE_TABLE_SQ_SUBMISSION_MODIFY_COLUMN_SQS_EXTERNAL_ID_VARCHAR_50,
conn);
+    }
 
     ResultSet rs = null;
     PreparedStatement stmt = null;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/0a5a80cb/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
index 0a196f0..8016ad8 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
@@ -151,7 +151,7 @@ import static org.apache.sqoop.repository.derby.DerbySchemaConstants.*;
  *    | SQS_CREATION_DATE: TIMESTAMP      |
  *    | SQS_UPDATE_USER: VARCHAR(32)      |
  *    | SQS_UPDATE_DATE: TIMESTAMP        |
- *    | SQS_EXTERNAL_ID: VARCHAR(25)      |
+ *    | SQS_EXTERNAL_ID: VARCHAR(50)      |
  *    | SQS_EXTERNAL_LINK: VARCHAR(150)   |
  *    | SQS_EXCEPTION: VARCHAR(150)       |
  *    | SQS_EXCEPTION_TRACE: VARCHAR(750) |
@@ -352,7 +352,7 @@ public final class DerbySchemaQuery {
     + COLUMN_SQS_STATUS + " VARCHAR(20), "
     + COLUMN_SQS_CREATION_DATE + " TIMESTAMP,"
     + COLUMN_SQS_UPDATE_DATE + " TIMESTAMP,"
-    + COLUMN_SQS_EXTERNAL_ID + " VARCHAR(25), "
+    + COLUMN_SQS_EXTERNAL_ID + " VARCHAR(50), "
     + COLUMN_SQS_EXTERNAL_LINK + " VARCHAR(150), "
     + COLUMN_SQS_EXCEPTION + " VARCHAR(150), "
     + COLUMN_SQS_EXCEPTION_TRACE + " VARCHAR(750), "
@@ -374,6 +374,11 @@ public final class DerbySchemaQuery {
       + COLUMN_SQS_UPDATE_USER + " VARCHAR(32) "
       + "DEFAULT NULL";
 
+  //DDL: Add update_user column to table SQ_SUBMISSION
+  public static final String QUERY_UPGRADE_TABLE_SQ_SUBMISSION_MODIFY_COLUMN_SQS_EXTERNAL_ID_VARCHAR_50
=
+     "ALTER TABLE " + TABLE_SQ_SUBMISSION + " ALTER COLUMN "
+     + COLUMN_SQS_EXTERNAL_ID + " SET DATA TYPE VARCHAR(50)";
+
   // DDL: Create table SQ_COUNTER_GROUP
   public static final String QUERY_CREATE_TABLE_SQ_COUNTER_GROUP =
     "CREATE TABLE " + TABLE_SQ_COUNTER_GROUP + " ("

http://git-wip-us.apache.org/repos/asf/sqoop/blob/0a5a80cb/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
index a2a0bc7..a1ad40d 100644
--- a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
+++ b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/DerbyTestCase.java
@@ -109,7 +109,7 @@ abstract public class DerbyTestCase extends TestCase {
     runQuery(QUERY_UPGRADE_TABLE_SQ_JOB_ADD_COLUMN_UPDATE_USER);
     runQuery(QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_CREATION_USER);
     runQuery(QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_UPDATE_USER);
-    runQuery("INSERT INTO SQOOP.SQ_SYSTEM(SQM_KEY, SQM_VALUE) VALUES('version', '2')");
+    runQuery("INSERT INTO SQOOP.SQ_SYSTEM(SQM_KEY, SQM_VALUE) VALUES('version', '3')");
     runQuery("INSERT INTO SQOOP.SQ_SYSTEM(SQM_KEY, SQM_VALUE) " +
       "VALUES('framework.version', '1')");
   }


Mime
View raw message