title: Sparklyr Spark SQL Filter based on multiple wildcards
body: <p>Using sparklyr, I'm trying to find a way to filter a Spark dataframe combining <code>rlike</code> and <code>%in%</code> functionality. Here is a minimal working example:</p>
  
  <pre><code># start a Spark session in R and have dplyr loaded
  
  # create a spark dataframe
  df &lt;- data.frame(names = c("Brandon", "Chee", "Brandi", "Firouz", "Eric", "Erin"),
                   place = c("Pasadena", "South Bay", "West Hollywood", "SF Valley", "South Bay", "South Bay"))
  sc_df &lt;- sdf_copy_to(sc, df, overwrite = TRUE)
  
  # set wildcard filter paramaters
  f_params &lt;- c("Brand", "Er")
  
  # return all rows of sc_df where the 'names' value contains either 'f_params' values.
  df_filtered &lt;- sc_df %&gt;% 
    filter(rlike(names, f_params)) %&gt;% 
    collect()
  </code></pre>
  
  <p><code>df_filtered</code> in the code above obviously fails. Ideally, the <code>df_filtered</code> table will look like:</p>
  
  <pre><code>print(df_filtered)
  # names     place           
  # Brandon   Pasadena      
  # Brandi    West Hollywood
  # Eric      South Bay     
  # Erin      South Bay 
  </code></pre>
  
  <p><strong>Additional rule</strong>: Because the real example includes about 200 values in <code>f_params</code>, I can't use the following solution:</p>
  
  <pre><code>df_filtered &lt;- sc_df %&gt;% 
    filter(rlike(names, "Brand") | rlike(names, "Er")) %&gt;% 
    collect()
  </code></pre>
  
  <p>Thanks, in advance.</p>