https://github.com/apache/spark
Revision f2453e8a1293b367c2d7794e7f37978cc848aebc authored by Weichen Xu on 15 August 2022, 10:03:08 UTC, committed by Weichen Xu on 15 August 2022, 10:08:51 UTC
Signed-off-by: Weichen Xu <weichen.xudatabricks.com>

### What changes were proposed in this pull request?
Add Imputer inputCols validation for empty input case

### Why are the changes needed?
If Imputer inputCols is empty, the `fit` works fine but when saving model, error will be raised:

>
AnalysisException:
Datasource does not support writing empty or nested empty schemas.
Please make sure the data schema has at least one or more column(s).

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Unit test.

Closes #37518 from WeichenXu123/imputer-param-validation.

Authored-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
(cherry picked from commit 87094f89655b7df09cdecb47c653461ae855b0ac)
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
1 parent 6242776
History
Tip revision: f2453e8a1293b367c2d7794e7f37978cc848aebc authored by Weichen Xu on 15 August 2022, 10:03:08 UTC
[SPARK-40079] Add Imputer inputCols validation for empty input case
Tip revision: f2453e8

README.md

back to top