Review Board 1.7.22


SQOOP-912 Add ability to specify --hive-database parameter

Review Request #10133 - Created March 26, 2013 and submitted

Jarek Cecho
SQOOP-912
Reviewers
Sqoop
sqoop-trunk
I've added new parameter --hive-database that can be used to specify database in hive.
New unit test added. Tests seems to be passing and I've run the patch on real hadoop cluster.
src/java/org/apache/sqoop/SqoopOptions.java
Revision 08bab1e New Change
[20] 142 lines
[+20] [+] public String toString() {
143
  @StoredAsProperty("hive.import") private boolean hiveImport;
143
  @StoredAsProperty("hive.import") private boolean hiveImport;
144
  @StoredAsProperty("hive.overwrite.table") private boolean overwriteHiveTable;
144
  @StoredAsProperty("hive.overwrite.table") private boolean overwriteHiveTable;
145
  @StoredAsProperty("hive.fail.table.exists")
145
  @StoredAsProperty("hive.fail.table.exists")
146
  private boolean failIfHiveTableExists;
146
  private boolean failIfHiveTableExists;
147
  @StoredAsProperty("hive.table.name") private String hiveTableName;
147
  @StoredAsProperty("hive.table.name") private String hiveTableName;

    
   
148
  @StoredAsProperty("hive.database.name") private String hiveDatabaseName;
148
  @StoredAsProperty("hive.drop.delims") private boolean hiveDropDelims;
149
  @StoredAsProperty("hive.drop.delims") private boolean hiveDropDelims;
149
  @StoredAsProperty("hive.delims.replacement")
150
  @StoredAsProperty("hive.delims.replacement")
150
  private String hiveDelimsReplacement;
151
  private String hiveDelimsReplacement;
151
  @StoredAsProperty("hive.partition.key") private String hivePartitionKey;
152
  @StoredAsProperty("hive.partition.key") private String hivePartitionKey;
152
  @StoredAsProperty("hive.partition.value") private String hivePartitionValue;
153
  @StoredAsProperty("hive.partition.value") private String hivePartitionValue;
[+20] [20] 1459 lines
[+20] [+] public String getHiveTableName() {
1612

    
   
1613

   
1613
  public void setHiveTableName(String name) {
1614
  public void setHiveTableName(String name) {
1614
    this.hiveTableName = name;
1615
    this.hiveTableName = name;
1615
  }
1616
  }
1616

    
   
1617

   

    
   
1618
  public String getHiveDatabaseName() {

    
   
1619
    return this.hiveDatabaseName;

    
   
1620
  }

    
   
1621

   

    
   
1622
  public void setHiveDatabaseName(String name) {

    
   
1623
    this.hiveDatabaseName = name;

    
   
1624
  }

    
   
1625

   
1617
  public String getHivePartitionKey() {
1626
  public String getHivePartitionKey() {
1618
    return hivePartitionKey;
1627
    return hivePartitionKey;
1619
  }
1628
  }
1620

    
   
1629

   
1621
  public void setHivePartitionKey(String hpk) {
1630
  public void setHivePartitionKey(String hpk) {
[+20] [20] 440 lines
src/java/org/apache/sqoop/hive/TableDefWriter.java
Revision 3563c67 New Change
 
src/java/org/apache/sqoop/tool/BaseSqoopTool.java
Revision 9874bae New Change
 
src/test/com/cloudera/sqoop/hive/TestTableDefWriter.java
Revision 6610b75 New Change
 
  1. src/java/org/apache/sqoop/SqoopOptions.java: Loading...
  2. src/java/org/apache/sqoop/hive/TableDefWriter.java: Loading...
  3. src/java/org/apache/sqoop/tool/BaseSqoopTool.java: Loading...
  4. src/test/com/cloudera/sqoop/hive/TestTableDefWriter.java: Loading...