You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by xubo245 <gi...@git.apache.org> on 2018/02/23 03:13:54 UTC

[GitHub] carbondata pull request #1835: [CARBONDATA-2057] Support specifying path whe...

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

    https://github.com/apache/carbondata/pull/1835#discussion_r163775104
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonDropDataMapCommand.scala ---
    @@ -68,18 +69,12 @@ case class CarbonDropDataMapCommand(
             lock => carbonLocks += CarbonLockUtil.getLockObject(tableIdentifier, lock)
           }
           LOGGER.audit(s"Deleting datamap [$dataMapName] under table [$tableName]")
    -      var carbonTable: Option[CarbonTable] =
    -        catalog.getTableFromMetadataCache(dbName, tableName)
    -      if (carbonTable.isEmpty) {
    -        try {
    -          carbonTable = Some(catalog.lookupRelation(identifier)(sparkSession)
    -            .asInstanceOf[CarbonRelation].metaData.carbonTable)
    -        } catch {
    -          case ex: NoSuchTableException =>
    -            if (!ifExistsSet) {
    -              throw ex
    -            }
    -        }
    +      val carbonTable: Option[CarbonTable] = try {
    +        Some(CarbonEnv.getCarbonTable(databaseNameOp, tableName)(sparkSession))
    +      } catch {
    +        case ex: NoSuchTableException =>
    +          if (!ifExistsSet) throw ex
    --- End diff --
    
    if add this line, when run "DROP DATAMAP IF EXISTS agg1_month ON TABLE mainTableNotExist", it will not throw exception if the table not exists. So we should remove it.  https://github.com/apache/carbondata/pull/1858/files


---