title: Hive insert overwrite not having value in HDFS part file for a managed table. I am running the hive query as a shell script
body: <p>Below mentioned is my shell script. I am already having a hive table from which below mentioned maximum date is taken into  a variable. It was working correctly and I used to get the maximum date into a variable, I am running this hive query as a shell script.</p>
  <p>Now the Hive version was updated to Hive 3, I am getting the maximum date into a variable also insert overwrite is working fine in hive UI but not in shell script.</p>
  <pre><code>output_db=&quot;db_name&quot;
  hive -hivevar output_db=$output_db -hivevar parq_loc=$parquet_loc -e 'set hive.auto.convert.join=false;drop table if exists ${output_db}.table_summary;CREATE EXTERNAL TABLE IF NOT EXISTS ${output_db}.table_summary(mid varchar(30),`Date` date,Txn int,Collect decimal(18,2),Max_date date)ROW FORMAT SERDE &quot;org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe&quot; STORED AS INPUTFORMAT &quot;org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat&quot; OUTPUTFORMAT &quot;org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat&quot; LOCATION &quot;${parq_loc}/table_summary/&quot;;'
  var= $(hive -hivevar source_db=&quot;$output_db&quot; -e 'set hive.auto.convert.join=false;select max(`date`) from ${source_db}.table;')
  hive -hivevar output_db=$output_db -hivevar max_date=$var -e 'set hive.auto.convert.join=false;insert overwrite table ${output_db}.table_summary select mid,`Date`,txn,collect,to_date(&quot;${max_date}&quot;) as `Max_date` from ${output_db}.table where `Date`&gt;=add_months(trunc(&quot;${max_date}&quot;,&quot;MM&quot;),-1);'
  </code></pre>