Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Feb 14, 2023
1 parent 63edd34 commit dd6b702
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ abstract class SparkOperation(session: Session)
spark.sparkContext.setLocalProperty

protected def withLocalProperties[T](f: => T): T = {
val originalSession = SparkSession.getActiveSession
try {
SparkSession.setActiveSession(spark)
spark.sparkContext.setJobGroup(statementId, redactedStatement, forceCancel)
spark.sparkContext.setLocalProperty(KYUUBI_SESSION_USER_KEY, session.user)
spark.sparkContext.setLocalProperty(KYUUBI_STATEMENT_ID_KEY, statementId)
Expand All @@ -157,6 +159,10 @@ abstract class SparkOperation(session: Session)
if (isSessionUserSignEnabled) {
clearSessionUserSign()
}
originalSession match {
case Some(session) => SparkSession.setActiveSession(session)
case None => SparkSession.clearActiveSession()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import scala.collection.JavaConverters._

import org.apache.hive.service.rpc.thrift._
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.util.{DateFormatter, TimestampFormatter}
import org.apache.spark.sql.execution.HiveResult
import org.apache.spark.sql.execution.HiveResult.TimeFormatters
import org.apache.spark.sql.types._
Expand All @@ -34,9 +33,7 @@ import org.apache.kyuubi.util.RowSetUtils._
object RowSet {

def getTimeFormatters(timeZone: ZoneId): TimeFormatters = {
val dateFormatter = DateFormatter()
val timestampFormatter = TimestampFormatter.getFractionFormatter(timeZone)
TimeFormatters(dateFormatter, timestampFormatter)
HiveResult.getTimeFormatters
}

def toTRowSet(
Expand Down

0 comments on commit dd6b702

Please sign in to comment.