Review Board 1.7.22


Fix for SQOOP-1249

Review Request #16020 - Created Dec. 4, 2013 and updated

Venkat Ranganathan
SQOOP-1249
Reviewers
Sqoop
sqoop-trunk
Fix for Sqoop-1249.   The validation has been fixed to allow one of target-dir or hcatalog|hbase|accumulo table as the destination

Added one more test case for query imports into a hcatalog table
Ran all tests and checkstyle verification

Diff revision 2 (Latest)

1 2
1 2

  1. src/java/org/apache/sqoop/tool/ImportTool.java: Loading...
  2. src/test/org/apache/sqoop/hcat/HCatalogImportTest.java: Loading...
src/java/org/apache/sqoop/tool/ImportTool.java
Revision 50826e9 New Change
[20] 891 lines
[+20] [+] protected void validateImportOptions(SqoopOptions options)
892
          "Cannot specify --" + SQL_QUERY_ARG + " and --table together."
892
          "Cannot specify --" + SQL_QUERY_ARG + " and --table together."
893
          + HELP_STR);
893
          + HELP_STR);
894
    } else if (options.getSqlQuery() != null
894
    } else if (options.getSqlQuery() != null
895
        && options.getTargetDir() == null
895
        && options.getTargetDir() == null
896
        && options.getHBaseTable() == null
896
        && options.getHBaseTable() == null

    
   
897
        && options.getHCatTableName() == null
897
        && options.getAccumuloTable() == null) {
898
        && options.getAccumuloTable() == null) {
898
      throw new InvalidOptionsException(
899
      throw new InvalidOptionsException(
899
          "Must specify destination with --target-dir."
900
          "Must specify destination with --target-dir. "
900
          + HELP_STR);
901
          + HELP_STR);
901
    } else if (options.getSqlQuery() != null && options.doHiveImport()
902
    } else if (options.getSqlQuery() != null && options.doHiveImport()
902
        && options.getHiveTableName() == null) {
903
        && options.getHiveTableName() == null) {
903
      throw new InvalidOptionsException(
904
      throw new InvalidOptionsException(
904
          "When importing a query to Hive, you must specify --"
905
          "When importing a query to Hive, you must specify --"
[+20] [20] 93 lines
src/test/org/apache/sqoop/hcat/HCatalogImportTest.java
Revision 13850fc New Change
 
  1. src/java/org/apache/sqoop/tool/ImportTool.java: Loading...
  2. src/test/org/apache/sqoop/hcat/HCatalogImportTest.java: Loading...