Hive Query

2015-06-02 Thread Teja Kunapareddy
Ravi, Use if condition .. it works .. UseISNOTNULL instead, and give the replace field as third parameter for if condition. NOTE: false and null are together in if condition If(ISNOTNULL(sum(columnname), sum(columnname),0) as sumVendor Regards, Teja

Re: Write access to wiki

2015-06-02 Thread Lefty Leverenz
Done. Welcome to the Hive wiki team, Anant! -- Lefty On Tue, Jun 2, 2015 at 9:57 PM, anant nag wrote: > Hi, > > I want to update the Hive Cli documentation with the information on how to > use the feature added in HIVE-9664( Hive add jar command should be able to > download and add jars from a

Null condition hive query

2015-06-02 Thread Ravisankar Mani
Hi Everyone, I need to check condition measure value is null or not. If it is null is then replace 0 otherwise in returns same values It is a sample sql query SELECT ISNULL(SUM(CAST([Purchasing].[Vendor].[BusinessEntityID] AS decimal(38,6))),0) AS [BusinessEntityID], [Purchasing].[Vendor].[Ac

Write access to wiki

2015-06-02 Thread anant nag
Hi, I want to update the Hive Cli documentation with the information on how to use the feature added in HIVE-9664( Hive add jar command should be able to download and add jars from a repository). Could you please provide me write access to the wiki. My confluence username is *nntnag17* Thanks, -

Re: HIve Joins vs Pig Joins

2015-06-02 Thread Ritesh Kumar Singh
Check this paper : Pig-Hive benchmarks Discusses these things in details. Cheers, Ritesh On Tue, Jun 2, 2015 at 11:32 AM, sreejesh s wrote: > Hi, > > I have read couple of articles that say pig joins perform better

Re: NoSuchMethodError when hive.execution.engine value its tez

2015-06-02 Thread Gopal Vijayaraghavan
> I am using *hive 1.0.0* and *apache tez 0.4.1* When I configure hive to use > tez I get an exception. Use the tez.version that hive-1.0.0 is tested with ­ 0.5.2 (https://github.com/apache/hive/blob/branch-1.0/pom.xml#L155) I suspect you¹ll get several build failures trying to build 1.0.0 agains

Re: Hive over JDBC: Retrieving job Id and status

2015-06-02 Thread Hari Subramaniyan
Hi Kiran, You can find the API documentation for hive here : http://hive.apache.org/javadocs/r1.2.0/api/ For an earlier version, please make sure to look at the correct one from http://hive.apache.org/javadocs/ Thanks Hari __

Re: NoSuchMethodError when hive.execution.engine value its tez

2015-06-02 Thread Sateesh Karuturi
I am using *hive 1.0.0* and *apache tez 0.4.1* When I configure hive to use tez I get an exception. In *hive-site.xml* when the *hive.execution.engine* value is mr its works fine. But if I set it to tez I get this error: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tez.mapr

HIve Joins vs Pig Joins

2015-06-02 Thread sreejesh s
Hi, I have read couple of articles that say pig joins perform better compared to Hive joins... Is that true ? if Yes could you please explain the reason. Thanks

Re: current_date function in hive

2015-06-02 Thread Gopal Vijayaraghavan
Hi, > You may try to_date(FROM_UNIXTIME(UNIX_TIMESTAMP())) That would be a very bad idea for query correctness. The current_date UDF was introduced because of that particular anti-pattern. The unix_timestamp() is evaluated when a row is read, so each row gets a slightly different timestamp when

RE: current_date function in hive

2015-06-02 Thread Mich Talebzadeh
How about using individual data functions on crdatetime (in my case op_time) Something like INSERT OVERWRITE TABLE tmp SELECT rs.op_type, rs.year, rs.Month, rs.Day, rs.Total_Rows FROM ( SELECT op_type , YEAR(op_time) As Year , MONTH(op_time) AS Month

Re: current_date function in hive

2015-06-02 Thread Bhagwan S. Soni
Use "from_unixtime(unix_timestamp())". This might help you to get what you want. You may have to split date and time because this function will returns TIMESTAMP. On Tue, Jun 2, 2015 at 7:49 PM, Ayazur Rehman wrote: > Hi everyone, > > I am trying to schedule a hive query using Oozie, to perform

Re: current_date function in hive

2015-06-02 Thread DU DU
You may try to_date(FROM_UNIXTIME(UNIX_TIMESTAMP())) On Tue, Jun 2, 2015 at 10:19 AM, Ayazur Rehman wrote: > Hi everyone, > > I am trying to schedule a hive query using Oozie, to perform aggregation > on a table on data of a particular day and save the results in another > table whenever every 2

current_date function in hive

2015-06-02 Thread Ayazur Rehman
Hi everyone, I am trying to schedule a hive query using Oozie, to perform aggregation on a table on data of a particular day and save the results in another table whenever every 24 hours. the schema of my table is something like (tablename - currenttable) id string cdatetime

NoSuchMethodError when hive.execution.engine value its tez

2015-06-02 Thread Sateesh Karuturi
I am using *hive 1.0.0* and *apache tez 0.4.1* When I configure hive to use tez I get an exception. In *hive-site.xml* when the *hive.execution.engine* value is mr its works fine. But if I set it to tez I get this error: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.tez.mapr

Re: Keys in Hive

2015-06-02 Thread Prem Yadav
I believe there is support for primary key which is basically UNIQUE NOT NULL constraint. Ravi, what is the error you are getting? On Tue, Jun 2, 2015 at 2:20 PM, Edward Capriolo wrote: > Hive does not support primary key or other types of index constraints. > > On Tue, Jun 2, 2015 at 4:37 AM,

Re: Keys in Hive

2015-06-02 Thread Edward Capriolo
Hive does not support primary key or other types of index constraints. On Tue, Jun 2, 2015 at 4:37 AM, Ravisankar Mani < ravisankarm...@syncfusion.com> wrote: > Hi everyone, > > > > I am unable to create an table in hive with primary key > > Example : > > > > create table Hivetable((name string)

Re: Regarding Views In Hive Query

2015-06-02 Thread Chinna Rao Lalam
In hive 'show views' is not supported.. Go through the below link it may give some pointers.. http://grokbase.com/t/hive/user/1275vp3bfc/how-to-list-all-views On Tue, Jun 2, 2015 at 1:01 PM, Ravisankar Mani < ravisankarm...@syncfusion.com> wrote: > Hi Everyone, > > > >

Re: Tables affected by a query

2015-06-02 Thread Chinna Rao Lalam
To get table access info, need to enable this "hive.stats.collect.tablekeys" property.. By default it is false.. Hope It Helps, Chinna On Tue, Jun 2, 2015 at 2:45 PM, Amitosh Anand, IDD M Tech, Computer Sci. & Engg., IIT (BHU) Varanasi wrote: > Hi, > > I have been trying to build a hook for hiv

Re: Tables affected by a query

2015-06-02 Thread r7raul1...@163.com
http://stackoverflow.com/questions/17461932/hive-execution-hook r7raul1...@163.com From: Amitosh Anand, IDD M Tech, Computer Sci. & Engg., IIT (BHU) Varanasi Date: 2015-06-02 17:45 To: user Subject: Tables affected by a query Hi, I have been trying to build a hook for hive. I require to get t

Re: Tables affected by a query

2015-06-02 Thread r7raul1...@163.com
My example: package com.yhd.hive.hook; import java.io.PrintStream; import org.apache.hadoop.hive.ql.parse.HiveParser; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Queue; import

Tables affected by a query

2015-06-02 Thread Amitosh Anand, IDD M Tech, Computer Sci. & Engg., IIT (BHU) Varanasi
Hi, I have been trying to build a hook for hive. I require to get the tables affected by a query. I have tried to use HookContext.getQueryPlan ().getTableAccessInfo () . It is giving null value for select and create and load data query. Similar is the case with other methods. Please provide info

Re: Keys in Hive

2015-06-02 Thread 김영우
Hi Ravisankar, Hive tables do not have primary keys. See HIVE-6905 Thanks, Youngwoo On Tue, Jun 2, 2015 at 5:37 PM, Ravisankar Mani < ravisankarm...@syncfusion.com> wrote: > Hi everyone, > > > > I am unable to create an table in hive with primary key > > Example : > > > > create table Hivetab

RE: Top N list in Hive

2015-06-02 Thread Lonikar, Kiran
How about: select * from Customers limit 2; select * from Customers order by salary limit 2; From: Ravisankar Mani [mailto:ravisankarm...@syncfusion.com] Sent: Tuesday, June 02, 2015 2:12 PM To: user@hive.apache.org Subject: Top N list in Hive Hi Everyone, I am unable to get top N list when usin

Top N list in Hive

2015-06-02 Thread Ravisankar Mani
Hi Everyone, I am unable to get top N list when using Hive guery. But I get top N list properly in sql Example "SELECT TOP 2 * FROM Customers" Could you please provide other way to find top n tables Regards, Ravisankar M R

Keys in Hive

2015-06-02 Thread Ravisankar Mani
Hi everyone, I am unable to create an table in hive with primary key Example : create table Hivetable((name string),primary key(name)); Could please help about the primary key query? Regards, Ravisankar M R

Regarding Views In Hive Query

2015-06-02 Thread Ravisankar Mani
Hi Everyone, I have one clarification about views query. I can able to create views using corresponding hive query. But I not able to get 'views list 'in a database like 'show tables'. Can you help about this query? Regards, Ravisankar M R