Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/22514#discussion_r227654755 --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala --- @@ -45,6 +46,11 @@ case class CreateHiveTableAsSelectCommand( override def run(sparkSession: SparkSession, child: SparkPlan): Seq[Row] = { val catalog = sparkSession.sessionState.catalog + val metastoreCatalog = catalog.asInstanceOf[HiveSessionCatalog].metastoreCatalog + + // Whether this table is convertible to data source relation. + val isConvertible = metastoreCatalog.isConvertible(tableDesc) --- End diff -- I feel `CreateHiveTableAsSelectCommand` is not useful. It simply creates the table first and then call `InsertIntoHiveTable.run`. Maybe we should just remove it and implement hive table CTAS as `Union(CreateTable, InsertIntoTable)`.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org