title: how to use filter in spark sql for rates:Struct to get BGN,BRL in range between (2019-01-02 , 2019-01-04)
body: <p>i am working in an example of spark sql. The StructType schema for the dataframe looks like</p>
  <p>file.json (schema)</p>
  <pre><code>root
   |-- rates: struct (nullable = true)
   |    |-- 2019-01-02: struct (nullable = true)
   |    |    |-- AUD: double (nullable = true)
   |    |    |-- BGN: double (nullable = true)
   |    |    |-- BRL: double (nullable = true)
   |    |-- 2019-01-03: struct (nullable = true)
   |    |    |-- AUD: double (nullable = true)
   |    |    |-- BGN: double (nullable = true)
   |    |    |-- BRL: double (nullable = true)
   |    |-- 2019-01-04: struct (nullable = true)
   |    |    |-- AUD: double (nullable = true)
   |    |    |-- BGN: double (nullable = true)
   |    |    |-- BRL: double (nullable = true)
   |    |-- 2019-02-15: struct (nullable = true)
   |    |    |-- AUD: double (nullable = true)
   |    |    |-- BGN: double (nullable = true)
   |    |    |-- BRL: double (nullable = true)
  </code></pre>
  <hr />
  <p>file.json:-</p>
  <pre><code>{
    &quot;rates&quot;:{
       &quot;2019-02-15&quot;: {
  
        &quot;AUD&quot;: 1.4996,
        &quot;GBN&quot;: 8.9623,
        &quot;BRL&quot;: 137.0 
              },
  
      &quot;2019-01-02&quot;: {
        &quot;AUD&quot;: 1.3996,
        &quot;GBN&quot;: 8.6623,
        &quot;BRL&quot;: 135.0 
              },
  
      &quot;2019-01-03&quot;: {
        &quot;AUD&quot;: 1.2996,
        &quot;GBN&quot;: 8.7623,
        &quot;BRL&quot;: 135.0 
              },
  
      &quot;2019-01-04&quot;: {
        &quot;AUD&quot;: 1.2996,
        &quot;GBN&quot;: 8.8623,
        &quot;BRL&quot;: 136.0 
               }
    }
  
  }
  </code></pre>
  <hr />
  <p>I just want to display yyyy-mm-dd,BGN and BRL, but the condition is the range is in between(2019-01-02 , 2019-01-04)</p>
  <p>output stored as .csv file:- output.csv</p>
  <pre><code>yyy-mm-dd,BGN,BRL
  2019-01-02,8.6623.351,135.0 
  2019-01-03,8.7623,135.0
  2019-01-04,8.8623,136.0 
  </code></pre>