Skip to content

Commit

Permalink
[KYUUBI #6263] Use HiveConf.getConfVars or Hive conf names directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhukar525722 committed Nov 26, 2024
1 parent 27e7254 commit 7d87234
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ trait KyuubiSparkSQLExtensionTest extends QueryTest
.set("spark.hadoop.hive.exec.dynamic.partition.mode", "nonstrict")
.set("spark.hadoop.hive.metastore.client.capability.check", "false")
.set(
ConfVars.METASTORECONNECTURLKEY.varname,
"javax.jdo.option.ConnectionURL",
s"jdbc:derby:;databaseName=$metastorePath;create=true")
.set(StaticSQLConf.WAREHOUSE_PATH, warehousePath)
.set("spark.ui.enabled", "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ trait KyuubiSparkSQLExtensionTest extends QueryTest
.set("spark.hadoop.hive.exec.dynamic.partition.mode", "nonstrict")
.set("spark.hadoop.hive.metastore.client.capability.check", "false")
.set(
ConfVars.METASTORECONNECTURLKEY.varname,
"javax.jdo.option.ConnectionURL",
s"jdbc:derby:;databaseName=$metastorePath;create=true")
.set(StaticSQLConf.WAREHOUSE_PATH, warehousePath)
.set("spark.ui.enabled", "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ trait KyuubiSparkSQLExtensionTest extends QueryTest
.set("spark.hadoop.hive.exec.dynamic.partition.mode", "nonstrict")
.set("spark.hadoop.hive.metastore.client.capability.check", "false")
.set(
ConfVars.METASTORECONNECTURLKEY.varname,
"javax.jdo.option.ConnectionURL",
s"jdbc:derby:;databaseName=$metastorePath;create=true")
.set(StaticSQLConf.WAREHOUSE_PATH, warehousePath)
.set("spark.ui.enabled", "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class HiveBatchWrite(

if (overwrite && table.tableType == CatalogTableType.EXTERNAL) {
val numWrittenParts = writtenParts.size
val maxDynamicPartitionsKey = HiveConf.ConfVars.DYNAMICPARTITIONMAXPARTS.varname
val maxDynamicPartitionsKey = "hive.exec.dynamic.partition.max.partitions"
val maxDynamicPartitions = hadoopConf.getInt(
maxDynamicPartitionsKey,
HiveConf.ConfVars.DYNAMICPARTITIONMAXPARTS.defaultIntVal)
HiveConf.getInt("hive.exec.dynamic.partition.max.partitions"))
if (numWrittenParts > maxDynamicPartitions) {
throw KyuubiHiveConnectorException(
s"Number of dynamic partitions created is $numWrittenParts, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.spark.sql

import org.apache.hadoop.hive.conf.HiveConf.ConfVars
import org.apache.spark.SparkConf
import org.apache.spark.sql.internal.StaticSQLConf
import org.apache.spark.util.Utils
Expand All @@ -35,7 +34,7 @@ trait SparkListenerExtensionTest {
.master("local")
.config("spark.ui.enabled", "false")
.config(
ConfVars.METASTORECONNECTURLKEY.varname,
"javax.jdo.option.ConnectionURL",
s"jdbc:derby:;databaseName=$metastorePath;create=true")
.config("spark.sql.catalogImplementation", catalogImpl)
.config(StaticSQLConf.WAREHOUSE_PATH.key, warehousePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.apache.kyuubi.engine.hive.operation

import java.util.List

import org.apache.hadoop.hive.conf.HiveConf.ConfVars
import org.apache.hadoop.hive.conf.HiveConf

import org.apache.kyuubi.config.KyuubiConf._
import org.apache.kyuubi.engine.hive.session.HiveSessionImpl
Expand Down Expand Up @@ -162,6 +162,7 @@ class HiveOperationManager() extends OperationManager("HiveOperationManager") {
override def getQueryId(operation: Operation): String = {
val hiveOperation = operation.asInstanceOf[HiveOperation]
val internalHiveOperation = hiveOperation.internalHiveOperation
internalHiveOperation.getParentSession.getHiveConf.getVar(ConfVars.HIVEQUERYID)
internalHiveOperation.getParentSession.getHiveConf.getVar(
HiveConf.getConfVars("hive.query.id"))
}
}

0 comments on commit 7d87234

Please sign in to comment.