title: Failed to insert into HDFS from HIVE table using INSERT OVERWRITE DIRECTORY
body: <p>My primary need is to load a file in HDFS from HIVE using INSERT OVERWRITE uery. In this query I am trying to join 3 hive tables. Below is the query:</p>
  
  <pre><code>select * FROM 
      AGG_CUSTOMER_EXPSR_DRV_HIVE DRV 
  LEFT OUTER JOIN 
      AGG_CUSTOMER_EXPSR_SRC_HIVE SRC 
  ON 
      (SRC.CUSTOMER_ID = DRV.CUSTOMER_ID) 
      AND (SRC.AGGREGATION_LEVEL_CD = DRV.AGGREGATION_LEVEL_CD) 
      AND (SRC.PRODUCT_GROUP_CD = DRV.PRODUCT_GROUP_CD) AND (SRC.SRC_SYS_CD = DRV.SRC_SYS_CD) 
  LEFT OUTER JOIN 
      ALTERNATE_IP_HIVE AIP1 
  ON 
      (DRV.DERIVED_CUSTOMER_ID = AIP1.IP_ID) AND (AIP1.IP_TYPE_CD IN (1, 4)) 
  LEFT OUTER JOIN 
      ALTERNATE_IP_HIVE AIP3 
  ON 
      (SRC.FINANCIAL_RPTNG_UNIT_ID = AIP3.IP_ID) AND (AIP3.IP_TYPE_CD = 3) 
  WHERE EXCLUDE_IND ='N';
  </code></pre>
  
  <p>But I am getting error as below:
  <code>-sh: syntax error near unexpected token</code>(`</p>
  
  <p>Can someone please help me in finding out the issue?</p>
  
  <p>Note: I have removed the fields in SELECT clause.</p>