Posted by
GitBox on
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-akkio-97-opened-a-new-pull-request-4121-CARBONDATA-4170-Support-dropping-of-single-tp107751p107881.html
akashrn5 commented on a change in pull request #4121:
URL:
https://github.com/apache/carbondata/pull/4121#discussion_r620103091##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableDropColumnCommand.scala
##########
@@ -147,19 +143,30 @@ private[sql] case class CarbonAlterTableDropColumnCommand(
metastore.getThriftTableInfo(carbonTable)
// maintain the deleted columns for schema evolution history
var deletedColumnSchema = ListBuffer[org.apache.carbondata.format.ColumnSchema]()
+ var deletedParentColumns = ListBuffer[org.apache.carbondata.format.ColumnSchema]()
val columnSchemaList = tableInfo.fact_table.table_columns.asScala
alterTableDropColumnModel.columns.foreach { column =>
columnSchemaList.foreach { columnSchema =>
- if (!columnSchema.invisible && column.equalsIgnoreCase(columnSchema.column_name)) {
- deletedColumnSchema += columnSchema.deepCopy
- columnSchema.invisible = true
+ if (!columnSchema.invisible) {
+ if (column.equalsIgnoreCase(columnSchema.column_name)) {
+ val columnSchemaCopy = columnSchema.deepCopy
+ deletedParentColumns += columnSchemaCopy
+ deletedColumnSchema += columnSchemaCopy
+ columnSchema.invisible = true
+ }
+ // complex children are prefixed with -> parent_name + '.'
+ if (columnSchema.column_name.toLowerCase.startsWith(
+ column + CarbonCommonConstants.POINT)) {
+ deletedColumnSchema += columnSchema.deepCopy
Review comment:
similarly to add column, the column schema should contain the number of child, that should be ok.
--
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:
[hidden email]