Repository: sqoop Updated Branches: refs/heads/sqoop2 8c604754a -> a79ec0527
SQOOP-1594: Sqoop2: DestroyerContext has the wrong Schema (Qian Xu via Abraham Elmahrek) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/a79ec052 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/a79ec052 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/a79ec052 Branch: refs/heads/sqoop2 Commit: a79ec05271b15a9cf088280eec2391ce1dd4ec19 Parents: 8c60475 Author: Abraham Elmahrek <[email protected]> Authored: Thu Oct 23 13:32:43 2014 -0700 Committer: Abraham Elmahrek <[email protected]> Committed: Thu Oct 23 13:39:46 2014 -0700 ---------------------------------------------------------------------- .../org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/a79ec052/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java ---------------------------------------------------------------------- diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java index b385926..32b5b1d 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopDestroyerExecutor.java @@ -20,8 +20,10 @@ package org.apache.sqoop.job.mr; import org.apache.hadoop.conf.Configuration; import org.apache.log4j.Logger; import org.apache.sqoop.common.Direction; -import org.apache.sqoop.job.MRJobConstants; import org.apache.sqoop.common.PrefixContext; +import org.apache.sqoop.connector.matcher.Matcher; +import org.apache.sqoop.connector.matcher.MatcherFactory; +import org.apache.sqoop.job.MRJobConstants; import org.apache.sqoop.job.etl.Destroyer; import org.apache.sqoop.job.etl.DestroyerContext; import org.apache.sqoop.schema.Schema; @@ -70,7 +72,11 @@ public class SqoopDestroyerExecutor { Object configJob = MRConfigurationUtils.getConnectorJobConfig(direction, configuration); // Propagate connector schema in every case for now - Schema schema = MRConfigurationUtils.getConnectorSchema(direction, configuration); + Matcher matcher = MatcherFactory.getMatcher( + MRConfigurationUtils.getConnectorSchema(Direction.FROM, configuration), + MRConfigurationUtils.getConnectorSchema(Direction.TO, configuration)); + Schema schema = direction == Direction.FROM ? + matcher.getFromSchema() : matcher.getToSchema(); DestroyerContext destroyerContext = new DestroyerContext(subContext, success, schema);
