Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6179#discussion_r30827028
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUdfSuite.scala 
---
    @@ -133,6 +134,41 @@ class HiveUdfSuite extends QueryTest {
         TestHive.reset()
       }
     
    +  test("UDFToListString") {
    +    val testData = TestHive.sparkContext.parallelize(StringCaseClass("") 
:: Nil).toDF()
    +    testData.registerTempTable("inputTable")
    +
    +    /**
    +     * Converts $"..." into UTF8String(...).
    +     * TODO: Catalyst (e.g., CatalystTypeConverters) cannot convert 
UTF8String
    +     * into String correctly because of JVM type erasure.
    +     */
    +    implicit class StringToUtf8(val sc: StringContext) {
    +      def u(args: Any*): UTF8String = UTF8String(sc.s(args :_*))
    +    }
    +
    +    sql(s"CREATE TEMPORARY FUNCTION testUDFToListString AS 
'${classOf[UDFToListString].getName}'")
    +    checkAnswer(
    +      sql("SELECT testUDFToListString(s) FROM inputTable"),
    +      Seq(Row(u"data1" :: u"data2" :: u"data3" :: Nil)))
    --- End diff --
    
    I am pretty concerned about internal types leaking out of the execution 
engine into user code here.  Are there real UDFs that we are trying to support 
here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to