maryannxue commented on a change in pull request #25569: [SPARK-28863][SQL] Introduce AlreadyPlanned, a node that speeds-up planning URL: https://github.com/apache/spark/pull/25569#discussion_r322987833
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V1FallbackWriters.scala ########## @@ -111,11 +107,10 @@ sealed trait V1FallbackWriters extends SupportsV1Write { * A trait that allows Tables that use V1 Writer interfaces to append data. */ trait SupportsV1Write extends SparkPlan { - // TODO: We should be able to work on SparkPlans at this point. - def plan: LogicalPlan + def query: SparkPlan protected def writeWithV1(relation: InsertableRelation): RDD[InternalRow] = { - relation.insert(Dataset.ofRows(sqlContext.sparkSession, plan), overwrite = false) + relation.insert(AlreadyPlanned.dataFrame(sqlContext.sparkSession, query), overwrite = false) Review comment: +1. It's probably not worth saving the compilation time if we end up generating a bad plan. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org