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

    https://github.com/apache/carbondata/pull/2143#discussion_r180315475
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala
 ---
    @@ -121,21 +121,24 @@ case class CarbonCreateTableCommand(
               // isVisible property is added to hive table properties to 
differentiate between main
               // table and datamaps(like preaggregate). It is false only for 
datamaps. This is added
               // to improve the show tables performance when filtering the 
datamaps from main tables
    -          sparkSession.sql(
    -            s"""CREATE TABLE $dbName.$tableName
    -               |(${ rawSchema })
    -               |USING org.apache.spark.sql.CarbonSource
    -               |OPTIONS (
    -               |  tableName "$tableName",
    -               |  dbName "$dbName",
    -               |  tablePath "$tablePath",
    -               |  path "$tablePath",
    -               |  isExternal "$isExternal",
    -               |  isUnManaged "$isUnmanaged",
    -               |  isVisible "$isVisible"
    -               |  $carbonSchemaString)
    -               |  $partitionString
    +          // synchronized to prevent concurrently creation of table with 
same name
    +          CarbonCreateTableCommand.synchronized {
    --- End diff --
    
    CarbonCreateTableCommand is a case class and each thread will 


---

Reply via email to