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

    https://github.com/apache/carbondata/pull/2806#discussion_r227251258
  
    --- Diff: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/RefreshCarbonTableCommand.scala
 ---
    @@ -118,6 +122,26 @@ case class RefreshCarbonTableCommand(
         Seq.empty
       }
     
    +  /**
    +   * Refresh the sort_column flag in column schema in case of old store. 
Before V3, sort_column
    +   * option is not set but by default all dimension columns should be 
treated
    +   * as sort columns if SORT_COLUMNS property is not defined in 
tblproperties
    +   *
    +   * @param tableInfo
    +   */
    +  def refreshColumnSchema(tableInfo: TableInfo): Unit = {
    +    val tableProps: mutable.Map[String, String] = 
tableInfo.getFactTable.getTableProperties.asScala
    +    val sortColumns = tableProps.get(CarbonCommonConstants.SORT_COLUMNS)
    +    sortColumns match {
    +      case Some(sortColumn) =>
    +      // don't do anything
    +      case None =>
    +        // iterate over all the columns and make all the dimensions as 
sort columns true
    +        tableInfo.getFactTable.getListOfColumns.asScala collect
    +        ({case columnSchema if columnSchema.isDimensionColumn => 
columnSchema.setSortColumn(true)})
    --- End diff --
    
    Validate the scenario for complex type as sort column


---

Reply via email to