blob: 5c49c7917ddb07db22f27e2833ec6ff41d7bc6d7 [file] [log] [blame]
:mod:`airflow.providers.apache.pig.hooks.pig`
=============================================
.. py:module:: airflow.providers.apache.pig.hooks.pig
Module Contents
---------------
.. py:class:: PigCliHook(pig_cli_conn_id: str = default_conn_name)
Bases: :class:`airflow.hooks.base.BaseHook`
Simple wrapper around the pig CLI.
Note that you can also set default pig CLI properties using the
``pig_properties`` to be used in your connection as in
``{"pig_properties": "-Dpig.tmpfilecompression=true"}``
.. attribute:: conn_name_attr
:annotation: = pig_cli_conn_id
.. attribute:: default_conn_name
:annotation: = pig_cli_default
.. attribute:: conn_type
:annotation: = pig_cli
.. attribute:: hook_name
:annotation: = Pig Client Wrapper
.. method:: run_cli(self, pig: str, pig_opts: Optional[str] = None, verbose: bool = True)
Run an pig script using the pig cli
>>> ph = PigCliHook()
>>> result = ph.run_cli("ls /;", pig_opts="-x mapreduce")
>>> ("hdfs://" in result)
True
.. method:: kill(self)
Kill Pig job