ajantha-bhat commented on a change in pull request #3979:
URL: https://github.com/apache/carbondata/pull/3979#discussion_r503097655



##########
File path: 
integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
##########
@@ -1011,38 +1011,46 @@ object CommonUtil {
       objectDataType: DataType): AnyRef = {
     objectDataType match {
       case _: ArrayType =>
-        val arrayDataType = objectDataType.asInstanceOf[ArrayType]
-        val arrayData = data.asInstanceOf[UnsafeArrayData]
-        val size = arrayData.numElements()
-        val childDataType = arrayDataType.elementType
-        val arrayChildObjects = new Array[AnyRef](size)
-        var i = 0
-        while (i < size) {
-          arrayChildObjects(i) = 
convertSparkComplexTypeToCarbonObject(arrayData.get(i,
-            childDataType), childDataType)
-          i = i + 1
+        if (data == null) {

Review comment:
       after line 1011, add a check that if data type is array or struct or map 
and the data is null, return null to avoid changing many lines.




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