You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by hosur narahari <hn...@gmail.com> on 2018/09/25 16:26:01 UTC

Partition using surrogate date key

Hi,

During cube building, we can partition based on date and build the cube for
specific date range. It works fine when fact table has date column. But if
it has surrogate key pointing to lookup table of date dimension, we can't
directly give date format since surrogate key is just an integer and
partition only considers fact table.

Is there any way we can overcome this?

Best Regards,
Hari

Re: Partition using surrogate date key

Posted by ShaoFeng Shi <sh...@apache.org>.
Hi Hari,

You can define a customized partition condition builder. Please check the
following interfaces and two implementation classes:

org.apache.kylin.metadata.model.PartitionDesc.IPartitionConditionBuilder
org.apache.kylin.metadata.model.PartitionDesc.DefaultPartitionConditionBuilder
org.apache.kylin.metadata.model.PartitionDesc.YearMonthDayPartitionConditionBuilder

The partition builder class is configurable on data model, check this as an
example :

https://github.com/apache/kylin/blob/master/examples/sample_cube/template/model_desc/kylin_sales_model.json#L97


If you developed your implementation, adding the jar to $KYLIN_HOME/lib and
then restart Kylin;

hosur narahari <hn...@gmail.com> 于2018年9月26日周三 上午12:26写道:

> Hi,
>
> During cube building, we can partition based on date and build the cube
> for specific date range. It works fine when fact table has date column. But
> if it has surrogate key pointing to lookup table of date dimension, we
> can't directly give date format since surrogate key is just an integer and
> partition only considers fact table.
>
> Is there any way we can overcome this?
>
> Best Regards,
> Hari
>


-- 
Best regards,

Shaofeng Shi 史少锋