title: how to do chain functions in Spark dataframe?
body: <p>how to do chain functions in Spark dataframe ? in my code, I want to do upper case first and then do a boolean conversion. but my code didn't work. Thanks</p>
  
  <pre><code>import org.apache.spark.sql.functions.udf
  val trimStr: String =&gt; String = _.trim
  val trimUDF = udf(trimStr)
  
  import org.apache.spark.sql.functions.udf
  val upperCaseStr: String =&gt; String = _.toUpperCase
  val upperCaseUDF = udf(upperCaseStr)
  
  import org.apache.spark.sql.functions.udf
       def booleanValueSubstitution = udf[String, String] {
         case "" =&gt; "N"
         case null =&gt; "N"           
         case "TRUE" =&gt; "Y"        
       }
  var df= df1.withColumn("xx", booleanValueSubstitution(upperCaseUDF(df1("yy"))) )
  </code></pre>