carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kumarvishal09 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1861: [CARBONDATA-2078][CARBONDATA-1516] Add 'if no...
Date Wed, 31 Jan 2018 12:43:25 GMT
Github user kumarvishal09 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1861#discussion_r165040234
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/datamap/CarbonCreateDataMapCommand.scala
---
    @@ -49,10 +61,21 @@ case class CarbonCreateDataMapCommand(
           throw new MalformedCarbonCommandException("Streaming table does not support creating
datamap")
         }
         val LOGGER = LogServiceFactory.getLogService(this.getClass.getCanonicalName)
    +    val dbName = tableIdentifier.database.getOrElse("default")
    +    val tableName = tableIdentifier.table + "_" + dataMapName
     
    -    if (dmClassName.equalsIgnoreCase(PREAGGREGATE.toString) ||
    +    if (tableExists(sparkSession, dbName, tableName)) {
    --- End diff --
    
    tableExists method is called only from processMeta, so better not to create any method
you can update the if statement
    if(sparkSession.sessionState.catalog.listTables(dbName) .exists(_.table.equalsIgnoreCase(tableName)))



---

Mime
View raw message