Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - How to Disable Hive CLI interactive mode


Copy link to this message
-
Re: How to Disable Hive CLI interactive mode
Stephen Sprague 2013-05-16, 01:17
ok. so there you go.   IMO, you're going to have to create a custom wrapper
around hive so that your users find your wrapper (via PATH) before they
find the real hive executable.

Your wrapper checks for whatever you deem acceptable and if so calls the
real hive else errors out with your message.

pseudo-code:

#!/bin/bash
if [[ $#-eq 0 ]]; then
      echo "your message"
      exit 1;
else
      exec /path/to/real/hive $@
fi

there are other edge cases you may want to consider.  "hive -service cli"
would pass and you wouldn't want that but you get the idea i presume.

On Wed, May 15, 2013 at 5:32 PM, Sanjay Subramanian <
[EMAIL PROTECTED]> wrote:

>  Hi
> To clarify what I need is as follows
>
>  - User types *hive*
>  - Message is displayed "Cannot use *hive* without -e or -f options"
>
>
>   From: Stephen Sprague <[EMAIL PROTECTED]>
> Reply-To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Date: Wednesday, May 15, 2013 5:28 PM
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Subject: Re: How to Disable Hive CLI interactive mode
>
>   not sure i understand.  you're asking how to disable  "hive" (with no
> args)  [interactive mode]  yet still permit "hive -e" [batch mode]?
>
> if that's the case my proposal would be to have a wrapper around the hive
> executable and check if stdin is a tty.
>
> then again if i've completely misunderstood the question could you
> elaborate?
>
>
> On Wed, May 15, 2013 at 2:32 PM, Sanjay Subramanian <
> [EMAIL PROTECTED]> wrote:
>
>>  Hi
>> I want to disable Hive CLI interactive mode for Hive clients in
>> production accessing Hive. Mainly due to the following error…This error is
>> solved in future 0.10.0+ versions perhaps but unfortunately upgrading is
>> Not an option today since we are moving to production in the next few hours
>> !!! YEAH…First Hive deployment in production…Thanks guys for that Hive Book
>> and thanks all for your wonderful discussions and answers !
>>
>>  The second big project I am wrapping up is is moving to production on
>> June 1st
>>
>>  Thanks
>>
>>  sanjay
>>
>>
>>  2013-04-30 17:11:42,548 WARN  conf.Configuration
>> (Configuration.java:warnOnceIfDeprecated(808)) - mapred.job.name is
>> deprecated. Instead, use mapreduce.job.name
>> 2013-04-30 17:11:42,651 ERROR exec.Task
>> (SessionState.java:printError(403)) - FAILED: Error in metadata:
>> java.lang.NullPointerException
>> org.apache.hadoop.hive.ql.metadata.HiveException:
>> java.lang.NullPointerException
>>     at org.apache.hadoop.hive.ql.metadata.Hive.createIndex(Hive.java:724)
>>     at
>> org.apache.hadoop.hive.ql.exec.DDLTask.createIndex(DDLTask.java:856)
>>     at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:248)
>>     at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:153)
>>     at
>> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
>>     at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1331)
>>     at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1117)
>>     at org.apache.hadoop.hive.ql.Driver.run(Driver.java:950)
>>     at
>> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:258)
>>     at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:215)
>>     at
>> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:406)
>>     at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:744)
>>     at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:607)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>     at java.lang.reflect.Method.invoke(Method.java:597)
>>     at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
>> Caused by: java.lang.NullPointerException
>>     at
>> org.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:185)