[ 
https://issues.apache.org/jira/browse/CARBONDATA-50?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381327#comment-15381327
 ] 

ASF GitHub Bot commented on CARBONDATA-50:
------------------------------------------

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

    https://github.com/apache/incubator-carbondata/pull/35#discussion_r71081788
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/spark/sql/optimizer/CarbonOptimizer.scala
 ---
    @@ -37,427 +36,461 @@ import org.carbondata.spark.CarbonFilters
     /**
      * Carbon Optimizer to add dictionary decoder.
      */
    -class CarbonOptimizer(optimizer: Optimizer, conf: CatalystConf)
    -  extends Optimizer with PredicateHelper {
    +object CarbonOptimizer {
     
    -  val batches = Nil
    +  def optimizer(optimizer: Optimizer, conf: CarbonSQLConf, version: 
String): Optimizer = {
    +    
CodeGenerateFactory.getInstance().optimizerFactory.createOptimizer(optimizer, 
conf)
    +  }
     
    -  override def execute(plan: LogicalPlan): LogicalPlan = {
    +  def execute(plan: LogicalPlan, optimizer: Optimizer): LogicalPlan = {
         val executedPlan: LogicalPlan = optimizer.execute(plan)
    -    val relations = collectCarbonRelation(plan)
    +    val relations = CarbonOptimizer.collectCarbonRelation(plan)
         if (relations.nonEmpty) {
    -      new ResolveCarbonFunctions(relations)(executedPlan)
    +      new ResolveCarbonFunctions(relations).apply(executedPlan)
         } else {
           executedPlan
         }
       }
     
    -  /**
    -   * It does two jobs. 1. Change the datatype for dictionary encoded 
column 2. Add the dictionary
    -   * decoder plan.
    -   */
    -  class ResolveCarbonFunctions(relations: Seq[CarbonDecoderRelation]) 
extends
    -    Rule[LogicalPlan] {
    -    def apply(plan: LogicalPlan): LogicalPlan = {
    -      transformCarbonPlan(plan, relations)
    +  // get the carbon relation from plan.
    +  def collectCarbonRelation(plan: LogicalPlan): Seq[CarbonDecoderRelation] 
= {
    +    plan collect {
    +      case l: LogicalRelation if 
l.relation.isInstanceOf[CarbonDatasourceRelation] =>
    +        CarbonDecoderRelation(l.attributeMap, 
l.relation.asInstanceOf[CarbonDatasourceRelation])
         }
    +  }
    +}
    +
    +/**
    + * It does two jobs. 1. Change the datatype for dictionary encoded column 
2. Add the dictionary
    + * decoder plan.
    + */
    +class ResolveCarbonFunctions(
    +    relations: Seq[CarbonDecoderRelation])
    --- End diff --
    
    Can move to previous line


> Support Spark 1.6.2 in CarbonData
> ---------------------------------
>
>                 Key: CARBONDATA-50
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-50
>             Project: CarbonData
>          Issue Type: New Feature
>            Reporter: Ravindra Pesala
>            Assignee: Ravindra Pesala
>
> Current carbon cannot support latest Spark version 1.6.2.  It should be 
> supported with new maven profile like below
> {code}
>  mvn clean -Pspark-1.6.2 package
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to