Review Board 1.7.22


SQOOP-894 Sqoop2: Increase counter and group size in derby repository

Review Request #9448 - Created Feb. 14, 2013 and submitted

Jarek Cecho
SQOOP-894
Reviewers
Sqoop
sqoop-sqoop2
I've increased the size of counter and group name from 50 to 75 and make provide truncating methods into queries, so that they won't fail.
Maven tests seems to be passing + tested on real cluster

Diff revision 2 (Latest)

1 2
1 2

  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Revision d94ecc56ae07fab71a0b04223e00984e07b97ce9 New Change
[20] 143 lines
[+20]
144
 * <pre>
144
 * <pre>
145
 *    +----------------------------+
145
 *    +----------------------------+
146
 *    | SQ_COUNTER_GROUP           |
146
 *    | SQ_COUNTER_GROUP           |
147
 *    +----------------------------+
147
 *    +----------------------------+
148
 *    | SQG_ID: BIGINT PK          |
148
 *    | SQG_ID: BIGINT PK          |
149
 *    | SQG_NAME: VARCHAR(50)      |
149
 *    | SQG_NAME: VARCHAR(75)      |
150
 *    +----------------------------+
150
 *    +----------------------------+
151
 * </pre>
151
 * </pre>
152
 * </p>
152
 * </p>
153
 * <p>
153
 * <p>
154
 * <strong>SQ_COUNTER</strong>: List of counters
154
 * <strong>SQ_COUNTER</strong>: List of counters
155
 * <pre>
155
 * <pre>
156
 *    +----------------------------+
156
 *    +----------------------------+
157
 *    | SQ_COUNTER                 |
157
 *    | SQ_COUNTER                 |
158
 *    +----------------------------+
158
 *    +----------------------------+
159
 *    | SQR_ID: BIGINT PK          |
159
 *    | SQR_ID: BIGINT PK          |
160
 *    | SQR_NAME: VARCHAR(50)      |
160
 *    | SQR_NAME: VARCHAR(75)      |
161
 *    +----------------------------+
161
 *    +----------------------------+
162
 * </pre>
162
 * </pre>
163
 * </p>
163
 * </p>
164
 * <p>
164
 * <p>
165
 * <strong>SQ_COUNTER_SUBMISSION</strong>: N:M Relationship
165
 * <strong>SQ_COUNTER_SUBMISSION</strong>: N:M Relationship
[+20] [20] 116 lines
[+20]
282

    
   
282

   
283
  // DDL: Create table SQ_COUNTER_GROUP
283
  // DDL: Create table SQ_COUNTER_GROUP
284
  public static final String QUERY_CREATE_TABLE_SQ_COUNTER_GROUP =
284
  public static final String QUERY_CREATE_TABLE_SQ_COUNTER_GROUP =
285
    "CREATE TABLE " + TABLE_SQ_COUNTER_GROUP + " ("
285
    "CREATE TABLE " + TABLE_SQ_COUNTER_GROUP + " ("
286
    + COLUMN_SQG_ID + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), "
286
    + COLUMN_SQG_ID + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), "
287
    + COLUMN_SQG_NAME + " VARCHAR(50), "
287
    + COLUMN_SQG_NAME + " VARCHAR(75), "
288
    + "PRIMARY KEY (" + COLUMN_SQG_ID + "),"
288
    + "PRIMARY KEY (" + COLUMN_SQG_ID + "),"
289
    + "UNIQUE ( " + COLUMN_SQG_NAME + ")"
289
    + "UNIQUE ( " + COLUMN_SQG_NAME + ")"
290
    + ")";
290
    + ")";
291

    
   
291

   
292
  // DDL: Create table SQ_COUNTER
292
  // DDL: Create table SQ_COUNTER
293
  public static final String QUERY_CREATE_TABLE_SQ_COUNTER =
293
  public static final String QUERY_CREATE_TABLE_SQ_COUNTER =
294
    "CREATE TABLE " + TABLE_SQ_COUNTER + " ("
294
    "CREATE TABLE " + TABLE_SQ_COUNTER + " ("
295
    + COLUMN_SQR_ID + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), "
295
    + COLUMN_SQR_ID + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), "
296
    + COLUMN_SQR_NAME + " VARCHAR(50), "
296
    + COLUMN_SQR_NAME + " VARCHAR(75), "
297
    + "PRIMARY KEY (" + COLUMN_SQR_ID + "), "
297
    + "PRIMARY KEY (" + COLUMN_SQR_ID + "), "
298
    + "UNIQUE ( " + COLUMN_SQR_NAME + ")"
298
    + "UNIQUE ( " + COLUMN_SQR_NAME + ")"
299
    + ")";
299
    + ")";
300

    
   
300

   
301
  // DDL: Create table SQ_COUNTER_SUBMISSION
301
  // DDL: Create table SQ_COUNTER_SUBMISSION
[+20] [20] 282 lines
[+20]
584
  public static final String STMT_SELECT_COUNTER_GROUP =
584
  public static final String STMT_SELECT_COUNTER_GROUP =
585
    "SELECT "
585
    "SELECT "
586
    + COLUMN_SQG_ID + ", "
586
    + COLUMN_SQG_ID + ", "
587
    + COLUMN_SQG_NAME + " "
587
    + COLUMN_SQG_NAME + " "
588
    + "FROM " + TABLE_SQ_COUNTER_GROUP + " "
588
    + "FROM " + TABLE_SQ_COUNTER_GROUP + " "
589
    + "WHERE " + COLUMN_SQG_NAME + " = ?";
589
    + "WHERE " + COLUMN_SQG_NAME + " = substr(?, 1, 75)";
590

    
   
590

   
591
  // DML: Insert new counter group
591
  // DML: Insert new counter group
592
  public static final String STMT_INSERT_COUNTER_GROUP =
592
  public static final String STMT_INSERT_COUNTER_GROUP =
593
    "INSERT INTO " + TABLE_SQ_COUNTER_GROUP + " ("
593
    "INSERT INTO " + TABLE_SQ_COUNTER_GROUP + " ("
594
    + COLUMN_SQG_NAME + ") "
594
    + COLUMN_SQG_NAME + ") "
595
    + "VALUES (?)";
595
    + "VALUES (substr(?, 1, 75))";
596

    
   
596

   
597
  // DML: Select counter
597
  // DML: Select counter
598
  public static final String STMT_SELECT_COUNTER =
598
  public static final String STMT_SELECT_COUNTER =
599
    "SELECT "
599
    "SELECT "
600
    + COLUMN_SQR_ID + ", "
600
    + COLUMN_SQR_ID + ", "
601
    + COLUMN_SQR_NAME + " "
601
    + COLUMN_SQR_NAME + " "
602
    + "FROM " + TABLE_SQ_COUNTER + " "
602
    + "FROM " + TABLE_SQ_COUNTER + " "
603
    + "WHERE " + COLUMN_SQR_NAME + " = ?";
603
    + "WHERE " + COLUMN_SQR_NAME + " = substr(?, 1, 75)";
604

    
   
604

   
605
  // DML: Insert new counter
605
  // DML: Insert new counter
606
  public static final String STMT_INSERT_COUNTER =
606
  public static final String STMT_INSERT_COUNTER =
607
    "INSERT INTO " + TABLE_SQ_COUNTER + " ("
607
    "INSERT INTO " + TABLE_SQ_COUNTER + " ("
608
    + COLUMN_SQR_NAME + ") "
608
    + COLUMN_SQR_NAME + ") "
609
    + "VALUES (?)";
609
    + "VALUES (substr(?, 1, 75))";
610

    
   
610

   
611
  // DML: Insert new counter submission
611
  // DML: Insert new counter submission
612
  public static final String STMT_INSERT_COUNTER_SUBMISSION =
612
  public static final String STMT_INSERT_COUNTER_SUBMISSION =
613
    "INSERT INTO " + TABLE_SQ_COUNTER_SUBMISSION + " ("
613
    "INSERT INTO " + TABLE_SQ_COUNTER_SUBMISSION + " ("
614
    + COLUMN_SQRS_GROUP + ", "
614
    + COLUMN_SQRS_GROUP + ", "
[+20] [20] 26 lines
  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java: Loading...