How to perform data modeling and pre-aggregation in Kylin?
In Kylin, data modeling and pre-aggregation are achieved through the construction of Cubes.
Data modeling mainly includes defining data source tables, defining dimension tables, defining measure tables, and defining Cubes. In Kylin, data models can be created through the Web UI or command line tools. First, the data source table, where the data comes from, needs to be defined. Then, dimension tables and measure tables are defined, with dimension tables describing the properties of business objects and measure tables describing the quantity of business objects. Finally, a Cube needs to be defined to combine the data source table, dimension tables, and measure tables for pre-aggregate calculations.
Pre-aggregation is achieved through the Cube Segment in the Cube. Multiple Cube Segments can be defined in the Cube, each corresponding to a specific time range or other conditions. Within the Cube Segment, pre-aggregation calculations can be performed to aggregate data based on different dimensions, speeding up query performance.
Overall, the data modeling and pre-aggregation in Kylin are achieved through the construction of Cubes, where data source tables, dimension tables, measure tables, and Cubes can be defined according to requirements, and pre-aggregated calculations can be performed within the Cube Segment.