akkio-97 commented on a change in pull request #4129:
URL: https://github.com/apache/carbondata/pull/4129#discussion_r639481683



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableColRenameDataTypeChangeCommand.scala
##########
@@ -83,6 +76,69 @@ private[sql] case class 
CarbonAlterTableColRenameDataTypeChangeCommand(
     childTableColumnRename: Boolean = false)
   extends 
CarbonAlterTableColumnRenameCommand(alterTableColRenameAndDataTypeChangeModel.columnName,
     alterTableColRenameAndDataTypeChangeModel.newColumnName) {
+  // stores mapping of altered children column names:
+  // new_column_name -> column_datatype
+  val alteredColumnNamesMap = collection.mutable.HashMap.empty[String, String]
+
+  // stores mapping of: column_name -> new_column_datatype
+  val alteredColumnDatatypesMap = collection.mutable.HashMap.empty[String, 
String]
+
+  /**
+   * This method checks the structure of the old and new complex columns, and-
+   * 1. throws exception if the number of complex-levels in both columns does 
not match
+   * 2. throws exception if the number of children of both columns does not 
match
+   * 3. creates alteredColumnNamesMap: new_column_name -> datatype. Here 
new_column_name are those
+   *    names of the columns that are altered.
+   * 4. creates alteredColumnDatatypesMap: column_name -> new_datatype.
+   * These maps will later be used while altering the table schema
+   */
+  def validateComplexStructure(dimension: List[CarbonDimension],
+      newDataTypeInfo: List[DataTypeInfo]): Unit = {
+    if (dimension == null && newDataTypeInfo == null) {

Review comment:
       they are required as the parser does not handle them.




-- 
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