title: Predicate push down is not working in spark/hive view table
body: <p>From my reading, spark predict push down will be used in source side(reduced data scan).</p>
  <ul>
  <li>EMR 5.32.x</li>
  <li>Spark version - 2.4.5</li>
  <li>Hive version - 2.x</li>
  <li>data volume 2+ Terabytes.</li>
  </ul>
  <p>I have hive/spark table which is created by another function team. They have also created view on top on this table.
  The only difference between source table and view is <strong>create_date</strong> column data type</p>
  <ul>
  <li><strong>base table -&gt; create_date -&gt; date</strong></li>
  <li><strong>view -&gt; create_date -&gt; timestamp</strong></li>
  </ul>
  <p>Issue:
  Predicate push down applied only on base table query and not in view query.</p>
  <p>Base table Query:</p>
  <pre><code>spark.sql(&quot;&quot;&quot;select company_id, create_date 
  from `db`.`table` where product_name = 'sm' and
  create_date = cast('2018-07-01' as date) and country ='selva'&quot;&quot;&quot;).explain(True)
  </code></pre>
  <p>Physical plan</p>
  <blockquote>
  <p>== Physical Plan ==
  *(1) Project [company_id#1993L, create_date#1997]
  +- *(1) Filter (((isnotnull(create_date#1997) &amp;&amp; isnotnull(country#2003)) &amp;&amp; (create_date#1997 = 17713)) &amp;&amp;
  (country#2003 = selva))    +- *(1) FileScan parquet
  db.table[company_id#1993L,create_date#1997,country#2003,product_name#2080]
  Batched: true, Format: Parquet, Location:
  PrunedInMemoryFileIndex[s3://location...,
  PartitionFilters: [isnotnull(product_name#2080), (product_name#2080 =
  sm)], PushedFilters: [IsNotNull(create_date),
  IsNotNull(country), <strong>EqualTo(create_date,2018-07-01)</strong>, Equ...,
  ReadSchema:
  struct&lt;company_id:bigint,create_date:date,country:string&gt;</p>
  </blockquote>
  <p>View Query:</p>
  <pre><code>spark.sql(
          &quot;&quot;&quot;
      select 
      create_date
      from db.view where 
      product_name = 'sm' and country ='United States'
      &quot;&quot;&quot;
      ).filter(&quot;cast(create_date as date) = cast('2018-07-01' as date)&quot;).explain(True)
  </code></pre>
  <blockquote>
  <p>== Physical Plan ==
  *(1) Project [cast(create_date#2176 as timestamp) AS create_date#2087]
  +- *(1) Filter (((isnotnull(country#2182) &amp;&amp; isnotnull(create_date#2176)) &amp;&amp; (country#2182 = United
  States)) &amp;&amp; (cast(cast(create_date#2176 as timestamp) as date)
  = 17713))    +- *(1) FileScan parquet db.table[create_date#2176,country#2182,product_name#2259]
  Batched: true, Format: Parquet, Location:
  PrunedInMemoryFileIndex[s3://location...,
  PartitionFilters: [isnotnull(product_name#2259), (product_name#2259 =
  sm)], PushedFilters: [IsNotNull(country),
  IsNotNull(create_date), EqualTo(country,United States)],
  ReadSchema: struct&lt;create_date:date,country:string&gt;</p>
  </blockquote>
  <p>OR</p>
  <pre><code>spark.sql(
          &quot;&quot;&quot;
      select 
      create_date
      from db.table where 
      product_name = 'sm' and country ='United States'
      &quot;&quot;&quot;
      ).filter(&quot;create_date = cast('2018-07-01' as timestamp)&quot;).explain(True)
  </code></pre>
  <p>Physical plan:</p>
  <blockquote>
  <p>== Physical Plan ==
  *(1) Project [cast(create_date#2354 as timestamp) AS create_date#2265]
  +- *(1) Filter (((isnotnull(create_date#2354) &amp;&amp; isnotnull(country#2360)) &amp;&amp; (country#2360 = United States)) &amp;&amp;
  (cast(create_date#2354 as timestamp) = 1530403200000000))<br />
  +- *(1) FileScan parquet db.table[create_date#2354,country#2360,product_name#2437]
  Batched: true, Format: Parquet, Location:
  PrunedInMemoryFileIndex[s3:location..,
  PartitionFilters: [isnotnull(product_name#2437), (product_name#2437 =
  sm)], PushedFilters: [IsNotNull(create_date),
  IsNotNull(country), EqualTo(country,United States)], ReadSchema:
  struct&lt;create_date:date,country:string&gt;</p>
  </blockquote>