This is an automated email from the ASF dual-hosted git repository.
jackylk 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 21ee342 [CARBONDATA-3774]Fix hiding the actual exceptions during
tableExists check
21ee342 is described below
commit 21ee342f358c7e464b2e529fd813b937afefc5e4
Author: akashrn5 <[email protected]>
AuthorDate: Thu Apr 16 19:50:03 2020 +0530
[CARBONDATA-3774]Fix hiding the actual exceptions during tableExists check
Why is this PR needed?
In table exists API, we catch all exceptions and say table does not exists
which is wrong
What changes were proposed in this PR?
Catch only NoSuchTableException fro spark and return false, for other
exceptions, throw it to caller
Does this PR introduce any user interface change?
No
Is any new testcase added?
No(existing test will take care)
This closes #3716
---
.../main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
index a8ab053..5156798 100644
---
a/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
+++
b/integration/spark/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
@@ -251,8 +251,10 @@ class CarbonFileMetastore extends CarbonMetaStore {
try {
lookupRelation(tableIdentifier)(sparkSession)
} catch {
- case _: Exception =>
+ case _: NoSuchTableException =>
return false
+ case ex: Exception =>
+ throw ex
}
true
}