title: Difference between translate and regexp_replace
body: <p>What is the difference between <a href="https://spark.apache.org/docs/1.6.1/api/java/org/apache/spark/sql/functions.html#translate(org.apache.spark.sql.Column,%20java.lang.String,%20java.lang.String)" rel="nofollow noreferrer"><code>translate</code></a> and <a href="https://spark.apache.org/docs/1.6.1/api/java/org/apache/spark/sql/functions.html#regexp_replace(org.apache.spark.sql.Column,%20java.lang.String,%20java.lang.String)" rel="nofollow noreferrer"><code>regexp_replace</code></a> function in Spark SQL.</p>
  
  <p>I want to replace substrings in the strings, whole integer values and other data types like boolean.</p>
  
  <p>For example.</p>
  
  <pre><code>func("hello","e","a") = "hallo"
  func(true,true ,false) = false
  func(112,112,9) = 9
  func(112,115,9) = 112
  </code></pre>
  
  <p>Which one should I use and what advantages/disadvantages each one have?</p>