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/03/03 11:24:17 UTC

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

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


With regards,
Apache Git Services