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-tp107751p107890.html
akashrn5 commented on a change in pull request #4121:
URL:
https://github.com/apache/carbondata/pull/4121#discussion_r620146334##########
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 + '.'
+ else if (columnSchema.column_name.toLowerCase.startsWith(
Review comment:
please correct the style, 158 line should be at 156. Move `.startsWith` to next line
--
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]