title: Add empty row if the condition is false
body: <p>Given the dataframe below:</p>
  <pre><code> Row|Address_StoreHours_Phone_RemoveHrTag|
  +---+------------------------------------+
  |  1|                Ph 148-01 Metro P...|
  |  2|                Store Hours: 7:00...|
  |  3|                &lt;hr class=&quot;dashed&quot;/&gt;|
  |  4|                Ground Floor Vict...|
  |  5|                       +632-82833778|
  |  6|                        Store Hours:|
  |  7|                &lt;hr class=&quot;dashed&quot;/&gt;|
  |  8|                Phase 1 Package 1...|
  |  9|                       +632-83722847|
  | 10|                Store Hours: 7:00...|
  | 11|                &lt;hr class=&quot;dashed&quot;/&gt;|
  </code></pre>
  <p>How do i add empty row 1 row above hr class=&quot;dashed&quot;/ if hr class=&quot;dashed&quot;/'s row is not divisible by 4, e.g.</p>
  <pre><code> Row|Address_StoreHours_Phone_RemoveHrTag|
  +---+------------------------------------+
  |  1|                Ph 148-01 Metro P...|
  |  2|                                    |
  |  3|                Store Hours: 7:00...|
  |  4|                &lt;hr class=&quot;dashed&quot;/&gt;|
  |  5|                Ground Floor Vict...|
  |  6|                       +632-82833778|
  |  7|                        Store Hours:|
  |  8|                &lt;hr class=&quot;dashed&quot;/&gt;|
  |  9|                Phase 1 Package 1...|
  | 10|                       +632-83722847|
  | 11|                Store Hours: 7:00...|
  | 12|                &lt;hr class=&quot;dashed&quot;/&gt;|
  </code></pre>
  <p>Here's what i've done so far, hr_tag column returns true if hr class=&quot;dashed&quot;/ is in row divisible by 4</p>
  <pre><code>spark.sql(&quot;&quot;&quot;
      WITH create_row AS(
          SELECT CAST(ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS INTEGER) AS Row, *
          FROM ssd_others
      ), filter_hr_tag AS (
          SELECT 
              *,
              CASE
                  WHEN `Address_StoreHours_Phone_RemoveHrTag` = '&lt;hr class=&quot;dashed&quot;/&gt;' AND `Row` % 4 = 0
                  THEN True
                  ELSE False
              END AS hr_tag
          FROM create_row
      )
      SELECT * 
      FROM filter_hr_tag
  &quot;&quot;&quot;)
  </code></pre>
  <p>and here's the code's output</p>
  <pre><code>Row|Address_StoreHours_Phone_RemoveHrTag|hr_tag|
  +---+------------------------------------+------+
  |  1|                Ph 148-01 Metro P...| false|
  |  2|                Store Hours: 7:00...| false|
  |  3|                &lt;hr class=&quot;dashed&quot;/&gt;| false|
  |  4|                Ground Floor Vict...| false|
  |  5|                       +632-82833778| false|
  |  6|                        Store Hours:| false|
  |  7|                &lt;hr class=&quot;dashed&quot;/&gt;| false|
  |  8|                Phase 1 Package 1...| false|
  |  9|                       +632-83722847| false|
  | 10|                Store Hours: 7:00...| false|
  | 11|                &lt;hr class=&quot;dashed&quot;/&gt;| false|
  </code></pre>