title: Handling the NULL data in impala
body: <p>I am trying understand the behavior of arithmetic operation in impala</p>
  
  <p>i am using the following table</p>
  
  <pre><code>╔════╦══════════════╦══════════╗
  ║ id ║  name        ║ salary   ║
  ╠════╬══════════════╬══════════╣
  ║  1 ║  cde         ║ 5636     ║
  ║  2 ║  asd         ║  148     ║
  ║  3 ║  pwe         ║  null    ║
  ║  4 ║  lmn         ║  959     ║
  ╚════╩══════════════╩══════════╝
  </code></pre>
  
  <p>when i execute the following query</p>
  
  <pre><code>select salary+20 as sum1 from table where id=3;
  </code></pre>
  
  <p>it returns me</p>
  
  <pre><code>     |sum1
    ---|-----
     1 |NULL
  </code></pre>
  
  <p>when i run sum on the column with </p>
  
  <pre><code>select sum(salary) as sum1 from table;
  
       |sum1
    ---|-----
     1 |6743
  </code></pre>
  
  <p>I am unable to understand how same arithmetic operations are behaving differently  </p>