title: How to handle the null/empty values on a dataframe Spark/Scala
body: <p>I have a CSV file and I am processing its data. </p>
  
  <p>I am working with data frames, and I calculate average, min, max, mean, sum of each column based on some conditions. The data of each column could be empty or null.</p>
  
  <p>I have noticed that in some cases I got as max, or sum a null value instead of a number. Or I got in max() a number which is less that the output that the min() returns.</p>
  
  <p>I do not want to replace the null/empty values with other. 
  The only thing I have done is to use these 2 options in CSV:</p>
  
  <pre><code>.option("nullValue", "null")
  .option("treatEmptyValuesAsNulls", "true")
  </code></pre>
  
  <p>Is there any way to handle this issue? Have everyone faced this problem before? Is it a problem of data types? </p>
  
  <p>I run something like this:</p>
  
  <pre><code>data.agg(mean("col_name"), stddev("col_name"),count("col_name"), 
           min("col_name"), max("col_name"))
  </code></pre>
  
  <p>Otherwise I can consider that it is a problem in my code.</p>