[jira] [Created] (HIVE-10996) Aggregation / Projection over Multi-Join Inner Query producing incorrect results

2015-06-12 Thread Gautam Kowshik (JIRA)
Gautam Kowshik created HIVE-10996:
-

 Summary: Aggregation / Projection over Multi-Join Inner Query 
producing incorrect results
 Key: HIVE-10996
 URL: https://issues.apache.org/jira/browse/HIVE-10996
 Project: Hive
  Issue Type: Bug
  Components: Hive
Affects Versions: 1.2.0, 1.0.0, 1.1.0
Reporter: Gautam Kowshik
Priority: Minor


We'v run this issue in Hive 1.1.0


The following query produces no results:


select s
from (
  select last.*, action.st2, action.n
  from (
select purchase.s, purchase.timestamp, max (mevt.timestamp) as 
last_stage_timestamp
from (select * from purchase_history) purchase
join (select * from cart_history) mevt
on purchase.s = mevt.s
where purchase.timestamp  mevt.timestamp
group by purchase.s, purchase.timestamp
  ) last
  join (select * from events) action
  on last.s = action.s and last.last_stage_timestamp = action.timestamp
) list;



While this one does produce results :

select *
from (
  select last.*, action.st2, action.n
  from (
select purchase.s, purchase.timestamp, max (mevt.timestamp) as 
last_stage_timestamp
from (select * from purchase_history) purchase
join (select * from cart_history) mevt
on purchase.s = mevt.s
where purchase.timestamp  mevt.timestamp
group by purchase.s, purchase.timestamp
  ) last
  join (select * from events) action
  on last.s = action.s and last.last_stage_timestamp = action.timestamp
) list;
1   21  20  Bob 1234
1   31  30  Bob 1234
3   51  50  Jeff1234

The setup to test this is:
create table purchase_history (s string, product string, price double, 
timestamp int);
insert into purchase_history values ('1', 'Belt', 20.00, 21);
insert into purchase_history values ('1', 'Socks', 3.50, 31);
insert into purchase_history values ('3', 'Belt', 20.00, 51);
insert into purchase_history values ('4', 'Shirt', 15.50, 59);

create table cart_history (s string, cart_id int, timestamp int);
insert into cart_history values ('1', 1, 10);
insert into cart_history values ('1', 2, 20);
insert into cart_history values ('1', 3, 30);
insert into cart_history values ('1', 4, 40);
insert into cart_history values ('3', 5, 50);
insert into cart_history values ('4', 6, 60);

create table events (s string, st2 string, n int, timestamp int);
insert into events values ('1', 'Bob', 1234, 20);
insert into events values ('1', 'Bob', 1234, 30);
insert into events values ('1', 'Bob', 1234, 25);
insert into events values ('2', 'Sam', 1234, 30);
insert into events values ('3', 'Jeff', 1234, 50);
insert into events values ('4', 'Ted', 1234, 60);


I realize select * and select s are not all that interesting in this context 
but what lead us to this issue was select count(distinct s) was not returning 
results. The above queries are the simplified queries that produce the issue. 

I will note that if I convert the inner join to a table and select from that 
the issue does not appear.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (HIVE-6411) Support more generic way of using composite key for HBaseHandler

2014-07-17 Thread Gautam Kowshik (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14065302#comment-14065302
 ] 

Gautam Kowshik commented on HIVE-6411:
--

Have we tried to back port this to Hive .13 .. This is a very useful feature to 
have for hive over hbase in the current stable version as well. If not i can 
try looking into this in a separate jira.

 Support more generic way of using composite key for HBaseHandler
 

 Key: HIVE-6411
 URL: https://issues.apache.org/jira/browse/HIVE-6411
 Project: Hive
  Issue Type: Improvement
  Components: HBase Handler
Reporter: Navis
Assignee: Navis
Priority: Minor
  Labels: TODOC14
 Fix For: 0.14.0

 Attachments: HIVE-6411.1.patch.txt, HIVE-6411.10.patch.txt, 
 HIVE-6411.11.patch.txt, HIVE-6411.2.patch.txt, HIVE-6411.3.patch.txt, 
 HIVE-6411.4.patch.txt, HIVE-6411.5.patch.txt, HIVE-6411.6.patch.txt, 
 HIVE-6411.7.patch.txt, HIVE-6411.8.patch.txt, HIVE-6411.9.patch.txt


 HIVE-2599 introduced using custom object for the row key. But it forces key 
 objects to extend HBaseCompositeKey, which is again extension of LazyStruct. 
 If user provides proper Object and OI, we can replace internal key and keyOI 
 with those. 
 Initial implementation is based on factory interface.
 {code}
 public interface HBaseKeyFactory {
   void init(SerDeParameters parameters, Properties properties) throws 
 SerDeException;
   ObjectInspector createObjectInspector(TypeInfo type) throws SerDeException;
   LazyObjectBase createObject(ObjectInspector inspector) throws 
 SerDeException;
 }
 {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-7104) Unit tests are disabled

2014-07-16 Thread Gautam Kowshik (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-7104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14064125#comment-14064125
 ] 

Gautam Kowshik commented on HIVE-7104:
--

can we  commit this back to 0.13.1 branch as well? hive 13.1 checkout doesn't 
run tests either.

 Unit tests are disabled
 ---

 Key: HIVE-7104
 URL: https://issues.apache.org/jira/browse/HIVE-7104
 Project: Hive
  Issue Type: Bug
Reporter: David Chen
Assignee: David Chen
 Fix For: 0.14.0

 Attachments: HIVE-7104.1.patch


 When I run {{mvn clean test -Phadoop-1|2}}, none of the unit tests are run. I 
 did a binary search through the commit logs and found that the change that 
 caused the unit tests to be disabled was the the change to the root pom.xml 
 in the patch for HIVE-7067 (e77f38dc44de5a9b10bce8e0a2f1f5452f6921ed). 
 Removing that change allowed the unit tests to be run again.



--
This message was sent by Atlassian JIRA
(v6.2#6252)