You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/11 12:38:28 UTC
[GitHub] viirya commented on a change in pull request #23285:
[SPARK-26224][SQL] Avoid creating many project on subsequent calls to
withColumn
viirya commented on a change in pull request #23285: [SPARK-26224][SQL] Avoid creating many project on subsequent calls to withColumn
URL: https://github.com/apache/spark/pull/23285#discussion_r240592731
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
##########
@@ -2146,7 +2146,7 @@ class Dataset[T] private[sql](
* Returns a new Dataset by adding columns or replacing the existing columns that has
* the same names.
*/
- private[spark] def withColumns(colNames: Seq[String], cols: Seq[Column]): DataFrame = {
+ private[spark] def withColumns(colNames: Seq[String], cols: Seq[Column]): DataFrame = withPlan {
Review comment:
As stated on the JIRA ticket, the problem is deep query plan. I think we can have many ways to create such deep query plan, not only for `withColumns`. For example, you can call `select` many times to do that too. This change makes `withColumns` a special case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org