viirya commented on code in PR #44377:
URL: https://github.com/apache/spark/pull/44377#discussion_r1435331756


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -233,21 +244,7 @@ class V2SessionCatalog(catalog: SessionCatalog)
         throw QueryCompilationErrors.tableAlreadyExistsError(ident)
     }
 
-    val table = loadTable(ident)
-
-    // Check if the schema of the created table matches the given schema.
-    // TODO: move this check in loadTable to match the behavior with
-    // existing file data sources.
-    if (schema.nonEmpty) {
-      val tableSchema = CharVarcharUtils.replaceCharVarcharWithStringInSchema(
-        table.columns().asSchema)
-      if (!DataType.equalsIgnoreNullability(tableSchema, schema)) {
-        throw QueryCompilationErrors.dataSourceTableSchemaMismatchError(
-          table.columns().asSchema, schema)
-      }
-    }
-
-    table
+    null // Return null to save the `loadTable` call for CREATE TABLE without 
AS SELECT.

Review Comment:
   Is this worth noting in migration guide?



-- 
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