kunal642 commented on a change in pull request #3631: [CARBONDATA-3696] Avoid
list db's all Tables to check table exists in the db
URL: https://github.com/apache/carbondata/pull/3631#discussion_r383255402
##########
File path:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableAsSelectCommand.scala
##########
@@ -54,8 +54,8 @@ case class CarbonCreateTableAsSelectCommand(
setAuditTable(dbName, tableName)
setAuditInfo(Map("query" -> query.simpleString))
// check if table already exists
- if (sparkSession.sessionState.catalog.listTables(dbName)
- .exists(_.table.equalsIgnoreCase(tableName))) {
+ if (!sparkSession.sessionState.catalog
+ .tableExists(TableIdentifier(tableName, Some(dbName)))) {
Review comment:
We need to check if the table exists, currently because of the ! check the
condition is reversed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services