title: Spark - how to get filename with parent folder from dataframe column
body: <p>I am using pyspark as code language. I added column to get filename with path.</p>
  
  <pre class="lang-python prettyprint-override"><code>from pyspark.sql.functions import input_file_name
  data = data.withColumn("sourcefile",input_file_name())
  </code></pre>
  
  <p>I want to retrieve only filename with it's parent folder from this column. Please help.</p>
  
  <p>Example: </p>
  
  <pre class="lang-python prettyprint-override"><code>Inputfilename = "adl://dotdot.com/ingest/marketing/abc.json"
  </code></pre>
  
  <p>What output I am looking for is:</p>
  
  <pre class="lang-python prettyprint-override"><code>marketing/abc.json
  </code></pre>
  
  <p>Note: String operation I can do. The filepath column is part of dataframe.</p>