Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a Multidimensional Analysis Project on kylin platform

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to create a multidimensional analysis project on kylin platform". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "how to create a multidimensional analysis project on kylin platform"!

1. create project

Enter the kylin operation interface. If no project can be created, multiple projects can be created in kylin, effectively isolating various business data analysis. As shown in the figure:

Fill in project name as follows, description can be omitted

Then submit, project created successfully.

2. add a data source

Click DataSource tab->Load Hive Table

Fill in hive table name, preceded by library name

Then click sync, import data source successfully, you can see the following information:

3. Creating a model

Add model name and next

Select the fact table you just added to the data source, or a Lookup Table if available, and then next

Select the desired dimension

Select the desired indicators

related settings

partition date colorime indicates a partition field, selecting a field partitioned by time in the hive table. Then select a different time format from date format. The filter at the bottom can add where conditions to filter the data in the data source.

At this point, model creation is complete.

4. Creating a cube

Next, go to the key link to create a cube.

Similar to creating a model, create a cube. Select the previously created model and fill in the cube name. notification email list is optional and indicates the email address of the alarm recipient. Multiple email addresses are separated by commas.

Then next. Select dimession, there are two ways: one is to manually add dimession, the other is to use automatic generation, we use automatic generation here, and then check the required field.

Then next, select the indicator

Count(1) is the default of the system, do not delete it.

Click on the + sign to add the desired indicator, fill in the name, select the expression. The choice here is sum. We want to add pv to disp and select the disp column in param value.

It should be noted that the type of each column in the hive table in kylin is stricter. The dimession field needs to be String, and the metric field used to add sum must be bigint or decimal.

After adding all the required metrics, click next

Set the merge time. Each build of Kylin generates an hbase table, and the merge operation merges multiple days of data into a new hbase table. It can speed up inquiries.

Set partition Start Date, i.e. data source start time, default is 1970-01-01. Click Next.

Mandatory Dimensions: Dimensions that are used every time a query is made can be added here. For example, partition column in some cases.

Hierarchy Dimensions: Columns in a dimension column that have hierarchical relationships with each other, such as Country-Province-City-County

Joint Dimensions: Combinations of dimensions that are used simultaneously or not per query.

Aggregation Group: In different queries, there will be no intersection between two groups of dimension combinations. Select this option. For example, there are 6 cube dimensions [ a,b,c,d,e,f ]. In each query, only information related to [ a,b,c ](such as [a],[a,c], etc.) will be queried at the same time, but [ d,e,f ] will not be queried. Or vice versa.

The above options can reduce the amount of data in the build process, which is one of the optimization points to speed up the build and query.

Next is basically next, and then save, if there is no error, it proves that the cube was created successfully, as shown below

5. cube Other operations

The most common is the build operation, which pre-computes the data from the cube we created.

Select the build termination time and commit, after which you can see the status of the cube build in monitor.

Other operating instructions:

Drop: drop existing cube, condition: job with no Pending, Running, Error status.

Edit: Edit an existing cube. Condition: The cube needs to be disabled.

Refresh: Rebuilds data for an existing time period when source data for the built time period has changed.

Merge: Manually trigger the merge operation.

Enable: Causes a cube with at least one valid segment to change from disabled to enabled.

Purge: Clears all data of the cube.

Clone: Clone a new cube, you can set a new name, other related configuration is the same as the original cube.

Disable: Causes a ready cube to be disabled, so queries do not retrieve data from disabled cubes.

6. query operation

After the pre-calculation of data is completed, you can query it. During the query process, you can also verify whether there is any problem with the cube creation. There are two ways to query: through kylin's web interface, and using kylin's rest api. They are described separately below.

1) Web search. Enter insight, enter sql statement, wait for query result, similar to general database client.

(2)rest api。Examples are as follows:

Select sum(disp) as pv from t_table group by td,bd

The password of kylin account is: "kylinid:passwd", which is base64 encrypted. secret=echo -n "kylin_id:password" | base64

Project used: my_kylin_project

Interface address: http://localhost:7070/kylin/api/query

The request is:

curl -X POST -H "Authorization:Basic ${secret}" -H "Content-Type:application/json" -d '{ "sq At this point, I believe that you have a deeper understanding of" how to create a multidimensional analysis project on kylin platform,"so you may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report