akashrn5 commented on a change in pull request #3548: [CARBONDATA-3600]Fix the
cleanup failure issue if user fails to access table
URL: https://github.com/apache/carbondata/pull/3548#discussion_r363078785
##########
File path:
integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala
##########
@@ -135,17 +135,25 @@ class CarbonEnv {
dataMapSchema =>
if (null != dataMapSchema.getRelationIdentifier &&
!dataMapSchema.isIndexDataMap) {
- if (!sparkSession.sessionState
- .catalog
-
.tableExists(TableIdentifier(dataMapSchema.getRelationIdentifier.getTableName,
- Some(dataMapSchema.getRelationIdentifier.getDatabaseName)))) {
+ val isTableExists = try {
+ sparkSession.sessionState
+ .catalog
+
.tableExists(TableIdentifier(dataMapSchema.getRelationIdentifier.getTableName,
+ Some(dataMapSchema.getRelationIdentifier.getDatabaseName)))
+ } catch {
+ // we need to take care of cleanup when the table does not exists,
if table exists and
+ // some other user tries to access the table, it might fail, that
time no need to handle
+ case ex: Exception =>
Review comment:
no, basically this will happen only when the table not exists in hive
metastore and schema is present in carbon store. So we just need to proceed
only when the tableexists is false, else for anything its fine.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services