carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzcclp <...@git.apache.org>
Subject [GitHub] carbondata pull request #1469: [WIP] Spark-2.2 Carbon Integration - Phase 1
Date Thu, 23 Nov 2017 05:34:53 GMT
Github user zzcclp commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1469#discussion_r152725691
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/CarbonSession.scala ---
    @@ -42,15 +42,46 @@ class CarbonSession(@transient val sc: SparkContext,
         this(sc, None)
       }
     
    +
    +  // SessionStateCodeGenerateFactory.init(sc.version)
    +  // CarbonOptimizerCodeGenerateFactory.init(sc.version)
    +  // val carbonDefaultOptimizer = CarbonOptimizerCodeGenerateFactory.getInstance()
    +  //  .carbonoptimizerFactory.createCarbonOptimizer()
    +  //  @transient
    +  //  override lazy val sessionState: SessionState = new CarbonSessionState(this)
    +
    +
    +
    +  def getSessionState(sparkContext: SparkContext): SessionState = {
    +    if (sparkContext.version.contains("2.1")) {
    +      val clazz = Utils.classForName("org.apache.spark.sql.hive.CarbonSessionState")
    +      val ctor = clazz.getConstructors.head
    +      ctor.setAccessible(true)
    +      val sessionState1 = ctor.newInstance(this).asInstanceOf[SessionState]
    +      sessionState1
    +    } else if (sparkContext.version.contains("2.2")) {
    --- End diff --
    
    use sparkContext.version.startsWith("2.2")


---

Mime
View raw message