Try putting " -e "use db_stage;show tables"  in a file instead and do

 

bl -f <FILE_NAME>

 

HTH

 

Dr Mich Talebzadeh

 

LinkedIn  
https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw

 

Sybase ASE 15 Gold Medal Award 2008

A Winning Strategy: Running the most Critical Financial Data on ASE 15

http://login.sybase.com/files/Product_Overviews/ASE-Winning-Strategy-091908.pdf

Author of the books "A Practitioner’s Guide to Upgrading to Sybase ASE 15", 
ISBN 978-0-9563693-0-7. 

co-author "Sybase Transact SQL Guidelines Best Practices", ISBN 
978-0-9759693-0-4

Publications due shortly:

Complex Event Processing in Heterogeneous Environments, ISBN: 978-0-9563693-3-8

Oracle and Sybase, Concepts and Contrasts, ISBN: 978-0-9563693-1-4, volume one 
out shortly

 

http://talebzadehmich.wordpress.com <http://talebzadehmich.wordpress.com/> 

 

NOTE: The information in this email is proprietary and confidential. This 
message is for the designated recipient only, if you are not the intended 
recipient, you should destroy it immediately. Any information in this message 
shall not be understood as given or endorsed by Peridale Technology Ltd, its 
subsidiaries or their employees, unless expressly so stated. It is the 
responsibility of the recipient to ensure that this email is virus free, 
therefore neither Peridale Ltd, its subsidiaries nor their employees accept any 
responsibility.

 

From: Trainee Bingo [mailto:trainee1...@gmail.com] 
Sent: 14 January 2016 11:10
To: user@hive.apache.org
Subject: Re: Passing parameters to Beeline

 

My command is:

 

beeline -u "jdbc:hive2://<hostname>:10001/;principal=hive/<hostname>@<a.b.c.com 
<http://a.b.c.com> 
>?hive.server2.transport.mode=http;hive.server2.thrift.http.path=cliservice" -e 
"use db_stage;show tables"

 

Error:

scan complete in 4ms

Connecting to 
jdbc:hive2://<hostname>:10001/;principal=hive/<hostname>@<a.b.c.com 
<http://a.b.c.com> 
>?hive.server2.transport.mode=http;hive.server2.thrift.http.path=cliservice

Connected to: Apache Hive (version 0.13.0.2.1.7.0-784)

Driver: Hive JDBC (version 0.13.0.2.1.7.0-784)

Transaction isolation: TRANSACTION_REPEATABLE_READ

Error: Error while compiling statement: FAILED: ParseException line 1:12 
missing EOF at ';' near 'db_stage' (state=42000,code=40000)

Beeline version 0.13.0.2.1.7.0-784 by Apache Hive

Closing: 0: jdbc:hive2://<hostname>:10001/;principal=hive/<hostname>@<a.b.c.com 
<http://a.b.c.com> 
>?hive.server2.transport.mode=http;hive.server2.thrift.http.path=cliservice

 

 

 

 

On Thu, Jan 14, 2016 at 4:29 PM, Mich Talebzadeh <m...@peridale.co.uk 
<mailto:m...@peridale.co.uk> > wrote:

That should work. No need for \

 

bl -e "use test;show tables"

 

No rows affected (0.026 seconds)

+----------------+--+

|    tab_name    |

+----------------+--+

| t              |

| txtest         |

+----------------+--+

 

My bl is aliased as below

 

bl='beeline -u jdbc:hive2://rhes564.hedani.co <http://rhes564.hedani.co> 
,:10010/default org.apache.hive.jdbc.HiveDriver -n <USER> -p <PASSWORD> -i 
/home/<USER>/dba/bin/hive_on_spark_init.hql'

 

HTH

 

Dr Mich Talebzadeh

 

LinkedIn  
https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw

 

Sybase ASE 15 Gold Medal Award 2008

A Winning Strategy: Running the most Critical Financial Data on ASE 15

http://login.sybase.com/files/Product_Overviews/ASE-Winning-Strategy-091908.pdf

Author of the books "A Practitioner’s Guide to Upgrading to Sybase ASE 15", 
ISBN 978-0-9563693-0-7. 

co-author "Sybase Transact SQL Guidelines Best Practices", ISBN 
978-0-9759693-0-4

Publications due shortly:

Complex Event Processing in Heterogeneous Environments, ISBN: 978-0-9563693-3-8

Oracle and Sybase, Concepts and Contrasts, ISBN: 978-0-9563693-1-4, volume one 
out shortly

 

http://talebzadehmich.wordpress.com <http://talebzadehmich.wordpress.com/> 

 

NOTE: The information in this email is proprietary and confidential. This 
message is for the designated recipient only, if you are not the intended 
recipient, you should destroy it immediately. Any information in this message 
shall not be understood as given or endorsed by Peridale Technology Ltd, its 
subsidiaries or their employees, unless expressly so stated. It is the 
responsibility of the recipient to ensure that this email is virus free, 
therefore neither Peridale Ltd, its subsidiaries nor their employees accept any 
responsibility.

 

From: Trainee Bingo [mailto:trainee1...@gmail.com 
<mailto:trainee1...@gmail.com> ] 
Sent: 14 January 2016 10:41
To: user@hive.apache.org <mailto:user@hive.apache.org> 
Subject: Re: Passing parameters to Beeline

 

Thanks Maciek !!!!!

 

Another issue is I am using Hive 0.13.0.2.1.7.0-784  and Beeline version 
0.13.0.2.1.7.0-784 by Apache Hive.

 

I am able to execute:

          hive -e "use db_test; show tables"

 

But while executing same in beeline gives error:

          beeline -u "<details>" -e "use db_test; show tables"

                                   OR

          beeline -u "<details>" -e "use db_test \; show tables"

 

 

 

Error:ParseException line 1:13 missing EOF at ''\ ;'' near 'db_test' 
(state=42000,code=40000)

 

 

On Wed, Jan 13, 2016 at 10:14 PM, matshyeq <matsh...@gmail.com 
<mailto:matsh...@gmail.com> > wrote:

Try --hivevar name=value

works for hive and should work for beeline too:

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline–NewCommandLineShell
 
<https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93NewCommandLineShell>
 




Thank you,

Kind Regards 

~Maciek

 

On 13 January 2016 at 12:43, Trainee Bingo <trainee1...@gmail.com 
<mailto:trainee1...@gmail.com> > wrote:

Hi All,

 

Hope all are enjoying working in hive !!!

 

I am having one question regarding hive and beeline:

 

I am passing parameters to hive script using "-d". 

    Eg: hive -d table_name -f emp.hql

 

     emp.hql:

        CREATE EXTERNAL TABLE ${table_name}

            (

                  ID STRING,

                  NAME STRING

             ) ..............

 

It works perfectly fine.

 

But when I switch to beeline, beeline doesn't support "-d". Is there any way so 
that beeline accepts parameters in form of "-d".

 

 

 

Reply via email to