You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Santlal J Gupta <Sa...@bitwiseglobal.com> on 2016/09/01 11:54:24 UTC

Not able to use IN clause in multiple partition

Hi,

I am trying to use multiple partition column in IN clause using struct. I am getting StandardStructObjectInspector  exception.

I have tried below query.

hive> create table partm(f1 int, f2 int) partitioned by (f3 int , f4 int) row format delimited fields terminated by ','  stored as textfile location '/user/ojasd/warehouse/partm';
hive> insert into table partm partition (f3=2, f4=4) values(1,2);
hive> insert into table partm partition (f3=1, f4=3) values(2,4);
hive> insert into table partm partition (f3=6, f4=7) values(8,9);

hive> select * from partm;
OK
partm.f1        partm.f2        partm.f3        partm.f4
2                                 4                    1                        3
1                                 2                    2                        4
8                                9                    6                          7

hive> select  * from partm where f3=1 and f4=3;
OK
partm.f1  partm.f2  partm.f3  partm.f4
2                         4               1                   3

hive> select  * from partm where struct(f3,f4) IN (struct(1,3),struct(2,4));
FAILED: ClassCastException org.apache.hadoop.hive.serde2.objectinspector.StandardStructObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector

Can you point out is there anything wrong in this query.
I am using  Hive 1.1.0-cdh5.5.4 version

Thanks
Santlal J Gupta
**************************************Disclaimer****************************************** This e-mail message and any attachments may contain confidential information and is for the sole use of the intended recipient(s) only. Any views or opinions presented or implied are solely those of the author and do not necessarily represent the views of BitWise. If you are not the intended recipient(s), you are hereby notified that disclosure, printing, copying, forwarding, distribution, or the taking of any action whatsoever in reliance on the contents of this electronic information is strictly prohibited. If you have received this e-mail message in error, please immediately notify the sender and delete the electronic message and any attachments.BitWise does not accept liability for any virus introduced by this e-mail or any attachments. ********************************************************************************************