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

Prasad Mujumdar commented on SENTRY-430:
----------------------------------------

Sentry and Hive are currently using different versions for thrift. There are 
also other jars that are common to both products (eg DataNucleus, common-XXX 
etc) which could conflict in future.
On the other hand, config tool which invokes Hive requires Hive env setup and 
need to add Sentry client jars in the classpath . The argument passed to Sentry 
scripts are handled in the java code, however the classpath decision needs to 
be in the script itself. This makes thing messy and the current workaround is 
to look at HIVE_HOME to make that choice. 

We can force the config tool to specify HIVE_HOME and get rid of the current 
logic to selectively setup the service classpath. This could lead to problem in 
senty service if hive jars are already in classpath. We can possibly raise an 
error or warning from Sentry service if that's the case.

> Sentry Service does not use correct classpath when HIVE_HOME environment var 
> is defined
> ---------------------------------------------------------------------------------------
>
>                 Key: SENTRY-430
>                 URL: https://issues.apache.org/jira/browse/SENTRY-430
>             Project: Sentry
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Lenni Kuff
>            Assignee: Arun Suresh
>
> When HIVE_HOME is set as an environment variable, the Sentry Service will not 
> run with the correct classpath when invoked using "bin/sentry". 
> The code below is from "bin/sentry". Note how if HIVE_HOME is defined nothing 
> from lib/server/* is added to the classpath.
> As a side note, it seems strange that there even is a reference to Hive in 
> this context. It seems that the sentry service is being executed via Hive 
> when HIVE_HOME is defined. It seems like we should not do this.
> {code}
> if [[ -z "$HIVE_HOME" ]]
> then
>   for f in ${SENTRY_HOME}/lib/server/*.jar; do
>     HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${f}
>   done
>   exec $HADOOP jar ${SENTRY_HOME}/lib/${_CMD_JAR} 
> org.apache.sentry.SentryMain ${args[@]}
> else
>   _HIVE_CMD=${HIVE_HOME}/bin/hive
>   ${_HIVE_CMD} --service jar ${SENTRY_HOME}/lib/${_CMD_JAR} 
> org.apache.sentry.SentryMain ${args[@]}
> fi
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to