akashrn5 commented on code in PR #4277: URL: https://github.com/apache/carbondata/pull/4277#discussion_r904630776
########## integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableDropColumnCommand.scala: ########## @@ -177,25 +175,8 @@ private[sql] case class CarbonAlterTableDropColumnCommand( carbonTable, schemaEvolutionEntry, tableInfo)(sparkSession) - // get the columns in schema order and filter the dropped column in the column set - val cols = carbonTable.getCreateOrderColumn.asScala - .collect { case carbonColumn if !carbonColumn.isInvisible => carbonColumn.getColumnSchema } - .filterNot(column => delCols.contains(column)) - // When we call - // alterExternalCatalogForTableWithUpdatedSchema to update the new schema to external catalog - // in case of drop column, spark gets the catalog table and then it itself adds the partition - // columns if the table is partition table for all the new data schema sent by carbon, - // so there will be duplicate partition columns, so send the columns without partition columns - val columns = if (carbonTable.isHivePartitionTable) { - val partitionColumns = partitionInfo.getColumnSchemaList.asScala - val carbonColumnsWithoutPartition = cols.filterNot(col => partitionColumns.contains(col)) - Some(carbonColumnsWithoutPartition) - } else { - Some(cols) - } - CarbonSessionCatalogUtil.alterDropColumns( - tableIdentifier, columns, sparkSession) - sparkSession.catalog.refreshTable(tableIdentifier.quotedString) + AlterTableUtil.revertSchemaInCaseOfFailure(carbonTable, Review Comment: please rename the method to a more meaningful one -- 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. To unsubscribe, e-mail: dev-unsubscr...@carbondata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org