2.6 KiB
2.6 KiB
Hive CLI
Overview
Use Hive Cli Task to create a Hive Cli type task and execute hive SQL from scripts or files.
The workers run hive -e to execute hive sql from scripts or hive -f to execute from files in Resource Center.
Hive CLI Task vs SQL Task With Hive Datasource
In DolphinScheduler, we have both Hive CLI Task and SQL Task With Hive Datasource for different scenarios.
You could choose between these two based on your needs.
- The
Hive CLItask plugin connects directly toHDFSand theHive Metastorefor hive task executions, which requires your workers to have access to those services, such as relatedHivelibs,HiveandHDFSconfiguration files. However,Hive CLI Taskprovides better stability for scheduling in production. SQL Task With Hive Datasourcedoes not require access toHivelibs,HiveandHDFSconfiguration files and supportsKerberosfor authentication. However, you may encounterHiveServer2failures if your hive sql task scheduling puts significant pressure on it.
Create Task
- Click
Project Management-Project Name-Workflow Definition, and click theCreate Workflowbutton to enter the DAG editing page. - Drag
from the toolbar to the canvas.
Task Parameters
- Please refer to DolphinScheduler Task Parameters Appendix for default parameters.
| Parameter | Description |
|---|---|
| Hive Cli Task Execution Type | The type of hive cli task execution, choose either FROM_SCRIPT or FROM_FILE. |
| Hive SQL Script | If you choose FROM_SCRIPT for Hive Cli Task Execution Type, you need to fill in your SQL script. |
| Hive Cli Options | Extra options for hive cli, such as --verbose |
| Resources | If you choose FROM_FILE for Hive Cli Task Execution Type, you need to select your SQL file. |
Task Example
Hive Cli Task Example
This example below illustrates how to create a Hive CLI task node and execute hive SQL from script:
This example below illustrates how to create a Hive CLI task node and execute hive SQL from file:

