akashrn5 commented on code in PR #4277:
URL: https://github.com/apache/carbondata/pull/4277#discussion_r904631943
##########
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(
Review Comment:
please check if the same issue exists for alter drop column, column rename
also and handle the same
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]