Skip to content

Commit 815f60a

Browse files
committed
add toOptionsAndSerdeProps ut
1 parent 66b8fcd commit 815f60a

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

extensions/spark/kyuubi-spark-connector-hive/src/main/scala/org/apache/kyuubi/spark/connector/hive/HiveTableCatalog.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ class HiveTableCatalog(sparkSession: SparkSession)
440440
* - optionsProps: keys with "options." prefix whose stripped key ALREADY exist in properties,
441441
* indicating they were originally specified via OPTIONS clause.
442442
* - serdeProps: keys with "options." prefix whose stripped key does NOT exists in properties,
443-
* indicating they were originally specified via SERDEPROPERTIES clause
443+
* indicating they were originally specified via SERDEPROPERTIES clause.
444444
*
445445
* @param properties the full properties map
446446
* @return a tuple of (optionsProps, serdeProps), both with the "options." prefix stripped
447447
*/
448-
private def toOptionsAndSerdeProps(
448+
private[hive] def toOptionsAndSerdeProps(
449449
properties: Map[String, String]): (Map[String, String], Map[String, String]) = {
450450
val (optionsProps, serdeProps) = properties
451451
.filterKeys(_.startsWith(TableCatalog.OPTION_PREFIX))

extensions/spark/kyuubi-spark-connector-hive/src/test/scala/org/apache/kyuubi/spark/connector/hive/HiveCatalogSuite.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,7 @@ class HiveCatalogSuite extends KyuubiHiveTest {
298298
TableCatalog.OPTION_PREFIX + "field.delim" -> ",",
299299
TableCatalog.OPTION_PREFIX + "line.delim" -> "\n")
300300

301-
val method = classOf[HiveTableCatalog].getDeclaredMethod(
302-
"toOptionsAndSerdeProps",
303-
classOf[scala.collection.immutable.Map[_, _]])
304-
method.setAccessible(true)
305-
val (optionsProps, serdeProps) = method.invoke(catalog, properties)
306-
.asInstanceOf[(Map[String, String], Map[String, String])]
301+
val (optionsProps, serdeProps) = catalog.toOptionsAndSerdeProps(properties)
307302

308303
assert(optionsProps == Map(
309304
"header" -> "false",

0 commit comments

Comments
 (0)