You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/02/25 05:20:14 UTC

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3634: [CARBONDATA-3720] Support alter table scenario for new insert into flow

ajantha-bhat commented on a change in pull request #3634: [CARBONDATA-3720] Support alter table scenario for new insert into flow
URL: https://github.com/apache/carbondata/pull/3634#discussion_r383663627
 
 

 ##########
 File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala
 ##########
 @@ -449,67 +443,48 @@ case class CarbonInsertIntoCommand(databaseNameOp: Option[String],
     }
   }
 
-  private def isAlteredSchema(tableSchema: TableSchema): Boolean = {
-    if (tableInfo.getFactTable.getSchemaEvolution != null) {
-      tableInfo
-        .getFactTable
-        .getSchemaEvolution
-        .getSchemaEvolutionEntryList.asScala.exists(entry =>
-        (entry.getAdded != null && entry.getAdded.size() > 0) ||
-        (entry.getRemoved != null && entry.getRemoved.size() > 0)
-      )
-    } else {
-      false
-    }
-  }
-
   def getReArrangedIndexAndSelectedSchema(
       tableInfo: TableInfo,
       partitionColumnSchema: mutable.Buffer[ColumnSchema]): (Seq[Int], Seq[ColumnSchema]) = {
     var reArrangedIndex: Seq[Int] = Seq()
     var selectedColumnSchema: Seq[ColumnSchema] = Seq()
-    var complexChildCount: Int = 0
     var partitionIndex: Seq[Int] = Seq()
-    val columnSchema = tableInfo.getFactTable.getListOfColumns.asScala
+    val internalOrderColumns: util.ArrayList[CarbonColumn] = new util.ArrayList[CarbonColumn]()
+    internalOrderColumns.addAll(table.getVisibleDimensions)
+    internalOrderColumns.addAll(table.getVisibleMeasures)
+    val columnSchema = internalOrderColumns.asScala.map(col => col.getColumnSchema)
 
 Review comment:
   yes, can be done like this now. previously it was used for something else

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services