HiveOperator

Apache Hive

Executes hql code or hive script in a specific Hive database.

View on GitHub

Last Updated: Apr. 10, 2023

Access Instructions

Install the Apache Hive provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

hqlRequiredthe hql to be executed. Note that you may also use a relative path from the dag file of a (template) hive script. (templated)
hive_cli_conn_idReference to the Hive CLI connection id. (templated)
hiveconfsif defined, these key value pairs will be passed to hive as -hiveconf "key"="value"
hiveconf_jinja_translatewhen True, hiveconf-type templating ${var} gets translated into jinja-type templating {{ var }} and ${hiveconf:var} gets translated into jinja-type templating {{ var }}. Note that you may want to use this along with the DAG(user_defined_macros=myargs) parameter. View the DAG object documentation for more details.
script_begin_tagIf defined, the operator will get rid of the part of the script before the first occurrence of script_begin_tag
run_as_ownerRun HQL code as a DAG’s owner.
mapred_queuequeue used by the Hadoop CapacityScheduler. (templated)
mapred_queue_prioritypriority within CapacityScheduler queue. Possible settings include: VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW
mapred_job_nameThis name will appear in the jobtracker. This can make monitoring easier.

Documentation

Executes hql code or hive script in a specific Hive database.

Was this page helpful?