xxxxxxxxxx
import org.apache.spark.ml.feature.QuantileDiscretizer
val data = Array((13000, 1), (30000, 2), (10000, 3), (5000, 4))
val df = spark.createDataFrame(data).toDF("amount", "id")
val discretizer = new QuantileDiscretizer()
.setInputCol("amount")
.setOutputCol("result")
.setNumBuckets(4)
val result = discretizer.fit(df).transform(df)
result.show()