Github user hhbyyh commented on a diff in the pull request: https://github.com/apache/spark/pull/19993#discussion_r158344862 --- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala --- @@ -249,6 +250,31 @@ object ParamValidators { def arrayLengthGt[T](lowerBound: Double): Array[T] => Boolean = { (value: Array[T]) => value.length > lowerBound } + + /** + * Checks that either inputCols and outputCols are set or inputCol and outputCol are set. If + * this is not true, an `IllegalArgumentException` is raised. + * @param model + */ + private[spark] def checkMultiColumnParams(model: Params): Unit = { + model match { + case m: HasInputCols with HasInputCol if m.isSet(m.inputCols) && m.isSet(m.inputCol) => + raiseIncompatibleParamsException("inputCols", "inputCol") + case m: HasOutputCols with HasInputCol if m.isSet(m.outputCols) && m.isSet(m.inputCol) => + raiseIncompatibleParamsException("outputCols", "inputCol") + case m: HasInputCols with HasOutputCol if m.isSet(m.inputCols) && m.isSet(m.outputCol) => --- End diff -- Sorry to miss it, but I just found that FeatureHasher has both InputCols and OutputCol. I think we can remove the case and the one above since they can be too strict.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org