Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15996#discussion_r89411051
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/createDataSourceTables.scala
---
@@ -134,114 +134,57 @@ case class CreateDataSourceTableAsSelectCommand(
val tableIdentWithDB = table.identifier.copy(database = Some(db))
val tableName = tableIdentWithDB.unquotedString
- var createMetastoreTable = false
- var existingSchema = Option.empty[StructType]
if (sparkSession.sessionState.catalog.tableExists(tableIdentWithDB)) {
- // Check if we need to throw an exception or just return.
- mode match {
- case SaveMode.ErrorIfExists =>
- throw new AnalysisException(s"Table $tableName already exists. "
+
- s"If you are using saveAsTable, you can set SaveMode to
SaveMode.Append to " +
- s"insert data into the table or set SaveMode to
SaveMode.Overwrite to overwrite" +
- s"the existing data. " +
- s"Or, if you are using SQL CREATE TABLE, you need to drop
$tableName first.")
- case SaveMode.Ignore =>
- // Since the table already exists and the save mode is Ignore,
we will just return.
- return Seq.empty[Row]
- case SaveMode.Append =>
- // Check if the specified data source match the data source of
the existing table.
- val existingProvider = DataSource.lookupDataSource(provider)
- // TODO: Check that options from the resolved relation match the
relation that we are
- // inserting into (i.e. using the same compression).
--- End diff --
This todo is still valid?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]