In DataWorks, you can use a CDH Impala node to write and run an Impala SQL script. Compared to a CDH Hive node, a CDH Impala node provides faster query performance. This topic explains how to configure and use a CDH Impala node.
Prerequisites
An Alibaba Cloud CDH cluster has been created and associated with a DataWorks workspace. For details, see Associate a CDH computing resource.
ImportantEnsure that the Impala component is installed in your CDH cluster and that you have configured the Impala connection information when you associate the cluster.
(Optional) The RAM user who will develop tasks has been added to the corresponding workspace and granted the Developer or Workspace Administrator role (grants extensive permissions; add with caution). For details on adding members, see Add members to a workspace.
A Hive data source has been configured in DataWorks and has passed the connectivity test. For details, see Data source management.
Create a node
For instructions, see Create a node.
Develop a node
In the SQL editor, write your task code. You can define variables by using the ${variable_name} format. Then, on the Scheduling Settings tab, you can assign values to the variables in the Scheduling Parameters section. This lets you dynamically pass parameters when the node is scheduled to run. For more information about how to use scheduling parameters, see Sources and expressions of scheduling parameters. The following code is an example:
SHOW TABLES;
SELECT * FROM userinfo ;
-- You can use scheduling parameters.
SELECT '${var}'; Debug a node
In the Compute Resource section of the Run Configuration, configure the Compute Resource and Resource Group.
For compute resource, select the name of the CDH cluster that you registered in DataWorks.
Select the resource group for scheduling that has passed the connectivity test with the data source. For more information, see Network Connectivity Solutions.
In the toolbar at the top of the node editor, 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.