You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Richard Calaba (JIRA)" <ji...@apache.org> on 2016/06/02 22:18:59 UTC
[jira] [Updated] (KYLIN-1759) SELECT from Sub-Query - SUPPORTED ???
[ https://issues.apache.org/jira/browse/KYLIN-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard Calaba updated KYLIN-1759:
----------------------------------
Description:
Hello,
I have a question / ask ... does Kylin Query processor supports SELECT from sub-query ????
In particular I need somethink like this:
SELECT group_id, AVG(sales)
FROM
( SELECT group_id, transaction_id, AVG(sale) as sales
FROM FACT_TABLE
WHERE .....
GROUP BY group_id, transaction_id
)
GROUP BY group_id
The reason I need sub-query is that there is one to many relations between the transaction / customer in the FACT table
Example:
Group 1, trans_1, customer1, sales=5
Group 1, trans_1, customer2, sales=11
Group 1, trans_2, customer3, sales=10
So Avg sales per Trans_1 is 8 and overall Avg sales over all unique transactions is thus 9. Which is what I need.
If I would take only avg across all transactions (within the group) than because of non-unique transactions within the group I would get incorrect 8.66.
Is this query from sub-query supported in Kylin ???
was:
Hello,
I have a question / ask ... does Kylin Query processor supports SELECT from sub-query ????
In particular I need somethink like this:
SELECT group_id, AVG(sales)
FROM
( SELECT group_id, transaction_id, AVG(sale) as sales
FROM FACT_TABLE
WHERE .....
GROUP BY group_id, transaction_id
)
GROUP BY group_id
The reason I need sub-query is that there is one to many relations between
Example:
Group 1, trans_1, customer1, sales=5
Group 1, trans_1, customer2, sales=11
Group 1, trans_2, customer3, sales=10
So Avg sales per Trans_1 is 8 and overall Avg sales over all unique transactions is thus 9. Which is what I need.
If I would take only avg across all transactions (within the group) than because of non-unique transactions within the group I would get incorrect 8.66.
Is this query from sub-query supported in Kylin ???
> SELECT from Sub-Query - SUPPORTED ???
> -------------------------------------
>
> Key: KYLIN-1759
> URL: https://issues.apache.org/jira/browse/KYLIN-1759
> Project: Kylin
> Issue Type: Bug
> Affects Versions: v1.5.2
> Reporter: Richard Calaba
>
> Hello,
> I have a question / ask ... does Kylin Query processor supports SELECT from sub-query ????
> In particular I need somethink like this:
> SELECT group_id, AVG(sales)
> FROM
> ( SELECT group_id, transaction_id, AVG(sale) as sales
> FROM FACT_TABLE
> WHERE .....
> GROUP BY group_id, transaction_id
> )
> GROUP BY group_id
> The reason I need sub-query is that there is one to many relations between the transaction / customer in the FACT table
> Example:
>
> Group 1, trans_1, customer1, sales=5
> Group 1, trans_1, customer2, sales=11
> Group 1, trans_2, customer3, sales=10
> So Avg sales per Trans_1 is 8 and overall Avg sales over all unique transactions is thus 9. Which is what I need.
> If I would take only avg across all transactions (within the group) than because of non-unique transactions within the group I would get incorrect 8.66.
> Is this query from sub-query supported in Kylin ???
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)