SQOOP-2779: Sqoop metastore doesn't seem to recognize --schema option
  (Sowmya Ramesh via Venkat Ranganathan)
diff --git a/src/java/org/apache/sqoop/tool/JobTool.java b/src/java/org/apache/sqoop/tool/JobTool.java
index 4359058..2eafac3 100644
--- a/src/java/org/apache/sqoop/tool/JobTool.java
+++ b/src/java/org/apache/sqoop/tool/JobTool.java
@@ -210,21 +210,6 @@
     SqoopOptions clonedOpts = (SqoopOptions) childOpts.clone();
     clonedOpts.setParent(childOpts);
 
-    int dashPos = getDashPosition(extraArguments);
-    String [] childArgv;
-    if (dashPos >= extraArguments.length) {
-      childArgv = new String[0];
-    } else {
-      childArgv = Arrays.copyOfRange(extraArguments, dashPos + 1,
-          extraArguments.length);
-    }
-
-    int confRet = configureChildTool(clonedOpts, childTool, childArgv);
-    if (0 != confRet) {
-      // Error.
-      return confRet;
-    }
-
     return childTool.run(clonedOpts);
   }
 
diff --git a/src/test/com/cloudera/sqoop/metastore/TestSavedJobs.java b/src/test/com/cloudera/sqoop/metastore/TestSavedJobs.java
index d100c2c..0ac6bdc 100644
--- a/src/test/com/cloudera/sqoop/metastore/TestSavedJobs.java
+++ b/src/test/com/cloudera/sqoop/metastore/TestSavedJobs.java
@@ -167,6 +167,46 @@
     storage.close();
   }
 
+    public void testCreateJobWithExtraArgs() throws IOException {
+        Configuration conf = newConf();
+        JobStorageFactory ssf = new JobStorageFactory(conf);
+
+        Map<String, String> descriptor = new TreeMap<String, String>();
+        JobStorage storage = ssf.getJobStorage(descriptor);
+
+        storage.open(descriptor);
+
+        // Job list should start out empty.
+        List<String> jobs = storage.list();
+        assertEquals(0, jobs.size());
+
+        // Create a job with extra args
+        com.cloudera.sqoop.SqoopOptions opts = new SqoopOptions();
+        String[] args = {"-schema", "test"};
+        opts.setExtraArgs(args);
+        JobData data = new JobData(opts, new VersionTool());
+        storage.create("versionJob", data);
+
+        jobs = storage.list();
+        assertEquals(1, jobs.size());
+        assertEquals("versionJob", jobs.get(0));
+
+        // Restore our job, check that it exists.
+        JobData outData = storage.read("versionJob");
+        assertEquals(new VersionTool().getToolName(),
+                outData.getSqoopTool().getToolName());
+
+        String[] storedArgs = outData.getSqoopOptions().getExtraArgs();
+        for(int index = 0; index < args.length; ++index) {
+            assertEquals(args[index], storedArgs[index]);
+        }
+
+        // Now delete the job.
+        storage.delete("versionJob");
+
+        storage.close();
+    }
+
   public void testMultiConnections() throws IOException {
     // Ensure that a job can be retrieved when the storage is
     // closed and reopened.
@@ -209,5 +249,6 @@
 
     storage.close();
   }
+
 }