You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by Alessandro Portosa <al...@eng.it> on 2016/08/30 13:54:38 UTC

MetaModel wrongly parse query with IN clause

Dear all,
we are facing some trouble with the MetaModel (last release 4.5.1) and a
specific use of the IN clause with tuple. I have already added a issue on
JIRA (https://issues.apache.org/jira/browse/METAMODEL-1116), but this issue
is really blocking our development process...

Basically, if I parse this query (let's call it *newSqlQuery*):

> select *
> from SpagoBI.cd569eca_66d8_4106_b80c_d4d91fec3b5f
> where (1,store_type,region_id) IN ((1,'Deluxe Supermarket','26'))


with

>  Query query = pojoDataContext.parseQuery(newSqlQuery);


MetaModel gives as output the following parsed query:

> SELECT cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_id,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_type,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.region_id,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.sales_region_id,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_name,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_number,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_street_address,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_city,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_state,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_postal_code,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_country,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_manager,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_phone,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_fax,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.first_opened_date,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.last_remodel_date,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.store_sqft,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.grocery_sqft,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.frozen_sqft,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.meat_sqft,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.coffee_bar,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.video_store,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.salad_bar,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.prepared_food,
> cd569eca_66d8_4106_b80c_d4d91fec3b5f.florist

FROM SpagoBI.cd569eca_66d8_4106_b80c_d4d91fec3b5f

WHERE 1,store_type,region_id) IN ((1,'Deluxe Supermarket','26')


As you can see, brackets are missing in the resulting parsed query... This
happens when I use tuple (which I really need to use...).

Did anyone experience this problem??

Please let me know... :(

Regards,
Alessandro