metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (METAMODEL-128) Ordering on aggregation value not working
Date Tue, 31 Mar 2015 06:18:53 GMT


ASF GitHub Bot commented on METAMODEL-128:

Github user kaspersorensen commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/metamodel/query/parser/ ---
    @@ -160,6 +164,14 @@ public SelectItem findSelectItem(String expression) throws MultipleSelectItemsPa
                     return new SelectItem(subQuerySelectItem, fromItem);
    +        //if the expression is alias of some select item defined return clone of that
select item
    +        List<SelectItem> allSelectItems = MetaModelHelper.getAllSelectItems(_query);
    --- End diff --
    Well actually MetaModel's query API still does not support sub-select, so no. But even
if it did, would it make sense to have an alias in the subquery that is then referred to in
the outer query? At least then it would also be qualified I think, a la:
    SELECT ..., (SELECT name as n FROM ...) AS q FROM ... WHERE q.n = 'foo'
    But to summarize: I don't think this is a scenario we need to cover at all since only
regular subqueries (in the FROM clause) is supported in MetaModel at the moment.

> Ordering on aggregation value not working
> -----------------------------------------
>                 Key: METAMODEL-128
>                 URL:
>             Project: Apache MetaModel
>          Issue Type: Bug
>    Affects Versions: 4.3.2
>            Reporter: Ashish Mukherjee
> I am using a CSV Data Context example with multiple fields - occurrences, first_name,
> The query -
> SELECT SUM(persons.csv.occurrences) AS X, persons.csv.first_name FROM ashish.persons.csv
GROUP BY persons.csv.first_name ORDER BY X
> This query always orders the results by first_name and not the aggregation value.

This message was sent by Atlassian JIRA

View raw message