Index: conf/hive-default.xml.template
===================================================================
--- conf/hive-default.xml.template (revision 30008)
+++ conf/hive-default.xml.template (working copy)
@@ -63,6 +63,14 @@
+ hive.cli.prompt
+ hive
+ Command line prompt configuration value. Other hiveconf can be used in
+ this configuration value. Variable substitution will only be invoked at the hive
+ cli startup.
+
+
+
hive.exec.scratchdir
/tmp/hive-${user.name}
Scratch space for Hive jobs
Index: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
===================================================================
--- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (revision 30008)
+++ common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (working copy)
@@ -351,6 +351,7 @@
// CLI
CLIIGNOREERRORS("hive.cli.errors.ignore", false),
CLIPRINTCURRENTDB("hive.cli.print.current.db", false),
+ CLIPROMPT("hive.cli.prompt", "hive"),
HIVE_METASTORE_FS_HANDLER_CLS("hive.metastore.fs.handler.class", "org.apache.hadoop.hive.metastore.HiveMetaStoreFsImpl"),
Index: cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
===================================================================
--- cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (revision 30008)
+++ cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (working copy)
@@ -661,6 +661,11 @@
ss.getOverriddenConfigurations().put((String) item.getKey(), (String) item.getValue());
}
+ // read prompt configuration and substitute variables.
+ prompt = conf.getVar(HiveConf.ConfVars.CLIPROMPT);
+ prompt = new VariableSubstitution().substitute(conf, prompt);
+ prompt2 = spacesForString(prompt);
+
SessionState.start(ss);
// connect to Hive Server