title: Use airflow hive operator and output to a text file
body: <p>Hi I want to execute hive query using airflow hive operator and output the result to a file. I don't want to use INSERT OVERWRITE here.</p>
  
  <pre><code>hive_ex = HiveOperator(
      task_id='hive-ex',
      hql='/sql/hive-ex.sql',
      hiveconfs={
          'DAY': '{{ ds }}',
          'YESTERDAY': '{{ yesterday_ds }}',
          'OUTPUT': '{{ file_path }}'+'csv',
      },
      dag=dag
  )
  </code></pre>
  
  <p>What is the best way to do this?</p>
  
  <p>I know how to do this using bash operator,but want to know if we can use hive operator</p>
  
  <pre><code>hive_ex = BashOperator(
      task_id='hive-ex',
      bash_command='hive -f hive.sql -DAY={{ ds }} &gt;&gt; {{ file_path }} 
      /file_{{ds}}.json',
      dag=dag
  )
  </code></pre>