Github user akashrn5 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2390#discussion_r197019547
--- Diff:
integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
---
@@ -400,6 +403,34 @@ abstract class CarbonDDLSqlParser extends
AbstractCarbonSparkSQLParser {
tableComment)
}
+ /**
+ * this method validates whether any of the child columns of complex
dataType column
+ * is of type string.
+ */
+ def validateChildColumns(field: Field): Boolean = {
+ var stringColumnCount = 0
+ def validateChildColumnsRecursively(field: Field): Unit = {
+ if (field.children.isDefined && null != field.children.get) {
+ field.children.get.foreach { childColumn =>
+ if (childColumn.children.isDefined && null !=
childColumn.children.get) {
+ validateChildColumnsRecursively(childColumn)
+ }
+ else {
+ if (childColumn.dataType.get.equalsIgnoreCase("string")) {
+ stringColumnCount += 1
+ }
+ }
+ }
+ }
+ }
+
--- End diff --
remove empty line here and add a proper comment
---