1. [SPARK-25371][SQL][BACKPORT-2.3] struct() should allow being called with (details)
Commit d8ec5ff7502451f61f2be3871d9bd1461b26accd by wenchen
[SPARK-25371][SQL][BACKPORT-2.3] struct() should allow being called with
0 args
## What changes were proposed in this pull request?
SPARK-21281 introduced a check for the inputs of `CreateStructLike` to
be non-empty. This means that `struct()`, which was previously
considered valid, now throws an Exception.  This behavior change was
introduced in 2.3.0. The change may break users' application on upgrade
and it causes `VectorAssembler` to fail when an empty `inputCols` is
The PR removes the added check making `struct()` valid again.
## How was this patch tested?
added UT
Closes #22391 from mgaido91/SPARK-25371_2.3.
Authored-by: Marco Gaido <> Signed-off-by: Wenchen
Fan <>
The file was modifiedsql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala (diff)
The file was modifiedmllib/src/test/scala/org/apache/spark/ml/feature/VectorAssemblerSuite.scala (diff)