Skip to content

Update SharkDriver.scala #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/main/scala/shark/SharkDriver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,24 @@ private[shark] class SharkDriver(conf: HiveConf) extends Driver(conf) with LogHe
// Init Hive Driver.
super.init()
}
//overide the close()
override def close(): Int = {

try {

super.close()

}catch{
case e: Exception => {

//logDebug(errorMessage, "\n" + StringUtils.stringifyException(e))

}
}finally {
//perfLogger.PerfLogEnd(LOG, PerfLogger.DO_AUTHORIZATION)
}
return 0
}

def tableRdd(cmd: String): Option[TableRDD] = {
useTableRddSink = true
Expand All @@ -165,6 +183,18 @@ private[shark] class SharkDriver(conf: HiveConf) extends Driver(conf) with LogHe
* Overload compile to use Shark's semantic analyzers.
*/
override def compile(cmd: String, resetTaskIds: Boolean): Int = {

//The select privilege is not work when we set metastore pression,
//so we may run the super method by hive first to check whether pass the validation.

val reCode= super.compile(cmd,resetTaskIds)

if ( reCode != 0 ) {
return reCode

}


val perfLogger: PerfLogger = PerfLogger.getPerfLogger()
perfLogger.PerfLogBegin(LOG, PerfLogger.COMPILE)

Expand Down