Skip to content

Commit 7738f74

Browse files
committed
modified HiveUDFSuite to use only UDF
1 parent c52608d commit 7738f74

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class HiveUDFSuite extends QueryTest {
7373
test("hive struct udf") {
7474
sql(
7575
"""
76-
|CREATE EXTERNAL TABLE hiveUdfTestTable (
76+
|CREATE EXTERNAL TABLE hiveUDFTestTable (
7777
| pair STRUCT<id: INT, value: INT>
7878
|)
7979
|PARTITIONED BY (partition STRING)
@@ -82,15 +82,15 @@ class HiveUDFSuite extends QueryTest {
8282
""".
8383
stripMargin.format(classOf[PairSerDe].getName))
8484

85-
val location = Utils.getSparkClassLoader.getResource("data/files/testUdf").getFile
85+
val location = Utils.getSparkClassLoader.getResource("data/files/testUDF").getFile
8686
sql(s"""
87-
ALTER TABLE hiveUdfTestTable
88-
ADD IF NOT EXISTS PARTITION(partition='testUdf')
87+
ALTER TABLE hiveUDFTestTable
88+
ADD IF NOT EXISTS PARTITION(partition='testUDF')
8989
LOCATION '$location'""")
9090

91-
sql(s"CREATE TEMPORARY FUNCTION testUdf AS '${classOf[PairUdf].getName}'")
92-
sql("SELECT testUdf(pair) FROM hiveUdfTestTable")
93-
sql("DROP TEMPORARY FUNCTION IF EXISTS testUdf")
91+
sql(s"CREATE TEMPORARY FUNCTION testUDF AS '${classOf[PairUDF].getName}'")
92+
sql("SELECT testUDF(pair) FROM hiveUDFTestTable")
93+
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDF")
9494
}
9595

9696
test("SPARK-6409 UDAFAverage test") {
@@ -169,11 +169,11 @@ class HiveUDFSuite extends QueryTest {
169169
StringCaseClass("world") :: StringCaseClass("goodbye") :: Nil).toDF()
170170
testData.registerTempTable("stringTable")
171171

172-
sql(s"CREATE TEMPORARY FUNCTION testStringStringUdf AS '${classOf[UDFStringString].getName}'")
172+
sql(s"CREATE TEMPORARY FUNCTION testStringStringUDF AS '${classOf[UDFStringString].getName}'")
173173
checkAnswer(
174-
sql("SELECT testStringStringUdf(\"hello\", s) FROM stringTable"),
174+
sql("SELECT testStringStringUDF(\"hello\", s) FROM stringTable"),
175175
Seq(Row("hello world"), Row("hello goodbye")))
176-
sql("DROP TEMPORARY FUNCTION IF EXISTS testStringStringUdf")
176+
sql("DROP TEMPORARY FUNCTION IF EXISTS testStringStringUDF")
177177

178178
TestHive.reset()
179179
}
@@ -244,7 +244,7 @@ class PairSerDe extends AbstractSerDe {
244244
}
245245
}
246246

247-
class PairUdf extends GenericUDF {
247+
class PairUDF extends GenericUDF {
248248
override def initialize(p1: Array[ObjectInspector]): ObjectInspector =
249249
ObjectInspectorFactory.getStandardStructObjectInspector(
250250
Seq("id", "value"),

0 commit comments

Comments
 (0)