You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by manishgupta88 <gi...@git.apache.org> on 2018/04/10 07:07:35 UTC

[GitHub] carbondata pull request #2143: [CARBONDATA-2317] Concurrent datamap with sam...

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 


---