ueshin commented on code in PR #48829: URL: https://github.com/apache/spark/pull/48829#discussion_r1844320464
########## sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala: ########## @@ -95,13 +95,12 @@ private[sql] object Dataset { def ofRows(sparkSession: SparkSession, logicalPlan: LogicalPlan): DataFrame = sparkSession.withActive { val qe = sparkSession.sessionState.executePlan(logicalPlan) - val encoder = if (qe.isLazyAnalysis) { - RowEncoder.encoderFor(new StructType()) + if (qe.isLazyAnalysis) { Review Comment: The lazy encoder creation only happens when `qe.isLazyAnalysis`; otherwise create it right here as same as before to avoid changing the behavior. `Dataset` has a new default constructor to take a function for the lazy case, and the original default constructor is still there to keep the behavior. The suggested cleanup doesn't keep the original behavior for non-lazy case. -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org