title: In HIVE replacing the Null value by the same column values using COALESCE
body: <p>I would like to replace the null value of a particular column by values in the same column I would like to get the result </p>
  
  <p>I have tried below </p>
  
  <pre><code>select  
      d_day,
      COALESCE(val, LAST_VALUE(val, TRUE) 
      OVER( ORDER BY d_day ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) 
      as val from data_table
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1RsHh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1RsHh.jpg" alt="sample data"></a></p>