Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1651#discussion_r156611792
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateUtil.scala
 ---
    @@ -514,9 +514,16 @@ object PreAggregateUtil {
           CarbonCommonConstants.VALIDATE_CARBON_INPUT_SEGMENTS +
           parentCarbonTable.getDatabaseName + "." +
           parentCarbonTable.getTableName, validateSegments.toString)
    -    val headers = 
parentCarbonTable.getTableInfo.getDataMapSchemaList.asScala.
    -      
find(_.getChildSchema.getTableName.equals(dataMapIdentifier.table)).get.getChildSchema.
    -      getListOfColumns.asScala.map(_.getColumnName).mkString(",")
    +    val dataMapSchemas = 
parentCarbonTable.getTableInfo.getDataMapSchemaList.asScala
    +    val headers = 
dataMapSchemas.find(_.getChildSchema.getTableName.equalsIgnoreCase(
    +      dataMapIdentifier.table)) match {
    +      case Some(dataMapSchema) =>
    +        
dataMapSchema.getChildSchema.getListOfColumns.asScala.map(_.getColumnName).mkString(",")
    +      case None =>
    --- End diff --
    
    This is just to throw a proper exception if ever this condition is met. The 
message will tell which aggregate table is not present in the datamap schema 
list. 


---

Reply via email to