title: Normalize column with Spark
body: <p>I have a data file with three columns, and I want to normalize the last column to apply ALS with ML (Spark and Scala), how can I do it?</p>
  
  <p>Here is an excerpt from my <code>Dataframe</code>:</p>
  
  <pre><code>val view_df = spark.createDataFrame(view_RDD, viewSchema)
  val viewdd = view_df.withColumn("userIdTemp", view_df("userId").cast(IntegerType)).drop("userId")
                      .withColumnRenamed("userIdTemp", "userId")
                      .withColumn("productIdTemp", view_df("productId").cast(IntegerType)).drop("productId")
                      .withColumnRenamed("productIdTemp", "productId")
                      .withColumn("viewTemp", view_df("view").cast(FloatType)).drop("view")
                      .withColumnRenamed("viewTemp", "view")`
  </code></pre>