title: How to join 2 dataframes in Spark based on a wildcard/regex condition?
body: <p>I have 2 dataframes <code>df1</code> and <code>df2</code>.
  Suppose there is a <code>location</code> column in <code>df1</code> which may contain a regular URL or a URL with a wildcard, e.g.:</p>
  
  <ul>
  <li>stackoverflow.com/questions/*</li>
  <li>*.cnn.com </li>
  <li>cnn.com/*/politics</li>
  </ul>
  
  <p>The seconds dataframe <code>df2</code> has <code>url</code> field which may contain only valid URLs without wildcards.</p>
  
  <p>I need to join these two dataframes, something like <code>df1.join(df2, $"location" matches $"url")</code> if there was magic <code>matches</code> operator in join conditions.</p>
  
  <p>After some googling I still don't see a way how to achieve this. How would you approach solving such problem?</p>