About spark issue that you refer to, it's is not related to your problem :D
In this case, you only have to to is using withColumn function. For example:
import org.apache.spark.sql.functions._
val getRange = udf((x: Int) => get price range code ...)
val priceRange = resultPrice.withColumn("range",
hi guys, I have a dataframe with 3 columns, id(int) ,type(string)
,price(string) , and I want to add a column "price range", according to the
value of price. I checked the SPARK-15383, however in my code I just want
to append a column, which is transforming from the original dataframe