You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by "liubo@fcyun.com" <li...@fcyun.com> on 2017/09/21 03:53:46 UTC

how to avoid the combination of this situation: " Apple company have a Nike store"?

hi, Thanks for your reading this first!


1.here's my tables:

t_deal_history is the fact table that  recording  every bill of a store.
t_store is the lookup table
t_company is the lookup  table, one company can have many stores in different place.



sample data for the tables:
t_compay:
company_idcompany_name
1NIKE
2Apple

t_store:

store_idstore_namecompany_id
1Nike Flagship store1
2Nike Shoes store1
3Apple NewYork2
4Apple Tokyo2


t_deal_history:

deal_history_idstore_idcompany_idbill_money
111100.00
221100.00
332100.00
442100.00

kylin model design:


Did this can occur a cubeid which " Apple company have a Nike store"?
how to avoid the combination of this situation?
Or, change t_deal_history don't join with t_store instead of join with t_company directly,  is it possible?


What's the right relationship between these three tables? any ideas? 



Thanks a lot.



liubo@fcyun.com

Re: Re: how to avoid the combination of this situation: " Apple company have a Nike store"?

Posted by Li Yang <li...@apache.org>.
> Kylin only support the Star model recently..

This is not correct. Kylin supports snowflake schema start from v2.0. You
are to setup all kinds of joins, including unlimited levels of lookup
tables.

On Sun, Sep 24, 2017 at 10:58 PM, liubo@fcyun.com <li...@fcyun.com> wrote:

> thanks for your reply.
>
> Yes, the compay_id in deal and store table are the same.  The buyer in the
> deal_history table I didn't include in this relationship. That's my fault.
> sorry for confusing.
>
> store_id and company_id are primary keys in tables respectively, t_store
> have a FK relationship with t_company throught company_id.
>
> I wondered is it possibe exist wrong  a cubeid through this relationship
> when the cube creation.
>
> Kylin only support the Star model recently, maybe My thoughts is
> unnecessary, the wrong cubeid of combiantion won't happen.
>
> Best Wishes
>
> Liu Bo
>
> ------------------------------
> liubo@fcyun.com
>
>
> *From:* Li Yang <li...@apache.org>
> *Date:* 2017-09-23 09:39
> *To:* user <us...@kylin.apache.org>; 崔苗 <cu...@danale.com>
> *Subject:* Re: how to avoid the combination of this situation: " Apple
> company have a Nike store"?
> OK. I saw two companies fields. One is on the deal table, the other is on
> the store table. Are they the same? Usually a deal has a buyer and a
> seller. Could they mean buyer company and seller company?
>
> On Thu, Sep 21, 2017 at 12:05 PM, 崔苗 <cu...@danale.com> wrote:
>
>> 如果一个store_id只属于一个company_id,你可以断开t_deal_history与t_company的连接
>> ,通过store_id可以间接对应到company_id和company_name,这样模型比较简单,也不会出现错误组合。
>>
>> ------------------------------------------------------------------
>> 发件人:liubo@fcyun.com <li...@fcyun.com>
>> 发送时间:2017年9月21日(星期四) 11:54
>> 收件人:user <us...@kylin.apache.org>
>> 主 题:how to avoid the combination of this situation: " Apple company have
>> a Nike store"?
>>
>> hi, Thanks for your reading this first!
>>
>>
>> 1.here's my tables:
>>
>> t_deal_history is the fact table that  recording  every bill of a store.
>> t_store is the lookup table
>> t_company is the lookup  table, one company can have many stores in
>> different place.
>>
>>
>>
>> sample data for the tables:
>> t_compay:
>> company_id company_name
>> 1 NIKE
>> 2 Apple
>>
>> t_store:
>>
>> store_id store_name company_id
>> 1 Nike Flagship store 1
>> 2 Nike Shoes store 1
>> 3 Apple NewYork 2
>> 4 Apple Tokyo 2
>>
>>
>> t_deal_history:
>>
>> deal_history_id store_id company_id bill_money
>> 1 1 1 100.00
>> 2 2 1 100.00
>> 3 3 2 100.00
>> 4 4 2 100.00
>>
>> kylin model design:
>>
>>
>> Did this can occur a cubeid which " Apple company have a Nike store"?
>> how to avoid the combination of this situation?
>> Or, change t_deal_history don't join with t_store instead of join with
>> t_company directly,  is it possible?
>>
>>
>> What's the right relationship between these three tables? any ideas?
>>
>>
>>
>> Thanks a lot.
>>
>> ------------------------------
>> liubo@fcyun.com
>>
>>
>

Re: Re: how to avoid the combination of this situation: " Apple company have a Nike store"?

Posted by "liubo@fcyun.com" <li...@fcyun.com>.
OK. I saw two companies fields. One is on the deal table, the other is on
the store table. Are they the same? Usually a deal has a buyer and a
seller. Could they mean buyer company and seller company?

On Thu, Sep 21, 2017 at 12:05 PM, 崔苗 <cu...@danale.com> wrote:

> 如果一个store_id只属于一个company_id,你可以断开t_deal_history与t_company的连接,通过store_
> id可以间接对应到company_id和company_name,这样模型比较简单,也不会出现错误组合。
>
> ------------------------------------------------------------------
> 发件人:liubo@fcyun.com <li...@fcyun.com>
> 发送时间:2017年9月21日(星期四) 11:54
> 收件人:user <us...@kylin.apache.org>
> 主 题:how to avoid the combination of this situation: " Apple company have a
> Nike store"?
>
> hi, Thanks for your reading this first!
>
>
> 1.here's my tables:
>
> t_deal_history is the fact table that  recording  every bill of a store.
> t_store is the lookup table
> t_company is the lookup  table, one company can have many stores in
> different place.
>
>
>
> sample data for the tables:
> t_compay:
> company_id company_name
> 1 NIKE
> 2 Apple
>
> t_store:
>
> store_id store_name company_id
> 1 Nike Flagship store 1
> 2 Nike Shoes store 1
> 3 Apple NewYork 2
> 4 Apple Tokyo 2
>
>
> t_deal_history:
>
> deal_history_id store_id company_id bill_money
> 1 1 1 100.00
> 2 2 1 100.00
> 3 3 2 100.00
> 4 4 2 100.00
>
> kylin model design:
>
>
> Did this can occur a cubeid which " Apple company have a Nike store"?
> how to avoid the combination of this situation?
> Or, change t_deal_history don't join with t_store instead of join with
> t_company directly,  is it possible?
>
>
> What's the right relationship between these three tables? any ideas?
>
>
>
> Thanks a lot.
>
> ------------------------------
> liubo@fcyun.com
>
>

Re: how to avoid the combination of this situation: " Apple company have a Nike store"?

Posted by Li Yang <li...@apache.org>.
OK. I saw two companies fields. One is on the deal table, the other is on
the store table. Are they the same? Usually a deal has a buyer and a
seller. Could they mean buyer company and seller company?

On Thu, Sep 21, 2017 at 12:05 PM, 崔苗 <cu...@danale.com> wrote:

> 如果一个store_id只属于一个company_id,你可以断开t_deal_history与t_company的连接,通过store_
> id可以间接对应到company_id和company_name,这样模型比较简单,也不会出现错误组合。
>
> ------------------------------------------------------------------
> 发件人:liubo@fcyun.com <li...@fcyun.com>
> 发送时间:2017年9月21日(星期四) 11:54
> 收件人:user <us...@kylin.apache.org>
> 主 题:how to avoid the combination of this situation: " Apple company have a
> Nike store"?
>
> hi, Thanks for your reading this first!
>
>
> 1.here's my tables:
>
> t_deal_history is the fact table that  recording  every bill of a store.
> t_store is the lookup table
> t_company is the lookup  table, one company can have many stores in
> different place.
>
>
>
> sample data for the tables:
> t_compay:
> company_id company_name
> 1 NIKE
> 2 Apple
>
> t_store:
>
> store_id store_name company_id
> 1 Nike Flagship store 1
> 2 Nike Shoes store 1
> 3 Apple NewYork 2
> 4 Apple Tokyo 2
>
>
> t_deal_history:
>
> deal_history_id store_id company_id bill_money
> 1 1 1 100.00
> 2 2 1 100.00
> 3 3 2 100.00
> 4 4 2 100.00
>
> kylin model design:
>
>
> Did this can occur a cubeid which " Apple company have a Nike store"?
> how to avoid the combination of this situation?
> Or, change t_deal_history don't join with t_store instead of join with
> t_company directly,  is it possible?
>
>
> What's the right relationship between these three tables? any ideas?
>
>
>
> Thanks a lot.
>
> ------------------------------
> liubo@fcyun.com
>
>

回复:how to avoid the combination of this situation: " Apple company have a Nike store"?

Posted by 崔苗 <cu...@danale.com>.
如果一个store_id只属于一个company_id,你可以断开t_deal_history与t_company的连接,通过store_id可以间接对应到company_id和company_name,这样模型比较简单,也不会出现错误组合。
------------------------------------------------------------------发件人:liubo@fcyun.com <li...@fcyun.com>发送时间:2017年9月21日(星期四) 11:54收件人:user <us...@kylin.apache.org>主 题:how to avoid the combination of this situation: " Apple company have a Nike store"?

hi, Thanks for your reading this first!


1.here's my tables:
t_deal_history is the fact table that  recording  every bill of a store.t_store is the lookup tablet_company is the lookup  table, one company can have many stores in different place.


sample data for the tables:t_compay:company_idcompany_name1NIKE2Apple
t_store:
store_idstore_namecompany_id1Nike Flagship store12Nike Shoes store13Apple NewYork24Apple Tokyo2

t_deal_history:
deal_history_idstore_idcompany_idbill_money111100.00221100.00332100.00442100.00
kylin model design:

Did this can occur a cubeid which " Apple company have a Nike store"?how to avoid the combination of this situation?Or, change t_deal_history don't join with t_store instead of join with t_company directly,  is it possible?

What's the right relationship between these three tables? any ideas? 


Thanks a lot.

liubo@fcyun.com