diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala index a664c7338bad..674d3abca05e 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala @@ -2137,6 +2137,11 @@ class Dataset[T] private[sql]( * `column`'s expression must only refer to attributes supplied by this Dataset. It is an * error to add a column that refers to some other Dataset. * + * Please notice that this method introduces a `Project`. This means that using it in loops in + * order to add several columns can generate very big plans which can cause huge performance + * issues and even `StackOverflowException`s. A much better alternative use `select` with the + * list of columns to add. + * * @group untypedrel * @since 2.0.0 */