You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/02/24 13:11:20 UTC

[GitHub] [carbondata] kunal642 commented on a change in pull request #3631: [CARBONDATA-3696] Avoid list db's all Tables to check table exists in the db

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:
users@infra.apache.org


With regards,
Apache Git Services