metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (METAMODEL-133) Support multiple consecutive join statements
Date Mon, 27 Apr 2015 17:39:38 GMT

    [ https://issues.apache.org/jira/browse/METAMODEL-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14514509#comment-14514509
] 

ASF GitHub Bot commented on METAMODEL-133:
------------------------------------------

GitHub user narahari92 opened a pull request:

    https://github.com/apache/metamodel/pull/20

    Metamodel 133

    Hi,
    
    This is a fix for METAMODEL-133 issue for supporting multiple joins. Please review.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/narahari92/metamodel METAMODEL-133

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metamodel/pull/20.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #20
    
----
commit fb9cfda8ca10937b7430d5546d1dee61d3ef07e6
Author: Hosur Narahari <hnr1992@gmail.com>
Date:   2015-04-26T17:40:09Z

    METAMODEL-133 fix

commit 0755a52e9e87a544c4dea46ad5a0e674ecb90f60
Author: Hosur Narahari <hnr1992@gmail.com>
Date:   2015-04-27T16:40:07Z

    METAMODEL-133 fix

commit 9c468fb623cdd67ecc5ffe9a51d561cfe23a1399
Author: Hosur Narahari <hnr1992@gmail.com>
Date:   2015-04-27T17:37:31Z

    METAMODEL-133 fix

----


> Support multiple consecutive join statements
> --------------------------------------------
>
>                 Key: METAMODEL-133
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-133
>             Project: Apache MetaModel
>          Issue Type: Improvement
>            Reporter: Francisco Javier Cano
>
> JOIN query:
> {code}
> SELECT c.name as category, l.name as language, COUNT(f.film_id) as films
> FROM category c
> INNER JOIN film_category fc ON c.category_id=fc.category_id
> INNER JOIN film f on f.film_id=fc.film_id
> INNER JOIN language l ON f.language_id = l.language_id
> GROUP BY c.name,l.name;
> {code}
> Error:
> {code}
> org.apache.metamodel.query.parser.QueryParserException: Not capable of parsing ON token:
fc.category_id INNER JOIN film f on f.film_id=fc.film_id INNER JOIN language l ON f.language_id
= l.language_id
> {code}
> I performed some debugging:
> {code}
> FromItemParser.java
> ...
> private SelectItem findSelectItem(String token, FromItem leftSide, FromItem rightSide)
{
>         // first look in the original query
>         SelectItemParser selectItemParser = new SelectItemParser(_query, false);
>         SelectItem result = selectItemParser.findSelectItem(token); -> TOKEN: fc.category_id
INNER JOIN film f on f.film_id=fc.film_id INNER JOIN language l ON f.language_id = l.language_id
> {code}



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

Mime
View raw message