Skip to main content

Partitioning

Tables can become quite big in a Tabular model, when it is getting too big, it is possible to split the table into multiple partitions. A table always has at least one partition. Partitioning just means splitting the table in multiple parts. From the users perspective it still looks like one big table. There are multiple possibilities to set up partitioning.

In EasyTabular it is possible to setup a couple of partition types, which supports a broad range of common use-cases. The following options can be provided:

ParametersDescription
GroupNameGroupname of the partion (if not provided, the name of partitionsouce is used)
PartitionSourceThe source table that is queried on the datasource (required)
PartitionSchemaThe source schema that is used on the datasource (if not provided the schema from the configuration is used)
PartitionFilterThe filter that is set on the source, only relevant for partitiontype = Filter
PartitionStartThe period where to start
PartitionEndThe number of partitions to create (Positive whole number)
PartitionSizeThe size of every partition, default = 1. For a partition per 2 years, set to 2, for 3 years, set to 3 and so on. Positive whole number expected
PartitionTypeThe filter type that is applied
PartitionFilterColumnThe column that is used for the filter in the wherestatement. It is possible to apply extra statements like YEAR(datecolumn) for example
HasPartitionLeftOverA partition is created for all te data outside the scope that is defined. Only data that is > than the last partition is added. This can be turned off (default = true)

Partition Types

TypeDescription
AllNo filter is applied on the given partitionsource
FilterPartition filter is applied on the given partitionsource
yyyyFilter is applied on partition filter column and the year month in (ex. 2021 for 2021) is applied on the column as a filter
yyyyMMFilter is applied on partition filter column and the year month in (ex. 202111 for november 2021) is applied on the column as a filter
yyyyMMddFilter is applied on partition filter column and the year month and day (ex. 20211101 for the 1st of november 2021) is applied on the column as a filter

All

The chosen partition type needs specific settings. The easiest is 'All', which just requires a partition source (a table or other queryable object in the data source). The generator will just add a partition with one simple query without a where statement.

- Table:
Name: Finance
Partitions:
- PartitionSchema: dm
PartitionSource: F_FinanceData

Filter

With the type 'filter' it is possible to set a hard filter, that will be added to the query. A couple of examples:

- Table:
Name: Finance
Partitions:
- PartitionSchema: dm
PartitionSource: F_FinanceData
PartitionFilter: Year(TransactionDate) = 2024

yyyy or yyyyMM or yyyyMMdd

With one of those types, it is possible to create a couple of partitions, based on parameters. In this case the example is based on yyyy (Year values). To know how many partitions should be created, the following information is needed:

ParametersDescription
PartitionStartThe period where to start
PartitionEndThe number of partitions to create (Positive whole number)
PartitionSizeThe size of every partition, default = 1. For a partition per 2 years, set to 2, for 3 years, set to 3 and so on. Positive whole number expected
PartitionTypeThe filter type that is applied
PartitionFilterColumnThe column that is used for the filter in the wherestatement. It is possible to apply extra statements like YEAR(datecolumn) for example
HasPartitionLeftOverA partition is created for all te data outside the scope that is defined. Only data that is > than the last partition is added. This can be turned off (default = true)

This will create 7 partitions, based on year. 6 partitions with a filter on a specific year from 2020 till 2026. And a 'leftover' partition for everything greater than 2026.

- Table:
Name: Finance
Partitions:
- PartitionSchema: dm
PartitionSource: F_FinanceData
PartitionStart: 2020
PartitionEnd: 6
PartitionType: yyyy
HasPartitionLeftOver: true
PartitionFilterColumn: YEAR(TransactionDate)

Another example based on per 2-months and no left over partition. This will create 6 partitions for the year 2020 and 6 partitions for the year 2021:

- Table:
Name: Finance
Partitions:
- PartitionSchema: dm
PartitionSource: F_FinanceData
PartitionStart: 202001
PartitionSize: 2
PartitionEnd: 12
PartitionType: yyyyMM
HasPartitionLeftOver: false
PartitionFilterColumn: CONCAT(YEAR(TransactionDate), RIGHT(CONCAT('0', MONTH(TransactionDate)),2))

It is possible to create multiple types of partitions per table, so mixing different types is no problem.