How to pass the non dataframe argument to udf in spark
<p>Can any please help to know how to pass the non dataframe value as an argument to udf.</p>

<pre><code>val df2 = df1.withColumn("newcol", udffunc(df1("col1"), x)).
</code></pre>

<p>The udf function i defined as below.</p>

<pre><code>udffunc = udf(method _)
</code></pre>

<p>Method i defined as below.</p>

<pre><code>def method(inputvar1: String, inputvar2: String): Option[Long] = {
  ...
  ...
  return Longvariable
}
</code></pre>