Skip to content

Commit

Permalink
Merge c4b252e into 9ae91cc
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrn5 committed Sep 29, 2018
2 parents 9ae91cc + c4b252e commit 786fc65
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Expand Up @@ -18,6 +18,7 @@ package org.apache.spark.sql.hive

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.Path
import org.apache.hadoop.hive.ql.metadata.HiveException
import org.apache.spark.sql.carbondata.execution.datasources.CarbonSparkDataSourceUtil
import org.apache.spark.sql.catalyst.TableIdentifier
import org.apache.spark.sql.catalyst.analysis.{Analyzer, FunctionRegistry}
Expand Down Expand Up @@ -157,7 +158,13 @@ class InMemorySessionCatalog(
}

override def lookupRelation(name: TableIdentifier): LogicalPlan = {
val rtnRelation = super.lookupRelation(name)
val rtnRelation: LogicalPlan =
try {
super.lookupRelation(name)
} catch {
case ex: Exception =>
throw ex
}
val isRelationRefreshed =
CarbonSessionUtil.refreshRelation(rtnRelation, name)(sparkSession)
if (isRelationRefreshed) {
Expand Down
Expand Up @@ -85,7 +85,13 @@ class CarbonHiveSessionCatalog(
CarbonEnv.initListeners()

override def lookupRelation(name: TableIdentifier): LogicalPlan = {
val rtnRelation = super.lookupRelation(name)
val rtnRelation =
try {
super.lookupRelation(name)
} catch {
case ex: Exception =>
throw ex
}
val isRelationRefreshed =
CarbonSessionUtil.refreshRelation(rtnRelation, name)(sparkSession)
if (isRelationRefreshed) {
Expand Down
Expand Up @@ -23,6 +23,7 @@ import java.net.URI
import scala.collection.mutable.ArrayBuffer

import org.apache.hadoop.fs.permission.{FsAction, FsPermission}
import org.apache.hadoop.hive.ql.metadata.HiveException
import org.apache.spark.sql.{CarbonDatasourceHadoopRelation, CarbonEnv, SparkSession}
import org.apache.spark.sql.CarbonExpressions.{CarbonSubqueryAlias => SubqueryAlias}
import org.apache.spark.sql.catalyst.TableIdentifier
Expand Down Expand Up @@ -208,7 +209,10 @@ class CarbonFileMetastore extends CarbonMetaStore {
try {
lookupRelation(tableIdentifier)(sparkSession)
} catch {
case _: Exception =>
case ex: Exception =>
if (ex.getCause.isInstanceOf[HiveException]) {
throw ex
}
return false
}
true
Expand Down
Expand Up @@ -141,7 +141,13 @@ class CarbonHiveSessionCatalog(
*/
override def lookupRelation(name: TableIdentifier,
alias: Option[String]): LogicalPlan = {
val rtnRelation = super.lookupRelation(name, alias)
val rtnRelation =
try {
super.lookupRelation(name, alias)
} catch {
case ex: Exception =>
throw ex
}
var toRefreshRelation = false
rtnRelation match {
case SubqueryAlias(_,
Expand Down

0 comments on commit 786fc65

Please sign in to comment.