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

    https://github.com/apache/carbondata/pull/1583#discussion_r155045624
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableCommand.scala
 ---
    @@ -81,15 +90,13 @@ case class CarbonCreateTableCommand(
         val carbonSchemaString = catalog.generateTableSchemaString(tableInfo, 
tableIdentifier)
         if (createDSTable) {
           try {
    -        val fields = new Array[Field](cm.dimCols.size + cm.msrCols.size)
    -        cm.dimCols.foreach(f => fields(f.schemaOrdinal) = f)
    -        cm.msrCols.foreach(f => fields(f.schemaOrdinal) = f)
    -
    -        sparkSession.sparkContext.setLocalProperty(EXECUTION_ID_KEY, null)
             val tablePath = tableIdentifier.getTablePath
    +        val carbonRelation = 
CarbonSparkUtil.createCarbonRelation(tableInfo, tablePath)
    +        val rawSchema = CarbonSparkUtil.getRawSchema(carbonRelation)
    --- End diff --
    
    While registering the table with hive we need rawSchema,
    earlier this we were getting from the column  Field


---

Reply via email to