Re: How to create new table like existing with an extra column in single query.

2015-08-10 Thread venkatesh b
Thanks Adam.

As mentioned we have a need that in a single query it should be done, since
ours is an automated query generation and no manual interactions are done.

We need a query like

*Create table if not exists newTable like oldTable, newColumn datatype*

*Without copying data from oldTable. *


On Monday, August 10, 2015, LaStrange, Adam adam.lastra...@sig.com wrote:

 How about:



 create table XXX like YYY;

 alter table XXX add columns (new_column int);



 *From:* venkatesh b [mailto:venkateshmailingl...@gmail.com
 javascript:_e(%7B%7D,'cvml','venkateshmailingl...@gmail.com');]
 *Sent:* Monday, August 10, 2015 9:28 AM
 *To:* Wangwenli
 *Cc:* user
 *Subject:* Re: How to create new table like existing with an extra column
 in single query.



 Thanks Wenli for quick reply.



 Yes, we have a requirement exactly the same which you mentioned.



 I have tried the query which you provided but got an error saying that

 Invalid column reference for newColumn possible columns are ..







 Thanks

 Venkatesh

 On Monday, August 10, 2015, Wangwenli wangwe...@huawei.com
 javascript:_e(%7B%7D,'cvml','wangwe...@huawei.com'); wrote:

 something like this?

 create table newTable as select oldTable.*, newCol1,newCol2 from oldTable;


 --

 wenli

 Regards



 *From:* venkatesh b

 *Date:* 2015-08-10 20:54

 *To:* user

 *Subject:* How to create new table like existing with an extra column in
 single query.

 Hello,



 In hive we got a need that we need to create a new table like the old
 table with an extra column at run time. This must be done in a single
 query. No second query with alter table statement.



 Query like:



 Create table new_table like old_table , new_column datatype;



 Please help me out, searched in many forums but not found the solution.

 Please inform me if any other information is needed.



 Thanks  Regards

 Venkatesh


 --

 IMPORTANT: The information contained in this email and/or its attachments
 is confidential. If you are not the intended recipient, please notify the
 sender immediately by reply and immediately delete this message and all its
 attachments. Any review, use, reproduction, disclosure or dissemination of
 this message or any attachment by an unintended recipient is strictly
 prohibited. Neither this message nor any attachment is intended as or
 should be construed as an offer, solicitation or recommendation to buy or
 sell any security or other financial instrument. Neither the sender, his or
 her employer nor any of their respective affiliates makes any warranties as
 to the completeness or accuracy of any of the information contained herein
 or that this message or any of its attachments is free of viruses.



Hive CBO - Calcite Interface

2015-08-10 Thread Raajay
For a research project, I am studying the performance gains in Hive queries
achieved through cost based optimization. Rather than just study scenarios
where CBO is switched on or off, I would like to study the performance
across a “collection of query plans considered by the CBO (Calcite); for
example, the performance of the query plan with the least cost vs the
performance of query plan with next higher cost. Performance here is the
total completion time.

1. Currently, Hive gets only the least cost plan from Calcite. Is there an
interface to get alternate plans ? Say, all plans (read Operator trees)
with cost lesser than a threshold.

2. Is there an interface for Hive to get the absolute cost (based on Hive
Cost Factory) of a operator tree returned by Calcite ?

Thanks,
Raajay


Re: Persistent (and possibly asynchronous) Hive access from within Scala

2015-08-10 Thread Stephen Bly
We can use JDBC. But there’s also this new library 
http://hive.apache.org/javadocs/r1.1.1/api/org/apache/hive/jdbc/package-frame.html
 
http://hive.apache.org/javadocs/r1.1.1/api/org/apache/hive/jdbc/package-frame.html
 based on this Thrift interface 
(https://github.com/apache/hive/blob/0af6cb42725659740a022044c6cc464ef1cf4e6b/service/if/TCLIService.thrift
 
https://github.com/apache/hive/blob/0af6cb42725659740a022044c6cc464ef1cf4e6b/service/if/TCLIService.thrift)
 that supports sessions and async calls. But I don’t see how to use it exactly.

RE: How to create new table like existing with an extra column in single query.

2015-08-10 Thread LaStrange, Adam
How about:

create table XXX like YYY;
alter table XXX add columns (new_column int);

From: venkatesh b [mailto:venkateshmailingl...@gmail.com]
Sent: Monday, August 10, 2015 9:28 AM
To: Wangwenli
Cc: user
Subject: Re: How to create new table like existing with an extra column in 
single query.

Thanks Wenli for quick reply.

Yes, we have a requirement exactly the same which you mentioned.

I have tried the query which you provided but got an error saying that
Invalid column reference for newColumn possible columns are ..



Thanks
Venkatesh

On Monday, August 10, 2015, Wangwenli 
wangwe...@huawei.commailto:wangwe...@huawei.com wrote:
something like this?
create table newTable as select oldTable.*, newCol1,newCol2 from oldTable;


wenli
Regards

From: venkatesh 
bjavascript:_e(%7B%7D,'cvml','venkateshmailingl...@gmail.com');
Date: 2015-08-10 20:54
To: userjavascript:_e(%7B%7D,'cvml','user@hive.apache.org');
Subject: How to create new table like existing with an extra column in single 
query.
Hello,

In hive we got a need that we need to create a new table like the old table 
with an extra column at run time. This must be done in a single query. No 
second query with alter table statement.

Query like:

Create table new_table like old_table , new_column datatype;

Please help me out, searched in many forums but not found the solution.
Please inform me if any other information is needed.

Thanks  Regards
Venkatesh



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.


Re: Running hive on tez locally

2015-08-10 Thread Jason Dere
I have my HADOOP_CLASSPATH set to point to both $TEZ_HOME/* and 
$TEZ_HOME/lib/*. Also have TEZ_H0ME and TEZ_CONF_DIR set, though I'm not sure 
if these are required or not.?



From: Raajay raaja...@gmail.com
Sent: Friday, August 07, 2015 2:50 PM
To: user@hive.apache.org
Subject: Re: Running hive on tez locally

Thanks for the configs. When I run hive it crashes because TEZ libraries were 
not found.

How do I point Hive to tez libraries? Is it sufficient to populate CLASSPATH 
environment variables with location of tez libraries ?

Raajay



On Fri, Aug 7, 2015 at 3:16 PM, Jason Dere 
jd...@hortonworks.commailto:jd...@hortonworks.com wrote:

If you add these settings (paths are up to you), you can run Hive with Tez in 
local mode. You'll also need to make sure your classpath has the Tez libs etc.


set hive.user.install.directory=file:///tmp;
set fs.default.namehttp://fs.default.name=file:///;
set fs.defaultFS=file:///;
set tez.staging-dir=/tmp;
set tez.ignore.lib.uris=true;
set tez.runtime.optimize.local.fetch=true;
set tez.local.mode=true;
set hive.execution.engine=tez;?


?




From: Raajay raaja...@gmail.commailto:raaja...@gmail.com
Sent: Friday, August 07, 2015 1:06 PM
To: user@hive.apache.orgmailto:user@hive.apache.org
Subject: Running hive on tez locally

I have been running Hive queries on a single node (no HDFS). I realize that the 
queries get compiled as map-reduce jobs and not as TEZ jobs even though 
hive.execution.engine=tez is set.

Is that expected ? If yes, what is the ideal environment for debugging hive on 
tez?

Raajay



Re: Running hive on tez locally

2015-08-10 Thread Gopal Vijayaraghavan

 How do I point Hive to tez libraries? Is it sufficient to populate
CLASSPATH environment variables with location of tez libraries ?

The easiest option there is to populate the hive-config.sh with these two
parameters

https://github.com/t3rmin4t0r/tez-autobuild/blob/master/Makefile#L138


Once you do that, the bin/hive will always load the Tez jars correctly.

Cheers,
Gopal









Re: Request write access to the Hive wiki

2015-08-10 Thread Xuefu Zhang
Done!

On Mon, Aug 10, 2015 at 1:05 AM, Xu, Cheng A cheng.a...@intel.com wrote:

 Hi,

 I’d like to have write access to the Hive wiki. My Confluence username is
 cheng.a...@intel.com with Full Name “Ferdinand Xu”. Please help me deal
 with it. Thank you!



 Regards,

 Ferdinand Xu





Re: Request write access to the Hive wiki

2015-08-10 Thread Xuefu Zhang
I couldn't find your user id based on either your name or email address.
You probably need to register there first.

On Mon, Aug 10, 2015 at 12:41 PM, kulkarni.swar...@gmail.com 
kulkarni.swar...@gmail.com wrote:

 @Xuefu While you are already at it, would you mind giving me this access
 too? :)

 Thanks,

 On Mon, Aug 10, 2015 at 2:37 PM, Xuefu Zhang xzh...@cloudera.com wrote:

 Done!

 On Mon, Aug 10, 2015 at 1:05 AM, Xu, Cheng A cheng.a...@intel.com
 wrote:

 Hi,

 I’d like to have write access to the Hive wiki. My Confluence username
 is cheng.a...@intel.com with Full Name “Ferdinand Xu”. Please help me
 deal with it. Thank you!



 Regards,

 Ferdinand Xu







 --
 Swarnim



RE: Request write access to the Hive wiki

2015-08-10 Thread Xu, Cheng A
Thanks Xuefu.

From: Xuefu Zhang [mailto:xzh...@cloudera.com]
Sent: Tuesday, August 11, 2015 3:38 AM
To: user@hive.apache.org
Subject: Re: Request write access to the Hive wiki

Done!

On Mon, Aug 10, 2015 at 1:05 AM, Xu, Cheng A 
cheng.a...@intel.commailto:cheng.a...@intel.com wrote:
Hi,
I’d like to have write access to the Hive wiki. My Confluence username is 
cheng.a...@intel.commailto:cheng.a...@intel.com with Full Name “Ferdinand 
Xu”. Please help me deal with it. Thank you!

Regards,
Ferdinand Xu




How to create new table like existing with an extra column in single query.

2015-08-10 Thread venkatesh b
Hello,

In hive we got a need that we need to create a new table like the old table
with an extra column at run time. This must be done in a single query. No
second query with alter table statement.

Query like:

Create table new_table like old_table , new_column datatype;

Please help me out, searched in many forums but not found the solution.
Please inform me if any other information is needed.

Thanks  Regards
Venkatesh


Re: How to create new table like existing with an extra column in single query.

2015-08-10 Thread Wangwenli
something like this?
create table newTable as select oldTable.*, newCol1,newCol2 from oldTable;


wenli
Regards

From: venkatesh bmailto:venkateshmailingl...@gmail.com
Date: 2015-08-10 20:54
To: usermailto:user@hive.apache.org
Subject: How to create new table like existing with an extra column in single 
query.
Hello,

In hive we got a need that we need to create a new table like the old table 
with an extra column at run time. This must be done in a single query. No 
second query with alter table statement.

Query like:

Create table new_table like old_table , new_column datatype;

Please help me out, searched in many forums but not found the solution.
Please inform me if any other information is needed.

Thanks  Regards
Venkatesh