title: Hi All, facing an issue of spark sql query for delete on basis of timestamp
body: <p>I am running the delete query with the &lt; (less then) and &gt; (greater then) condition on the timestamp field but we are not getting the desired results.</p>
  <p>Firstly I ran below select query on databricks</p>
  <p>Query: select * from edl.defectTesting_2_0_0 where time &gt; '2022-03-31T08:44:00.000+0000' and time &lt; '2022-03-31T08:47:00.000+0000';</p>
  <p>Result: I was getting 2 records in response [Expected]</p>
  <p>But when I ran the delete query using spark I was  not getting the desired results.</p>
  <p>Query: spark.sql(delete from edl.defectTesting_2_0_0 where time &gt; '2022-03-31T08:44:00.000+0000' and time &lt; '2022-03-31T08:47:00.000+0000')</p>
  <p>Result: No records deleted [NOT EXPECTED]</p>
  <p>Ideally 2 records should have been deleted but no records were deleted.</p>
  <p>So does someone knows whether databricks support timestamp for Less then and greater then condition? And why am I  facing the above issue can someone please give us a reasoning behind it?</p>
  <p>I am using the below spark library</p>
  <p>Libary :import org.apache.spark.sql.{DataFrame, SparkSession}</p>
  <p>spark = SparkSession.builder.appName(&quot;dataDeletionProcessor&quot;).getOrCreate()</p>
  <p>Query: spark.sql(delete from delta.edl.defectTesting_2_0_0 where time &gt; '2022-03-31T08:44:00.000+0000' and time &lt; '2022-03-31T08:47:00.000+0000')</p>