hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjay Subramanian <Sanjay.Subraman...@wizecommerce.com>
Subject Re: How to Disable Hive CLI interactive mode
Date Thu, 16 May 2013 01:19:50 GMT
I think this will work….with some tweaks
thanks a ton
sanjay

From: Stephen Sprague <spragues@gmail.com<mailto:spragues@gmail.com>>
Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Date: Wednesday, May 15, 2013 6:17 PM
To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Subject: Re: How to Disable Hive CLI interactive mode

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 <Sanjay.Subramanian@wizecommerce.com<mailto:Sanjay.Subramanian@wizecommerce.com>>
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 <spragues@gmail.com<mailto:spragues@gmail.com>>
Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
Date: Wednesday, May 15, 2013 5:28 PM
To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>>
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 <Sanjay.Subramanian@wizecommerce.com<mailto:Sanjay.Subramanian@wizecommerce.com>>
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<http://mapred.job.name> is deprecated. Instead, use mapreduce.job.name<http://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)
    at org.apache.hadoop.hive.metastore.api.Index.write(Index.java:1085)
    at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_index_args.write(ThriftHiveMetastore.java:53243)
    at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
    at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_add_index(ThriftHiveMetastore.java:1816)
    at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.add_index(ThriftHiveMetastore.java:1807)
    at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createIndex(HiveMetaStoreClient.java:868)
    at org.apache.hadoop.hive.ql.metadata.Hive.createIndex(Hive.java:721)
    ... 17 more

2013-04-30 17:11:42,656 ERROR ql.Driver (SessionState.java:printError(403)) - FAILED: Execution
Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

CONFIDENTIALITY NOTICE
======================
This email message and any attachments are for the exclusive use of the intended recipient(s)
and may contain confidential and privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please contact the sender
by reply email and destroy all copies of the original message along with any attachments,
from your computer system. If you are the intended recipient, please be advised that the content
of this message is subject to access, review and disclosure by the sender's Email System Administrator.


CONFIDENTIALITY NOTICE
======================
This email message and any attachments are for the exclusive use of the intended recipient(s)
and may contain confidential and privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please contact the sender
by reply email and destroy all copies of the original message along with any attachments,
from your computer system. If you are the intended recipient, please be advised that the content
of this message is subject to access, review and disclosure by the sender's Email System Administrator.


CONFIDENTIALITY NOTICE
======================
This email message and any attachments are for the exclusive use of the intended recipient(s)
and may contain confidential and privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please contact the sender
by reply email and destroy all copies of the original message along with any attachments,
from your computer system. If you are the intended recipient, please be advised that the content
of this message is subject to access, review and disclosure by the sender's Email System Administrator.

Mime
View raw message