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

 ##########
 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:
   I'm sorry. It's my mistake.
   
   What I mean is It's very bad to use `listTables` to check table's existence 
instead of `tableExists`.
   
   I've rebased and fixed this.

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

Reply via email to