pan3793 commented on code in PR #53129:
URL: https://github.com/apache/spark/pull/53129#discussion_r2541318987


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/GlobalTempViewManager.scala:
##########
@@ -55,9 +55,17 @@ class GlobalTempViewManager(database: String) {
   def create(
       name: String,
       viewDefinition: TemporaryViewRelation,
+      ignoreIfExists: Boolean,
       overrideIfExists: Boolean): Unit = synchronized {
-    if (!overrideIfExists && viewDefinitions.contains(name)) {
-      throw new TempTableAlreadyExistsException(name)
+    if (ignoreIfExists && overrideIfExists) {
+      throw 
QueryCompilationErrors.createViewWithBothIfNotExistsAndReplaceError()

Review Comment:
   is it okay to reuse `CREATE_OR_REPLACE_WITH_IF_NOT_EXISTS_IS_NOT_ALLOWED`, 
or better suggestion?



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala:
##########
@@ -81,7 +81,8 @@ case class CreateViewCommand(
   extends RunnableCommand
   with AnalysisOnlyCommand
   with CTEInChildren
-  with CreateTempView {
+  with CreateTempView
+  with SessionStateHelper {

Review Comment:
   as I touch this file, I fixed the IDE index issue of the while file by 
leveraging `SessionStateHelper`



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/ddl.scala:
##########
@@ -76,10 +76,11 @@ case class CreateTable(
 case class CreateTempViewUsing(
     tableIdent: TableIdentifier,
     userSpecifiedSchema: Option[StructType],
+    ignoreIfExists: Boolean,
     replace: Boolean,
     global: Boolean,
     provider: String,
-    options: Map[String, String]) extends LeafRunnableCommand {
+    options: Map[String, String]) extends LeafRunnableCommand with 
SessionStateHelper {

Review Comment:
   same here, fixes IDE-index issue



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to