marchpure commented on a change in pull request #4186:
URL: https://github.com/apache/carbondata/pull/4186#discussion_r679713777
##########
File path:
integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/DDLHelper.scala
##########
@@ -52,15 +54,16 @@ object DDLHelper {
ThreadLocalSessionInfo
.setConfigurationToCurrentThread(sparkSession.sessionState.newHadoopConf())
if (!EnvHelper.isLegacy(sparkSession)) {
- val databaseName = createDatabaseCommand.databaseName
- val dbLocation = try {
- CarbonEnv.getDatabaseLocation(databaseName, sparkSession)
- } catch {
- case _: NoSuchDatabaseException =>
- CarbonProperties.getStorePath
+ val carbonStorePath = CarbonProperties.getStorePath()
+ val sparkWarehouse = sparkSession.conf.get("spark.sql.warehouse.dir")
+ if (StringUtils.isNotEmpty(carbonStorePath) &&
StringUtils.isNotEmpty(sparkWarehouse)
Review comment:
I have modified code according to your suggestion
##########
File path: docs/ddl-of-carbondata.md
##########
@@ -638,7 +638,12 @@ CarbonData DDL statements are documented here,which
includes:
## CREATE DATABASE
- This function creates a new database. By default the database is created in
Carbon store location, but you can also specify custom location.
+ This function creates a new database. By default the database is created in
location 'spark.sql.warehouse.dir', but you can also specify custom location by
configure 'spark.sql.warehouse.dir', the configuration 'carbon.storelocation'
has been deprecated.
Review comment:
I have modified code according to your suggestion
##########
File path: docs/ddl-of-carbondata.md
##########
@@ -638,7 +638,12 @@ CarbonData DDL statements are documented here,which
includes:
## CREATE DATABASE
- This function creates a new database. By default the database is created in
Carbon store location, but you can also specify custom location.
+ This function creates a new database. By default the database is created in
location 'spark.sql.warehouse.dir', but you can also specify custom location by
configure 'spark.sql.warehouse.dir', the configuration 'carbon.storelocation'
has been deprecated.
+
+ **Note:**
+ For simplicity, we recommended you remove the configuration of
carbon.storelocation. If carbon.storelocaiton and spark.sql.warehouse.dir are
configured to be different path, exception will be thrown when CREATE DATABASE
and DROP DATABASE to avoid inconsistent database location.
Review comment:
I have modified code according to your suggestion
##########
File path: docs/ddl-of-carbondata.md
##########
@@ -638,7 +638,12 @@ CarbonData DDL statements are documented here,which
includes:
## CREATE DATABASE
- This function creates a new database. By default the database is created in
Carbon store location, but you can also specify custom location.
+ This function creates a new database. By default the database is created in
location 'spark.sql.warehouse.dir', but you can also specify custom location by
configure 'spark.sql.warehouse.dir', the configuration 'carbon.storelocation'
has been deprecated.
Review comment:
I have modified docs according to your suggestion
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]