Getting started with Yandex DataLens Platform
This section describes how to set up a DataLens Platform environment, connect to a data source, ingest data into the REST catalog, explore it using the SQL editor, and create a dashboard.
- Getting started
- Activate the service and set up the environment
- Configure Apache Airflow™
- Ingest data from a source
- Explore data using the SQL editor
- Create a dashboard
Getting started
To get started with DataLens Platform:
- Log in
to your Yandex account. If you do not have an account, create one. - Open the DataLens Platform home page
. - Click Start in cloud.
- Confirm that you have read the Terms of use
. Click Log in.
-
Log in
to your Yandex account. -
Open the DataLens Platform home page
. -
Click Start in cloud.
-
Select one of these options:
-
If you already have an organization, select it from the drop-down menu in the Organizations tab and click DataLens Platform.
Note
To activate a DataLens Platform instance, the user must have the
adminorownerrole. For more information about roles, see Access management in Yandex Identity Hub. -
If you have a cloud but no organization, click Add new DataLens. In the window that opens, enter a name and description for your organization and click Create organization and DataLens. For more information about working with organizations, see Getting started with organizations.
-
Activate the service and set up the environment
On first DataLens Platform launch, follow these steps:
-
Enter the organization name and click Continue.
-
Answer the questions about using the service and click Continue.
-
Link your billing account: select Add, specify the billing account, and click Continue, or select Do not add and use the trial period.
-
Set up the environment for working with data: select Set up now and click Continue.
The platform automatically creates a Yandex Cloud cloud, network, and subnet, an environment, a REST catalog, and Trino and Apache Spark™ clusters. Setup takes a few minutes and continues in the background.
-
Invite users: specify email addresses of those you are going to cowork with, comma-separated, and click Send invitations. If you do not want to invite users yet, leave the address field empty and click Continue. The DataLens Platform home page opens.
On the home page, under Set up DataLens Platform, you can see the setup stages: Set up environment, Set up data ingestion, Build a dashboard, and Invite users. Select Set up environment to check the setup status. When only Apache Airflow™ remains to be set up, an Airflow setup remaining card will appear in the section.
If skipped the environment setup during the first launch, return to it from the home page by selecting Set up environment under Set up DataLens Platform.
To view the created environment, open the
Note
To perform the next steps, use the REST catalog and the Trino, Apache Spark™, and Apache Airflow™ clusters in the same Yandex Cloud cloud and environment. This is required so the objects can interact with each other.
If creating the environment manually, prepare the cloud, network, and subnet in advance according to the requirements. A route table with a 0.0.0.0/0 route via a NAT gateway that provides internet access must be attached to the subnet.
Configure Apache Airflow™
To run data processing pipelines, you need to create an Apache Airflow™ cluster. Follow these steps:
-
On the home page, under Set up your DataLens Platform, select Set up environment.
-
In the Airflow setup remaining card, click Proceed to setup.
-
Under Basic settings, specify the Git repository parameters:
- Repository address: Address for SSH connection.
- Path to the folder with files: Path to the folder housing DAG files in the Git repository.
- Branch: Branch to pull the DAG files from.
- SSH key: Contents of the private key. The corresponding public key must provide read access to the Git repository.
-
In the Environment field, select the same environment where the REST catalog and the Trino and Apache Spark™ clusters are located.
-
If running the DAGs requires additional Python dependencies, fill in the Pip packages field under Other settings accordingly. Specify each dependency on a separate line: the package name or the name with an exact version via
==. You can specify additional package components, for example:numpy requests[security,socks] -
Click Create cluster.
-
Wait for the operation to complete. After the cluster is created, you will see a list of pipelines.
If you do not plan to use pipelines yet, click Skip in the Airflow setup remaining card.
Ingest data from a source
In this example, the data source is a relational PostgreSQL database, with its tables regularly ingested into the REST catalog. To ingest the data, first create a connection to the database, and then a data delivery. Currently, connections to ClickHouse®, PostgreSQL, and MySQL® are available for data deliveries. Moving forward, we will keep expanding the list of supported sources.
If data deliveries do not support your required source yet, you can set up ingestion using code in Apache Spark™ or by connecting to the source in Trino. Whether a connection is possible depends on the available libraries and connectors.
Create a connection to the source
A connection stores the access parameters for the data source. A single connection can be used for ingesting data, collecting metadata, executing SQL queries, and creating datasets.
To create a PostgreSQL connection:
-
In the left-hand panel, select
Data deliveries and click Create data delivery. -
In the Select connection step, click Create connection.
-
Under Databases, select PostgreSQL.
-
In the Connection step, select Select in organization and specify the parameters:
- Cloud and folder: Yandex Cloud cloud and folder where the PostgreSQL cluster is located.
- Cluster: Cluster housing the source data.
- Connection ID: Connection to the selected cluster.
- Host: Cluster host.
- Database: Database to ingest tables from.
To connect to an external database, select Specify manually and fill in the access parameters.
-
Leave the other settings unchanged.
-
Click Check connection.
-
Once the check is successful, click Create connection.
-
In the window that opens, select a collection, enter the connection name, and click Create.
-
Wait for the connection to be created and the Metadata step to complete.
-
Make sure Get metadata is on. In the Schedule field, select Every day; in the Time intervals field, select the metadata update time, e.g.,
00:00. Leave the other settings unchanged. -
Click Continue.
The schedule at the Metadata step determines how often to update the source metadata. Set the frequency of copying the data itself separately when configuring the delivery.
Configure data delivery
As the source, select the connection to PostgreSQL you created in the previous step. For ingestion, use the REST catalog created during the environment setup.
To regularly copy data from PostgreSQL to the REST catalog:
-
Navigate to
Data transfer and click Create data transfer. -
In the Select connection step, specify the source connection and proceed to the Data transfer configuration.
-
In the transfer type switch, select Regular copy for copying with scheduled data updates.
-
Specify the basic transfer settings:
- In the Transfer name field, enter a name the delivery.
- Optionally, enter the delivery’s purpose in the Description field.
- In the Database field, enter the database name in the selected source connection.
- In the Collection field, select a collection from the list. If you do not have an appropriate collection, click Create and create a new one.
- Optionally, add a label for searching and filtering the delivery.
-
Under Destination, specify where to deliver the data:
- In the REST catalog field, select a REST catalog.
- In the Namespace field, select a namespace within the selected catalog. If you do not have an appropriate namespace, click Create and create a new one.
-
Under Transfer parameters, configure the schedule and included data:
-
In the Frequency field, select the update frequency, e.g., Monthly, and, in the field below, specify a start day and time, e.g.,
1 at 12:00. -
Select which tables to transfer in the Tables to transfer field:
- All tables: Transfer all tables from the source.
- List: Specify the tables to deliver in separate fields.
-
Optionally, under Partial table transfer, configure incremental copying by the cursor column.
Configuring incremental tables
With incremental copying, each transfer starts copying only those rows whose cursor column value exceeds the one saved from the previous start. As the result, only the new data is sent to the target, not the entire table.
You can fill each section in two modes that you can switch using buttons on the right side of its header: each field separately or in table format. Each configured table is displayed as a separate numbered section (Table 1, Table 2, etc.). To delete a table, click in its header.
For each incremental table, specify these settings:- Optionally, in the Table namespace field, specify the namespace (schema) of the table in the source. If you need the default namespace, you can leave this field empty.
- In the Table name field, specify the name of the table to configure incremental copying for.
- In the Cursor column field, specify a column to track new data in, e.g., a monotonously incrementing ID or a column with date and time of the record change.
- Optionally, in the Initial value field, specify the cursor value to start copying data from on the first start. If you leave the field empty, copying will start from the earliest available value.
-
-
Click Create transfer.
Note
To start data transfer, click Activate.
Wait for the first ingestion to complete. In the REST catalog, open the selected namespace and make sure it now includes the required tables.
Explore data using the SQL editor
To run queries, use the Trino cluster from the same cloud and environment as the REST catalog with the loaded data.
To explore the ingested data using SQL:
-
In the left-hand panel, select
SQL Editor. -
Select the connection to the Trino cluster associated with the REST catalog you ingested the data to.
-
Create a SQL query in one of the following ways:
- Enter the query in the editor.
- On the Neuroanalyst panel, describe the data you need to retrieve, and then click Insert into editor.
-
Click Execute and check the query output.
-
Click Save, enter the script name, and select a collection.
You can also open the editor from the connection page or the REST catalog table page. Learn more on working in the SQL editor.
You can also build and execute SQL queries via an external AI agent connected to the platform’s API.
If an Apache Airflow™ pipeline has already been created for the script:
- In the left-hand panel, select
Orchestrator. - Make sure the cluster’s service account can access the saved SQL script, the connection, the used data, and the computations in the Trino cluster. For the account ID, see the Service account card. To proceed to the access request, select Request access in the card menu.
- Enable the pipeline.
- Open the pipeline and check the launch result.
Create a dashboard
To create a dashboard using the Neuroanalyst:
-
Return to the DataLens Platform home page.
-
Under Set up your DataLens, select Build a dashboard and click Show.
-
Describe the task in the How can I help you? field. Specify the connection or table on which to build the dashboard, and the required metrics. Here is an example:
Build a dashboard based on data from the
<table_name>table. Show the development of metrics by month and their distribution by type. -
Send your request.
-
Wait for the Neuroanalyst to create the dataset and the dashboard.
-
Open the created dashboard and check the data in its charts.
This guide walked you through setting up a DataLens Platform environment, ingesting data from PostgreSQL into the REST catalog, exploring the data using SQL, and creating a dashboard.