You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by Tao Wong <wo...@gmail.com> on 2015/06/16 08:51:15 UTC

query without distinct returns only one row!

 when i execute the following sql in kylin :

SELECT LOOKUP_1.COLUMN_1_NAME
 FROM USER_FACT as FACT_TABLE
INNER JOIN DIM_PHONE as LOOKUP_1
ON FACT_TABLE.COLUMN_1_ID = LOOKUP_1.COLUMN_1_ID AND
FACT_TABLE.COLUMN_2_ID = LOOKUP_1.COLUMN_2_ID ;

it returns with only one row.

but when i add DISTINCT after SELECT

it returns many rows (which is correct!)
has anyone encounter this ?


Thanks

Re: query without distinct returns only one row!

Posted by hongbin ma <ma...@apache.org>.
afaik, kylin might behave abnormally when there's no group by in the
query.(because query runtime is getting results from pre-aggregated data in
HBASE)

try modify your query with a group by

On Tue, Jun 16, 2015 at 2:51 PM, Tao Wong <wo...@gmail.com> wrote:

>  when i execute the following sql in kylin :
>
> SELECT LOOKUP_1.COLUMN_1_NAME
>  FROM USER_FACT as FACT_TABLE
> INNER JOIN DIM_PHONE as LOOKUP_1
> ON FACT_TABLE.COLUMN_1_ID = LOOKUP_1.COLUMN_1_ID AND
> FACT_TABLE.COLUMN_2_ID = LOOKUP_1.COLUMN_2_ID ;
>
> it returns with only one row.
>
> but when i add DISTINCT after SELECT
>
> it returns many rows (which is correct!)
> has anyone encounter this ?
>
>
> Thanks
>



-- 
Regards,

*Bin Mahone | 马洪宾*
Apache Kylin: http://kylin.io
Github: https://github.com/binmahone

Re: query without distinct returns only one row!

Posted by hongbin ma <ma...@apache.org>.
​i opened a ticket for this:
https://issues.apache.org/jira/browse/KYLIN-833

however please do not expect it to be fixed in v0.6 or v0.7​

On Tue, Jun 16, 2015 at 2:51 PM, Tao Wong <wo...@gmail.com> wrote:

> when i execute the following sql in kylin :
>
> SELECT LOOKUP_1.COLUMN_1_NAME
>  FROM USER_FACT as FACT_TABLE
> INNER JOIN DIM_PHONE as LOOKUP_1
> ON FACT_TABLE.COLUMN_1_ID = LOOKUP_1.COLUMN_1_ID AND
> FACT_TABLE.COLUMN_2_ID = LOOKUP_1.COLUMN_2_ID ;
>
> it returns with only one row.
>
> but when i add DISTINCT after SELECT
>
> it returns many rows (which is correct!)
> has anyone encounter this ?
>




-- 
Regards,

*Bin Mahone | 马洪宾*
Apache Kylin: http://kylin.io
Github: https://github.com/binmahone