diff --git a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala index 128f68bb7..cf753fc93 100644 --- a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala +++ b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/ds/TPCDSSuite.scala @@ -26,7 +26,7 @@ import org.apache.spark.sql.test.SharedSparkSession class TPCDSSuite extends QueryTest with SharedSparkSession { private val MAX_DIRECT_MEMORY = "6g" - private val TPCDS_QUERIES_RESOURCE = "tpcds-queries" + private val TPCDS_QUERIES_RESOURCE = "tpcds" private val TPCDS_WRITE_PATH = "/tmp/tpcds-generated" private var runner: TPCRunner = _ @@ -136,6 +136,15 @@ class TPCDSSuite extends QueryTest with SharedSparkSession { df.explain() df.show() } + + test("simple UDF") { + spark.udf.register("strLenScala", + (s: String) => Option(s).map(_.length).orElse(Option(0)).get) + val df = spark.sql("SELECT i_item_sk, i_item_desc, strLenScala(i_item_desc) FROM " + + "item LIMIT 100") + df.explain() + df.show() + } } object TPCDSSuite { diff --git a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/h/TPCHSuite.scala b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/h/TPCHSuite.scala index a8fc06e86..82ac63e46 100644 --- a/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/h/TPCHSuite.scala +++ b/native-sql-engine/core/src/test/scala/com/intel/oap/tpc/h/TPCHSuite.scala @@ -41,7 +41,7 @@ import scala.collection.mutable.ArrayBuffer class TPCHSuite extends QueryTest with SharedSparkSession { private val MAX_DIRECT_MEMORY = "6g" - private val TPCH_QUERIES_RESOURCE = "tpch-queries" + private val TPCH_QUERIES_RESOURCE = "tpch" private val TPCH_WRITE_PATH = "/tmp/tpch-generated" private var runner: TPCRunner = _