viirya commented on code in PR #44377:
URL: https://github.com/apache/spark/pull/44377#discussion_r1435331398
##########
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:
Hmm, internally we can catch callers of this and add `Option` like this
does. A concern is it might break some usages externally? The API return type
is not changed, so users might need to dig into this change and find that this
API could return null.
--
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]