You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by Li Yang <li...@apache.org> on 2016/10/28 06:58:28 UTC

TblColRef redesign and snowflake schema support

Hi Kylin developers

Want to get your attention of the recent redesign of TblColRef on master
branch.

As a prerequisite of snowflake support, I'm working on KYLIN-1971 recently.
The goal is to support a table appearing more than once in a model, e.g.
the COUNTRY lookup table may join the SALES fact table twice in a model,
once as the BUYER COUNTRY and a second time as the SELLER COUNTRY. Such use
case is not rare in real models.

In order to support such usage, a few redesign is made.

Firstly, an ALIAS is attached to every table in data model. So the COUNTRY
table can appear twice in the model, once as alias BUYER_COUNTRY and a
second time as SELLER_COUNTRY. In all places of model/cube definition,
ALIAS.COLUMN is used to refer to columns. If the alias is omitted, the
column will be searched in all tables, such that existing model/cube does
not have to change. The metadata is backward compatible.

Secondly, a new class TableRef is introduced and the existing TblColRef is
redesigned. A TableRef is a Table bound to a model using an ALIAS;
similarly a TblColRef is a Column bound to a model through a reference to
TableRef.

Lastly, all usages of TblColRef are revised according to above design. For
places where needs a model related column, please use TblColRef; for places
where needs a pure table column, please use ColumnDesc.

New code shall follow the design too.

Cheers
Yang

Re: TblColRef redesign and snowflake schema support

Posted by Luke Han <lu...@gmail.com>.
Great step for snowflake, and for buyer & seller countries;-)


Best Regards!
---------------------

Luke Han

On Fri, Oct 28, 2016 at 10:58 PM, ShaoFeng Shi <sh...@apache.org>
wrote:

> Yang, it's very clear, got you;
>
> 2016-10-28 14:58 GMT+08:00 Li Yang <li...@apache.org>:
>
> > Hi Kylin developers
> >
> > Want to get your attention of the recent redesign of TblColRef on master
> > branch.
> >
> > As a prerequisite of snowflake support, I'm working on KYLIN-1971
> recently.
> > The goal is to support a table appearing more than once in a model, e.g.
> > the COUNTRY lookup table may join the SALES fact table twice in a model,
> > once as the BUYER COUNTRY and a second time as the SELLER COUNTRY. Such
> use
> > case is not rare in real models.
> >
> > In order to support such usage, a few redesign is made.
> >
> > Firstly, an ALIAS is attached to every table in data model. So the
> COUNTRY
> > table can appear twice in the model, once as alias BUYER_COUNTRY and a
> > second time as SELLER_COUNTRY. In all places of model/cube definition,
> > ALIAS.COLUMN is used to refer to columns. If the alias is omitted, the
> > column will be searched in all tables, such that existing model/cube does
> > not have to change. The metadata is backward compatible.
> >
> > Secondly, a new class TableRef is introduced and the existing TblColRef
> is
> > redesigned. A TableRef is a Table bound to a model using an ALIAS;
> > similarly a TblColRef is a Column bound to a model through a reference to
> > TableRef.
> >
> > Lastly, all usages of TblColRef are revised according to above design.
> For
> > places where needs a model related column, please use TblColRef; for
> places
> > where needs a pure table column, please use ColumnDesc.
> >
> > New code shall follow the design too.
> >
> > Cheers
> > Yang
> >
>
>
>
> --
> Best regards,
>
> Shaofeng Shi 史少锋
>

Re: TblColRef redesign and snowflake schema support

Posted by ShaoFeng Shi <sh...@apache.org>.
Yang, it's very clear, got you;

2016-10-28 14:58 GMT+08:00 Li Yang <li...@apache.org>:

> Hi Kylin developers
>
> Want to get your attention of the recent redesign of TblColRef on master
> branch.
>
> As a prerequisite of snowflake support, I'm working on KYLIN-1971 recently.
> The goal is to support a table appearing more than once in a model, e.g.
> the COUNTRY lookup table may join the SALES fact table twice in a model,
> once as the BUYER COUNTRY and a second time as the SELLER COUNTRY. Such use
> case is not rare in real models.
>
> In order to support such usage, a few redesign is made.
>
> Firstly, an ALIAS is attached to every table in data model. So the COUNTRY
> table can appear twice in the model, once as alias BUYER_COUNTRY and a
> second time as SELLER_COUNTRY. In all places of model/cube definition,
> ALIAS.COLUMN is used to refer to columns. If the alias is omitted, the
> column will be searched in all tables, such that existing model/cube does
> not have to change. The metadata is backward compatible.
>
> Secondly, a new class TableRef is introduced and the existing TblColRef is
> redesigned. A TableRef is a Table bound to a model using an ALIAS;
> similarly a TblColRef is a Column bound to a model through a reference to
> TableRef.
>
> Lastly, all usages of TblColRef are revised according to above design. For
> places where needs a model related column, please use TblColRef; for places
> where needs a pure table column, please use ColumnDesc.
>
> New code shall follow the design too.
>
> Cheers
> Yang
>



-- 
Best regards,

Shaofeng Shi 史少锋