Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/14410#discussion_r72880810 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/createDataSourceTables.scala --- @@ -236,6 +236,11 @@ case class CreateDataSourceTableAsSelectCommand( existingSchema = Some(l.schema) case s: SimpleCatalogRelation if DDLUtils.isDatasourceTable(s.metadata) => existingSchema = Some(DDLUtils.getSchemaFromTableProperties(s.metadata)) + // When the source table is a Hive table, the `saveAsTable` API of DataFrameWriter + // does not work. Instead, use the `insertInto` API. + case o if o.getClass.getName == "org.apache.spark.sql.hive.MetastoreRelation" => --- End diff -- Agree! Do you have any idea how to improve it? ``` org.apache.spark.sql.AnalysisException: Saving data in MetastoreRelation sample, sample is not supported.; ```
--- 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