title: How to transform a categorical variable in Spark into a set of columns coded as {0,1}?
body: <p>I'm trying to perform a logistic regression (LogisticRegressionWithLBFGS) with Spark MLlib (with Scala) on a dataset which contains categorical variables. I discover Spark was not able to work with that kind of variable.</p>
  
  <p>In R there is a simple way to deal with that kind of problem : I transform the variable in factor (categories), so R creates a set of columns coded as {0,1} indicator variables.</p>
  
  <p>How can I perform this with Spark?</p>