Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dependencies {
api project(":transportable-udfs-test:transportable-udfs-test-spi")
implementation project(":transportable-udfs-api")

api 'org.testng:testng:6.11'
api 'org.junit.jupiter:junit-jupiter-api:5.10.2'
api 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
api 'org.junit.jupiter:junit-jupiter-params:5.10.2'
implementation 'com.google.guava:guava:24.1-jre'
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
import org.apache.hive.service.cli.RowSet;
import org.apache.hive.service.cli.SessionHandle;
import org.apache.hive.service.server.HiveServer2;
import org.testng.Assert;

import static org.junit.jupiter.api.Assertions.*;


public class HiveTester implements SqlStdTester {
Expand Down Expand Up @@ -129,10 +130,10 @@ public void assertFunctionCall(String functionCallString, Object expectedOutputD
Object[] row = rowSet.iterator().next();
Object result = row[0];

Assert.assertEquals(result, expectedOutputData, "UDF output does not match");
assertEquals(result, expectedOutputData, "UDF output does not match");
// Get the output data type and convert them to TypeInfo to compare
ColumnDescriptor outputColumnDescriptor = _client.getResultSetMetadata(handle).getColumnDescriptors().get(0);
Assert.assertEquals(TypeInfoUtils.getTypeInfoFromTypeString(outputColumnDescriptor.getTypeName().toLowerCase()),
assertEquals(TypeInfoUtils.getTypeInfoFromTypeString(outputColumnDescriptor.getTypeName().toLowerCase()),
TypeInfoUtils.getTypeInfoFromObjectInspector((ObjectInspector) expectedOutputType),
"UDF output type does not match");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.linkedin.transport.test.spi.{SqlFunctionCallGenerator, SqlStdTester,
import org.apache.spark.SparkException
import org.apache.spark.sql.types._
import org.apache.spark.sql.{SparkSession, StdUDFTestUtils}
import org.testng.Assert
import org.junit.jupiter.api.Assertions._

import scala.collection.JavaConversions._

Expand All @@ -41,8 +41,8 @@ class SparkTester extends SqlStdTester {
} catch {
case e: SparkException => throw e.getCause()
}
Assert.assertEquals(result.get(0), expectedOutputData)
Assert.assertEquals(getModifiedResultType(result.schema.head.dataType), expectedOutputType)
assertEquals(result.get(0), expectedOutputData)
assertEquals(getModifiedResultType(result.schema.head.dataType), expectedOutputType)
}

override def setup(topLevelStdUDFClassesAndImplementations: util.Map[Class[_ <: TopLevelStdUDF],
Expand Down