Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/14612#discussion_r87330702 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala --- @@ -88,6 +88,21 @@ case class AnalyzeCreateTable(sparkSession: SparkSession) extends Rule[LogicalPl } c + // CTAS from DataFrameWriter saveAsTable API + // Handling the case when the source table is Hive serde tables. + case c @ CreateTable(tableDesc, mode, Some(query)) + if mode == SaveMode.Append && isHiveSerdeTable(tableDesc.identifier) => + val catalog = sparkSession.sessionState.catalog + catalog.lookupRelation(tableDesc.identifier) match { --- End diff -- is it possible that we can extract the similar logic in `CreateDataSourceTableAsSelectCommand` here?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org