Github user akashrn5 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2533#discussion_r204297035 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonRelation.scala --- @@ -173,15 +175,38 @@ case class CarbonRelation( .getValidAndInvalidSegments.getValidSegments.asScala var size = 0L // for each segment calculate the size - segments.foreach {validSeg => - // for older store - if (null != validSeg.getLoadMetadataDetails.getDataSize && - null != validSeg.getLoadMetadataDetails.getIndexSize) { - size = size + validSeg.getLoadMetadataDetails.getDataSize.toLong + - validSeg.getLoadMetadataDetails.getIndexSize.toLong - } else { - size = size + FileFactory.getDirectorySize( - CarbonTablePath.getSegmentPath(tablePath, validSeg.getSegmentNo)) + if (carbonTable.getTableInfo.getFactTable.getTableProperties.asScala + .get(CarbonCommonConstants.FLAT_FOLDER).isDefined && + carbonTable.getTableInfo.getFactTable.getTableProperties.asScala --- End diff -- i have handled it, as you said, no need of these changes
---