Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/308#discussion_r87191882
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
 ---
    @@ -1284,14 +1284,18 @@ private[sql] case class 
DropTableCommand(ifExistsSet: Boolean, databaseNameOp: O
           .getCarbonLockObj(carbonTableIdentifier, LockUsage.DROP_TABLE_LOCK)
         val storePath = 
CarbonEnv.getInstance(sqlContext).carbonCatalog.storePath
         var isLocked = false
    +    val tmpTable = 
org.apache.carbondata.core.carbon.metadata.CarbonMetadata.getInstance()
    +      .getCarbonTable(dbName + '_' + tableName)
         try {
    -      isLocked = carbonLock.lockWithRetries()
    -      if (isLocked) {
    -        logInfo("Successfully able to get the lock for drop.")
    -      }
    -      else {
    -        LOGGER.audit(s"Dropping table $dbName.$tableName failed as the 
Table is locked")
    -        sys.error("Table is locked for deletion. Please try after some 
time")
    +      if (null != tmpTable) {
    --- End diff --
    
    It is better to use 
`CarbonEnv.getInstance(sqlContext).carbonCatalog.tableExists` 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to