This is an automated email from the ASF dual-hosted git repository. ajantha pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push: new 080ac6f [CARBONDATA-3803] Mark CarbonSession as deprecated since 2.0 080ac6f is described below commit 080ac6ff56cabdcc726be9e573f628770c9cf727 Author: QiangCai <qiang...@qq.com> AuthorDate: Thu May 7 10:02:06 2020 +0800 [CARBONDATA-3803] Mark CarbonSession as deprecated since 2.0 Why is this PR needed? Better to use CarbonExtensions instead of CarbonSession in version 2.0. What changes were proposed in this PR? mark CarbonSession as deprecated since version 2.0. Does this PR introduce any user interface change? No Is any new testcase added? No, no need This closes #3751 --- docs/quick-start-guide.md | 2 +- .../src/main/scala/org/apache/spark/sql/CarbonExtensions.scala | 4 ++++ .../spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/quick-start-guide.md b/docs/quick-start-guide.md index e08b7b7..be8eb2a 100644 --- a/docs/quick-start-guide.md +++ b/docs/quick-start-guide.md @@ -125,7 +125,7 @@ Apache Spark Shell provides a simple way to learn the API, as well as a powerful #### Basics -###### Option 1: Using CarbonSession +###### Option 1: Using CarbonSession (deprecated since 2.0) Start Spark shell by running the following command in the Spark directory: ``` diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonExtensions.scala b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonExtensions.scala index 54770e2..942935e 100644 --- a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonExtensions.scala +++ b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonExtensions.scala @@ -24,6 +24,10 @@ import org.apache.spark.sql.execution.strategy.{CarbonLateDecodeStrategy, DDLStr import org.apache.spark.sql.hive.{CarbonIUDAnalysisRule, CarbonPreInsertionCasts} import org.apache.spark.sql.parser.CarbonExtensionSqlParser +/** + * use SparkSessionExtensions to inject Carbon's extensions. + * @since 2.0 + */ class CarbonExtensions extends (SparkSessionExtensions => Unit) { override def apply(extensions: SparkSessionExtensions): Unit = { diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala index 8afe180..de954e6 100644 --- a/integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala +++ b/integration/spark/src/main/scala/org/apache/spark/sql/CarbonSession.scala @@ -40,12 +40,18 @@ import org.apache.carbondata.streaming.CarbonStreamingQueryListener * Session implementation for {org.apache.spark.sql.SparkSession} * Implemented this class only to use our own SQL DDL commands. * User needs to use {CarbonSession.getOrCreateCarbon} to create Carbon session. + * + * @deprecated Since 2.0, only use for backward compatibility, + * please switch to use {@link CarbonExtensions}. */ +@Deprecated class CarbonSession(@transient val sc: SparkContext, @transient private val existingSharedState: Option[SharedState], @transient private val useHiveMetaStore: Boolean = true ) extends SparkSession(sc) { self => + logWarning("CarbonSession is deprecated since 2.0, please switch to CarbonExtensions") + def this(sc: SparkContext) { this(sc, None) }