[ 
https://issues.apache.org/jira/browse/HIVE-5092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977818#comment-13977818
 ] 

shanyu zhao commented on HIVE-5092:
-----------------------------------

There is a logic error in this patch, if HIVE_HADOOP_CLASSPATH is null, then it 
will go to else statement and try to read HIVE_HADOOP_CLASSPATH from HiveConf, 
resulting in error.

The correct statements should be:
{code}
if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH)!= null) {
  if (variables.containsKey("HADOOP_CLASSPATH"))  {
    variables.put("HADOOP_CLASSPATH", variables.get("HADOOP_CLASSPATH") + ";" + 
HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH));
  } else {
    variables.put("HADOOP_CLASSPATH", HiveConf.getVar(conf, 
HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH));
  }
}
{code}

> Fix hiveserver2 mapreduce local job on Windows
> ----------------------------------------------
>
>                 Key: HIVE-5092
>                 URL: https://issues.apache.org/jira/browse/HIVE-5092
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, Windows
>            Reporter: Daniel Dai
>            Assignee: Hari Sankar Sivarama Subramaniyan
>         Attachments: HIVE-5092-1.patch, HIVE-5092.2.patch
>
>
> Hiveserver2 fail on Mapreduce local job fail. For example:
> {code}
> select /*+ MAPJOIN(v) */ registration from studenttab10k s join votertab10k v 
> on (s.name = v.name);
> {code}
> The root cause is "class not found" in the local hadoop job 
> (MapredLocalTask.execute). HADOOP_CLASSPATH does not include $HIVE_HOME/lib. 
> Set HADOOP_CLASSPATH correctly will fix the issue.
> However, there is one complexity in Windows. We start Hiveserver2 using 
> Windows service console (services.msc), which takes hiveserver2.xml generated 
> by hive.cmd. There is no way to pass environment variable in hiveserver2.xml 
> (weird but reality). I attach a patch which pass it through command line 
> arguments and relay to HADOOP_CLASSPATH in Hive code. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to