OOZIE-2355 Hive2 Action doesn't pass along oozie configs to jobconf (rkanter)
Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/396fcc6c Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/396fcc6c Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/396fcc6c Branch: refs/heads/master Commit: 396fcc6c453b28ad09a5940a390ca1a88b33cbfa Parents: 63d3cdf Author: Robert Kanter <[email protected]> Authored: Fri Sep 4 15:03:41 2015 -0700 Committer: Robert Kanter <[email protected]> Committed: Fri Sep 4 15:03:41 2015 -0700 ---------------------------------------------------------------------- examples/src/main/apps/hive2/script.q | 1 + release-log.txt | 1 + .../main/java/org/apache/oozie/action/hadoop/Hive2Main.java | 7 +++++++ 3 files changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/396fcc6c/examples/src/main/apps/hive2/script.q ---------------------------------------------------------------------- diff --git a/examples/src/main/apps/hive2/script.q b/examples/src/main/apps/hive2/script.q index 3abc757..37d6564 100644 --- a/examples/src/main/apps/hive2/script.q +++ b/examples/src/main/apps/hive2/script.q @@ -15,5 +15,6 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- +DROP TABLE IF EXISTS test; CREATE EXTERNAL TABLE test (a INT) STORED AS TEXTFILE LOCATION '${INPUT}'; INSERT OVERWRITE DIRECTORY '${OUTPUT}' SELECT * FROM test; http://git-wip-us.apache.org/repos/asf/oozie/blob/396fcc6c/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 88e03fc..0bd450e 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 4.3.0 release (trunk - unreleased) +OOZIE-2355 Hive2 Action doesn't pass along oozie configs to jobconf (rkanter) OOZIE-2318 Provide better solution for specifying SSL truststore to Oozie Client (rkanter) OOZIE-2344 Enabling 'oozie.action.jobinfo.enable' doesn't inject the job information into the map/reduce job's configuration. (akshayrai09 via rkanter) OOZIE-2350 Package changes for release (shwethags) http://git-wip-us.apache.org/repos/asf/oozie/blob/396fcc6c/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java ---------------------------------------------------------------------- diff --git a/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java b/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java index 97af28b..56f5451 100644 --- a/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java +++ b/sharelib/hive2/src/main/java/org/apache/oozie/action/hadoop/Hive2Main.java @@ -27,6 +27,7 @@ import java.io.PrintStream; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.regex.Pattern; @@ -210,10 +211,16 @@ public class Hive2Main extends LauncherMain { arguments.add(beelineArg); } + // Propagate MR job tag if defined if (actionConf.get(LauncherMain.MAPREDUCE_JOB_TAGS) != null ) { arguments.add("--hiveconf"); arguments.add("mapreduce.job.tags=" + actionConf.get(LauncherMain.MAPREDUCE_JOB_TAGS)); } + // Propagate "oozie.*" configs + for (Map.Entry<String, String> oozieConfig : actionConf.getValByRegex("^oozie\\.(?!launcher).+").entrySet()) { + arguments.add("--hiveconf"); + arguments.add(oozieConfig.getKey() + "=" + oozieConfig.getValue()); + } System.out.println("Beeline command arguments :"); for (String arg : arguments) {
