Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/14482#discussion_r73568017 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala --- @@ -420,45 +420,40 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] { object DDLStrategy extends Strategy { def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match { - case c: CreateTableUsing if c.temporary && !c.allowExisting => - logWarning( - s"CREATE TEMPORARY TABLE ${c.tableIdent.identifier} USING... is deprecated, " + - s"please use CREATE TEMPORARY VIEW viewName USING... instead") - ExecutedCommandExec( - CreateTempViewUsing( - c.tableIdent, c.userSpecifiedSchema, replace = true, c.provider, c.options)) :: Nil - - case c: CreateTableUsing if !c.temporary => + case CreateTable(tableDesc, mode, None) if tableDesc.provider.get == "hive" => + val cmd = CreateTableCommand(tableDesc, ifNotExists = mode == SaveMode.Ignore) + ExecutedCommandExec(cmd) :: Nil + + case CreateTable(tableDesc, mode, None) => val cmd = CreateDataSourceTableCommand( - c.tableIdent, - c.userSpecifiedSchema, - c.provider, - c.options, - c.partitionColumns, - c.bucketSpec, - c.allowExisting, - c.managedIfNoPath) + tableDesc.identifier, + if (tableDesc.schema.nonEmpty) Some(tableDesc.schema) else None, + tableDesc.provider.get, + tableDesc.storage.properties, + tableDesc.partitionColumnNames.toArray, + tableDesc.bucketSpec, + ignoreIfExists = mode == SaveMode.Ignore, + managedIfNoPath = tableDesc.tableType == CatalogTableType.MANAGED) --- End diff -- A little bit tricky here, but the change is not a bug. Maybe leave a TODO here? When we reimplementing the write path, we can simplify the logics to determine the table type.
--- 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