title: how to use Regexp_replace in spark
body: <p>I am pretty new to spark and would like to perform an operation on a column of a dataframe so as to replace all the <code>,</code> in the column with <code>.</code></p>
  
  <p>Assume there is a dataframe x and column x4</p>
  
  <pre><code>x4
  1,3435
  1,6566
  -0,34435
  </code></pre>
  
  <p>I want the output to be as</p>
  
  <pre><code>x4
  1.3435
  1.6566
  -0.34435
  </code></pre>
  
  <p>The code I am using is </p>
  
  <pre><code>import org.apache.spark.sql.Column
  def replace = regexp_replace((x.x4,1,6566:String,1.6566:String)x.x4)
  </code></pre>
  
  <p>But I get the following error</p>
  
  <pre><code>import org.apache.spark.sql.Column
  &lt;console&gt;:1: error: ')' expected but '.' found.
         def replace = regexp_replace((train_df.x37,0,160430299:String,0.160430299:String)train_df.x37)
  </code></pre>
  
  <p>Any help on the syntax, logic or any other suitable way would be much appreciated</p>