Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153711584 --- Diff: integration/spark-common/src/main/scala/org/apache/spark/util/CarbonReflectionUtils.scala --- @@ -140,10 +140,15 @@ object CarbonReflectionUtils { def getSessionState(sparkContext: SparkContext, carbonSession: Object): Any = { if (sparkContext.version.startsWith("2.1")) { - createObject("org.apache.spark.sql.hive.CarbonSessionState", carbonSession)._1 + val className = sparkContext.conf + .get("spark.carbon.sessionstate.classname", "org.apache.spark.sql.hive.CarbonSessionState") + createObject(className, carbonSession)._1 } else if (sparkContext.version.startsWith("2.2")) { + val className = sparkContext.conf + .get("spark.carbon.sessionstate.classname", + "org.apache.spark.sql.hive.CarbonSessionStateBuilder") val tuple = - createObject("org.apache.spark.sql.hive.CarbonSessionStateBuilder", + createObject(className, --- End diff -- move `className` to nest line --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153711685 --- Diff: integration/spark-common/src/main/scala/org/apache/spark/util/CarbonReflectionUtils.scala --- @@ -140,10 +140,15 @@ object CarbonReflectionUtils { def getSessionState(sparkContext: SparkContext, carbonSession: Object): Any = { if (sparkContext.version.startsWith("2.1")) { - createObject("org.apache.spark.sql.hive.CarbonSessionState", carbonSession)._1 + val className = sparkContext.conf + .get("spark.carbon.sessionstate.classname", "org.apache.spark.sql.hive.CarbonSessionState") --- End diff -- make these string in CarbonCommonConstant instead of hard coding it here --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1556/ --- |
In reply to this post by qiuchenjian-2
Github user ManoharVanam commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153723071 --- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala --- @@ -239,3 +258,21 @@ class CarbonSqlAstBuilder(conf: SQLConf, parser: CarbonSpark2SqlParser) extends } } } + +/** + * returns session state object based on passed class name + */ +object SessionStateFactory { + def getSessionState(sparkSession: SparkSession, className: String): HiveSessionState = { --- End diff -- ok --- |
In reply to this post by qiuchenjian-2
Github user ManoharVanam commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153725528 --- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala --- @@ -190,8 +202,15 @@ class CarbonOptimizer( extends SparkOptimizer(catalog, conf, experimentalMethods) { override def execute(plan: LogicalPlan): LogicalPlan = { - // In case scalar subquery add flag in relation to skip the decoder plan in optimizer rule, And - // optimize whole plan at once. + val transFormedPlan: LogicalPlan = CarbonOptimizerUtil.transformForScalarSubQuery(plan) + super.execute(transFormedPlan) + } +} +object CarbonOptimizerUtil +{ + def transformForScalarSubQuery(plan: LogicalPlan) : LogicalPlan = { --- End diff -- I want to use it in internal session state as well for acl, so I refactored this code to avoid duplication . --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1563 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1956/ --- |
In reply to this post by qiuchenjian-2
Github user ManoharVanam commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153730143 --- Diff: integration/spark-common/src/main/scala/org/apache/spark/util/CarbonReflectionUtils.scala --- @@ -140,10 +140,15 @@ object CarbonReflectionUtils { def getSessionState(sparkContext: SparkContext, carbonSession: Object): Any = { if (sparkContext.version.startsWith("2.1")) { - createObject("org.apache.spark.sql.hive.CarbonSessionState", carbonSession)._1 + val className = sparkContext.conf + .get("spark.carbon.sessionstate.classname", "org.apache.spark.sql.hive.CarbonSessionState") --- End diff -- makespark.carbon.sessionstate.classname string in CarbonCommonConstant instead of hard coding it here. --- ok and change org.apache.spark.sql.hive.CarbonSessionState to CarbonSessionState.getClass.getName -- CarbonSessionState belongs to spark2 module so we cannot access from spark-common module --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1563/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153766620 --- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala --- @@ -190,8 +201,15 @@ class CarbonOptimizer( extends SparkOptimizer(catalog, conf, experimentalMethods) { override def execute(plan: LogicalPlan): LogicalPlan = { - // In case scalar subquery add flag in relation to skip the decoder plan in optimizer rule, And - // optimize whole plan at once. + val transFormedPlan: LogicalPlan = CarbonOptimizerUtil.transformForScalarSubQuery(plan) + super.execute(transFormedPlan) + } +} +object CarbonOptimizerUtil +{ --- End diff -- move to previous line --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153766653 --- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala --- @@ -190,8 +201,15 @@ class CarbonOptimizer( extends SparkOptimizer(catalog, conf, experimentalMethods) { override def execute(plan: LogicalPlan): LogicalPlan = { - // In case scalar subquery add flag in relation to skip the decoder plan in optimizer rule, And - // optimize whole plan at once. + val transFormedPlan: LogicalPlan = CarbonOptimizerUtil.transformForScalarSubQuery(plan) + super.execute(transFormedPlan) + } +} +object CarbonOptimizerUtil --- End diff -- add one blank line --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1563#discussion_r153766866 --- Diff: integration/spark-common/src/main/scala/org/apache/spark/util/CarbonReflectionUtils.scala --- @@ -140,12 +141,15 @@ object CarbonReflectionUtils { def getSessionState(sparkContext: SparkContext, carbonSession: Object): Any = { if (sparkContext.version.startsWith("2.1")) { - createObject("org.apache.spark.sql.hive.CarbonSessionState", carbonSession)._1 + val className = sparkContext.conf --- End diff -- change to ``` val className = sparkContext.conf.get( CarbonCommonConstants.CARBON_SESSIONSTATE_CLASSNAME, "org.apache.spark.sql.hive.CarbonSessionState") ``` same for line 149 --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1572/ --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/1563 retest this please --- |
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:
https://github.com/apache/carbondata/pull/1563 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1578/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1563 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1971/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1563 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1973/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1583/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1563 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1586/ --- |
In reply to this post by qiuchenjian-2
|
Free forum by Nabble | Edit this page |