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



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -235,6 +236,26 @@ class AlterTableColumnSchemaGenerator(
     dataType.toString.equals("STRUCT")
   }
 
+  private def createChildSchema(childField: Field, currentSchemaOrdinal: Int): 
ColumnSchema = {
+    // TODO: should support adding multi-level complex columns: CARBONDATA-4164
+    if (!childField.children.contains(null)) {

Review comment:
       .contains, can we replace with `isDefined`? thats more clear

##########
File path: docs/ddl-of-carbondata.md
##########
@@ -694,7 +694,7 @@ CarbonData DDL statements are documented here,which 
includes:
      ```
      ALTER TABLE carbon ADD COLUMNS (a1 INT, b1 STRING) 
TBLPROPERTIES('DEFAULT.VALUE.a1'='10')
      ```
-      **NOTE:** Add Complex datatype columns is not supported.
+      **NOTE:** Adding of only single-level Complex datatype columns(only 
array and struct) is supported.

Review comment:
       please give example if adding complex column array and struct

##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -235,6 +236,26 @@ class AlterTableColumnSchemaGenerator(
     dataType.toString.equals("STRUCT")
   }
 
+  private def createChildSchema(childField: Field, currentSchemaOrdinal: Int): 
ColumnSchema = {
+    // TODO: should support adding multi-level complex columns: CARBONDATA-4164
+    if (!childField.children.contains(null)) {
+      throw new UnsupportedOperationException(
+        "Alter add columns with single-level complex types are only allowed")

Review comment:
       ```suggestion
           "Alter add columns with nested complex types is not allowed")
   ```




-- 
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:
us...@infra.apache.org


Reply via email to