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

    https://github.com/apache/carbondata/pull/3027#discussion_r244272092
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableColRenameDataTypeChangeCommand.scala
 ---
    @@ -262,13 +263,26 @@ private[sql] case class 
CarbonAlterTableColRenameDataTypeChangeCommand(
           carbonTable: CarbonTable,
           tableInfo: TableInfo,
           addColumnSchema: ColumnSchema,
    -      schemaEvolutionEntry: SchemaEvolutionEntry): Unit = {
    +      schemaEvolutionEntry: SchemaEvolutionEntry,
    +      oldCarbonColumn: CarbonColumn): Unit = {
         val schemaConverter = new ThriftWrapperSchemaConverterImpl
    -    val a = 
List(schemaConverter.fromExternalToWrapperColumnSchema(addColumnSchema))
    +    // get the carbon column in schema order
    +    val carbonColumns = 
carbonTable.getCreateOrderColumn(carbonTable.getTableName).asScala
    +      .filter(!_.isInvisible).collect{case carbonColumn => 
carbonColumn.getColumnSchema}
    +    // get the schema ordinal of the column for which the datatype changed 
or column is renamed
    +    val schemaOrdinal = carbonColumns.collect {
    --- End diff --
    
    Instead of collect try and use foreach


---

Reply via email to