var udfNotInited = true
override def newExecuteStatementOperation(
parentSession: HiveSession,
statement: String,
confOverlay: JMap[String, String],
async: Boolean): ExecuteStatementOperation = synchronized {
val sqlContext = sessionToContexts.get(parentSession.getSessionHandle)
require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} has not been" +
s" initialized or had already closed.")
if(udfNotInited) {
val configFilePath = sqlContext.sparkContext.conf.getOption("spark.app.confpath")
.getOrElse("/sparklib/conf/udf.config")
println(s"openSession configFilePath: $configFilePath ")
UdfLoadUtils.udfRegister(configFilePath, sqlContext.sparkSession)
udfNotInited = false
}
val conf = sqlContext.sessionState.conf
val runInBackground = async && conf.getConf(HiveUtils.HIVE_THRIFT_SERVER_ASYNC)
val operation = new SparkExecuteStatementOperation(parentSession, statement, confOverlay,
runInBackground)(sqlContext, sessionToActivePool)
handleToOperation.put(operation.getHandle, operation)
logDebug(s"Created Operation for $statement with session=$parentSession, " +
s"runInBackground=$runInBackground")
operation
}
org.apache.spark.sql.hive.thriftserver.SparkSQLSessionManager#openSession
override def openSession(
protocol: TProtocolVersion,
username: String,
passwd: String,
ipAddress: String,
sessionConf: java.util.Map[String, String],
withImpersonation: Boolean,
delegationToken: String): SessionHandle = {
val sessionHandle =
super.openSession(protocol, username, passwd, ipAddress, sessionConf, withImpersonation,
delegationToken)
val session = super.getSession(sessionHandle)
HiveThriftServer2.listener.onSessionCreated(
session.getIpAddress, sessionHandle.getSessionId.toString, session.getUsername)
// println(s" open session : single ${sqlContext.conf.hiveThriftServerSingleSession} ")
val ctx = sqlContext
// val ctx = if (sqlContext.conf.hiveThriftServerSingleSession) {
// sqlContext
// } else {
// sqlContext.newSession()
// }
// if (!sqlContext.conf.hiveThriftServerSingleSession) {
// val configFilePath = ctx.sparkContext.conf.getOption("spark.app.confpath")
// .getOrElse("/sparklib/conf/udf.config")
// println(s"openSession configFilePath: $configFilePath ")
// UdfLoadUtils.udfRegister(configFilePath, ctx.sparkSession)
// }
ctx.setConf("spark.sql.hive.version", HiveUtils.hiveExecutionVersion)
if (sessionConf != null && sessionConf.containsKey("use:database")) {
ctx.sql(s"use ${sessionConf.get("use:database")}")
}
sparkSqlOperationManager.sessionToContexts.put(sessionHandle, ctx)
sessionHandle
}
分享到:
相关推荐
安装$ npm i single-session-middleware -DNode.js import express from 'express'import singleSession from 'single-session-middleware'import proxy from 'http-proxy-middleware'const app = express ( )app ....
wcf 通信模型 percall persession single 经过整理的WCF通信模型范例,强烈推荐
CEC 2005 Special Session/Competition on Evolutionary Real Parameter single objective optimization
将所有具有当前userId存在条目发布到SingleSession.MySessions (Mongo 集合)。 提供响应函数SingleSession.isSingleSession()如果当前用户有多个不同loginToken的会话,它返回false 。 (例如,不同的浏览器或...
初学者可以学习一下,jsp写的购物车,没用到什么高深技术 我是用Eclipse+MyEclipse的,如果是用NetBeans的朋友新建一个项目,再把源文件和JavaBean复制过去相应位置
broadband single-polarization single-mode photonic crystal fibers
单周期CPU,single_cycle_cpu,南京大学计算机系计算机组成原理实验-Single-cycle CPU, single_cycle_cpu, Nanjing University Computer Science Department of Computer Composition Principle Experiment
The Single UNIX Specification Version 3 - incorporating IEEE Std 1003.1 and ISO/IEC 9945 and integrating the industry's Open Systems standards. Press Release Overview Paper ISO/IEC 9945:2003 ...
包含KMeans、DBSCAN、LDA和Single_Pass的文本聚类算法程序(python实现)。 详细信息: 基于KMeans的无监督中文文本聚类 基于DBSCAN的无监督中文文本聚类 基于LDA的无监督文本聚类 基于single pass 策略进行聚类,不...
详解内存数据总线与single rank dual-rank之间的关系
single session per user 选中 RDP port: 3393 Securiy Mode 选 Network level Aurthentication(Best) Session Shadowing Mode 选 Full access with user's permission 最后 选 OK 注意 1、修改过termsrv.dll的...
Single page web applications are your next step: pushing UI rendering and business logic to the browser and communicating with the server only to synchronize data, they provide a smooth user ...
个人学习实现源码 注释比较全面 基于single-spa实现的的 前端微服务架构 内部含有 single-spa不足技术点的解决方案 相关的具体实现教程 我的博客里面有详细记载 欢迎大家一起学习
R2Single
The specification is focused on single root topologies; e.g., a single computer that supports virtualization technology. Date of Release Wednesday, January 20, 2010 Technology PCI Express ...
single-spa-no-single-spa-layout.zip
Single Image Layer Separation using Relative Smoothness
Serverless Single Page Apps Serverless Single Page Apps
This app will turn the single application mode ON. For Mac OS X system only. There's another application call SingleApp_off.app, will be uploaded later.
SSD:Single Shot MultiBox Detector 英文原文和中文翻译版,希望对大家有帮助