In DataWorks, you can use a CDH Presto node for real-time data analytics. This node provides a distributed SQL query engine to enhance the data analytics capabilities of your CDH environment. This topic describes how to configure and use a CDH Presto node.
Prerequisites
You have created an Alibaba Cloud CDH cluster and associated it with a DataWorks workspace. For more information, see New Data Development: Bind a CDH Compute Engine.
ImportantEnsure the Presto component is installed on your CDH cluster and that you configure its related information when you bind the cluster.
-
(Optional, for RAM users) The RAM user for task development has been added to the corresponding workspace and granted the Development or Workspace Administrator role. The Workspace Administrator role has extensive permissions, so grant it with caution. For more information about adding members, see Add members to a workspace.
NoteIf you use an Alibaba Cloud account, you can skip this step.
You have configured a Hive data source in DataWorks and verified that the data source passed the connectivity test. For more information, see Manage data sources.
Create a node
For instructions, see Create a node.
Node development
You can develop the task code in the SQL editor. You can define variables in the code by using the ${variable_name} format. Then, assign a value to the variable in the Scheduling Parameters section of the Scheduling Settings panel on the right side of the node editing page. This allows you to dynamically pass parameters to the code when the node is run on a schedule. For more information about scheduling parameters, see Sources and expressions of scheduling parameters. The following code provides an example.
SHOW TABLES;
SELECT * FROM userinfo ;
-- You can use this with scheduling parameters.
SELECT '${var}'; Node debugging
On the Run Configuration tab, configure Compute Resource and Resource Group in the Compute Resource section.
For Compute resource, select the name of the CDH cluster that you registered on DataWorks.
Select a scheduling resource group that has passed the connectivity test with the data source. For more information, see Network Connectivity Solutions.
On the toolbar at the top of the node editing page, click Run.
Next steps
Configure node scheduling: If you need to run a node periodically, configure its Scheduling Policy in the Scheduling Settings panel on the right.
Publish a node: To run a task in the production environment, click the
icon to publish the node. A node runs on schedule only after it is published to the production environment.Task O&M: After a task is published, you can monitor the status of its periodic runs in the Operation Center. For more information, see Get started with Operation Center.