Indhumathi27 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r613866130



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +295,39 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if (DataTypes.isArrayType(columnSchema.getDataType)) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = createChildSchema(childField, 
currentSchemaOrdinal)
+        if (childSchema.getDataType == DataTypes.VARCHAR) {
+          // put the new long string columns in 'longStringCols'
+          // and add them after old long string columns
+          longStringCols ++= Seq(childSchema)
+        } else {
+          allColumns ++= Seq(childSchema)
+        }
+        newCols ++= Seq(childSchema)
+      } else if (DataTypes.isStructType(columnSchema.getDataType)) {
+        val noOfChildren = field.children.get.size
+        columnSchema.setNumberOfChild(noOfChildren)
+        for (i <- 0 to noOfChildren - 1) {
+          val childField = field.children.get(i)
+          // TODO: should support adding multi-level complex columns: 
CARBONDATA-4164
+          if (!childField.children.contains(null)) {

Review comment:
       Please remove this check, since it is already handled in 
createChildschema method




-- 
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:
[email protected]


Reply via email to