title: spark giving incorrect output for some value and correct output for some value
body: <p>I am working with Apache spark in spark-shell when I perform SQL query I get different outputs </p>
  
  <p>I have the spark cluster having one master and one slave node. on the master, there is one worker and on the slave node, there is one worker. so I have total two worker nodes.</p>
  
  <p>now when I am persisting some data and then performing some filters onto that persisted data each time I got two different outputs but these two different outputs are distinct they are not changing every time, in short, i am getting two different output for one SQL query.</p>
  
  <p>I have the MySQL database on both master and slave node in which I have a table having 50000 records into it on the slave and on master also there are 50000 records this 50k + 50k records are different not the same. </p>
  
  <p>so when I am querying the result becomes different. here is my code that I am trying and also a screenshot of output.</p>
  
  <pre><code>spark-shell --conf spark.sql.warehouse.dir=C:\spark-warehouse --master spark://192.168.0.31:7077
  
  val jdbcDF = spark.read.format("jdbc").options( Map("url" -&gt;  "jdbc:mysql://localhost:3306/cmanalytics?zeroDateTimeBehavior=convertToNull&amp;user=root&amp;password=root", "dbtable" -&gt; "cmanalytics.demo_call", "fetchSize" -&gt; "1000", "partitionColumn" -&gt; "newpartition", "lowerBound" -&gt; "0", "upperBound" -&gt; "4", "numPartitions" -&gt; "4")).load()
  
  jdbcDF.createOrReplaceTempView("demo_call")
  
  val sqlDF = sql("select * from demo_call").persist(org.apache.spark.storage.StorageLevel.DISK_ONLY)
  
  sqlDF.show()
  
  val d = sqlDF.filter(sqlDF("campaign_id")===141).groupBy("classification_id").count
  
  d.count
  </code></pre>
  
  <p>and the screenshot of output is </p>
  
  <p><a href="https://i.stack.imgur.com/qT9hP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qT9hP.png" alt="enter image description here"></a></p>
  
  <p>can any one help to solve this problem?</p>
  
  <p>Thanks</p>