You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/14 10:41:25 UTC

[GitHub] [spark] ulysses-you opened a new pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

ulysses-you opened a new pull request #29749:
URL: https://github.com/apache/spark/pull/29749


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   This pr aims to support Hive UDF when input type is not expected. We make `HiveSimpleUDF` extends `ImplicitCastInputTypes` then using `Analyzer` to implicit cast input data type.
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Before this pr, we failed in this code.
   ```
   class ArraySumUDF extends UDF {
     import scala.collection.JavaConverters._
     def evaluate(values: java.util.List[java.lang.Double]): java.lang.Double = {
       var r = 0d
       for (v <- values.asScala) {
         r += v
       }
       r
     }
   }
   
   sql(s"CREATE FUNCTION testArraySum AS '${classOf[ArraySumUDF].getName}'")
   sql("SELECT testArraySum(array(1, 1.1, 1.2))")
   
   -- error msg
   Error in query: No handler for UDF/UDAF/UDTF 'ArraySumUDF': org.apache.hadoop.hive.ql.exec.NoMatchingMethodException: No matching method for class ArraySumUDF with (array<decimal(11,1)>). Possible choices: _FUNC_(array<double>)  ; line 1 pos 7
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   Yes, user can get correct result.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   add test.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun edited a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696860910


   Hi, @ulysses-you and @cloud-fan and @maropu ?
   Can we have this test case in our Apache Spark repository?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490212524



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)

Review comment:
       The `ScalaUDF` also implicit convert input type to expected type at `ImplicitTypeCasts`. 
   
   Let's say we have a udf `Array[Double] => Double = { data => data.sum }` and we run `spark.sql("select udf(array(1.0, 1.1, 1.2))")`. Then `ImplicitTypeCasts` will cast `array<decimal>` to `array<double>`.
   
   But Hive udf can't enjoy it, now we only use Hive `ObjectInspector` to convert data type at running time. It's the difference.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692409521


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/128674/
   Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696092667






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490900438



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       ```
   method.getGenericParameterTypes.map(javaTypeToDataType).map { dt =>
     if (dt.existsRecursively(_.isInstanceOf[NullType])) AnyDataType else dt
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696468640






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692512438


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/128696/
   Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490014340



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Ah, I see. Could you describe it in the PR description?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694908702


   **[Test build #128879 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128879/testReport)** for PR 29749 at commit [`e13f2b9`](https://github.com/apache/spark/commit/e13f2b94ff0c2897663dd81e596c775b728db862).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692469529






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you closed pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #29749:
URL: https://github.com/apache/spark/pull/29749


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696092667


   `ScalaUDF` has been checked in `ImplicitTypeCasts` just like extends `ImplicitCastInputTypes`. Here is some code from `ImplicitTypeCasts`.
   
   ```
         case e: ImplicitCastInputTypes if e.inputTypes.nonEmpty =>
           val children: Seq[Expression] = e.children.zip(e.inputTypes).map { case (in, expected) =>
             // If we cannot do the implicit cast, just use the original input.
             implicitCast(in, expected).getOrElse(in)
           }
           e.withNewChildren(children)
   
         case udf: ScalaUDF if udf.inputTypes.nonEmpty =>
           val children = udf.children.zip(udf.inputTypes).map { case (in, expected) =>
             // Currently Scala UDF will only expect `AnyDataType` at top level, so this trick works.
             // In the future we should create types like `AbstractArrayType`, so that Scala UDF can
             // accept inputs of array type of arbitrary element type.
             if (expected == AnyDataType) {
               in
             } else {
               implicitCast(
                 in,
                 udfInputToCastType(in.dataType, expected.asInstanceOf[DataType])
               ).getOrElse(in)
             }
   
           }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r488466031



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Why do we need special handling for decimal types?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r488513059



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       It's a compatible issue. In normal case, data type is converted by Hive ObjectInspector at running time. But Hive not support input decimal type when method required double type. Unfortunately the default type of `1.1` is different between Spark and Hive, which are decimal and double. Then caused this issue.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696860910


   Hi, @ulysses-you and @cloud-fan and @maropu ?
   Can we have the test case in our Apache Spark repository?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691991895






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692408690


   **[Test build #128674 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128674/testReport)** for PR 29749 at commit [`e73ccbf`](https://github.com/apache/spark/commit/e73ccbf3be4b29714c3da1cd0ddefe2b51095b59).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r487818296



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -57,8 +58,19 @@ private[hive] case class HiveSimpleUDF(
   lazy val function = funcWrapper.createFunction[UDF]()
 
   @transient
-  private lazy val method =
-    function.getResolver.getEvalMethod(children.map(_.dataType.toTypeInfo).asJava)
+  private lazy val method = {
+    // the simple UDF method must be 'evaluate'
+    val methods = function.getClass.getMethods.filter(_.getName == "evaluate")
+    val passedMethod = methods.filter(_.getGenericParameterTypes.length == children.length)
+
+    // no matching parameter num for evaluate method
+    if (passedMethod.isEmpty) {
+      throw new NoMatchingMethodException(function.getClass,
+        children.map(_.dataType.toTypeInfo).asJava, methods.toSeq.asJava)
+    }
+    // if there exists many method, we choose the first
+    methods.head

Review comment:
       Generally, UDF  just has one method of `evaluate`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-695942596


   My last concern is to check `ScalaUDF` and see if the type coercion  rules are the same with `HiveUDF`. `ScalaUDF` doesn't extend `ImplicitCastInputTypes`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-695942596


   My last concern is to check `ScalaUDF` and see if the type coercion  rules are the same with `HiveUDF`. `ScalaUDF` doesn't extend `ImplicitCastInputTypes`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490734875



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       what's the drawback if we do it for all other types?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696700912


   thanks @cloud-fan @maropu


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691991895


   Merged build finished. Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692373540






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-697230750


   @dongjoon-hyun I will open a new PR that only add test and some comment.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-693825397


   also cc @cloud-fan @dongjoon-hyun the similar issue with [#13930](https://github.com/apache/spark/pull/13930)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you closed pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #29749:
URL: https://github.com/apache/spark/pull/29749


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694969733






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490164914



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)

Review comment:
       I'm confused. The expected type should be defined by the function signature, but not the actual function inputs. What are we doing here?
   
   As an example, `ScalaUDF.inputTypes` is derived from the function signature (captured by encoders).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490809663



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       if a hive udf requires `Object`, I think it means `AnyDataType`. We should only special case it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r492905954



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala
##########
@@ -658,6 +658,24 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils {
     }
   }
 
+  test("SPARK-32877: Fix Hive UDF not support decimal type in complex type") {

Review comment:
       If this is not covered in any other test case, it looks worth of having this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490795280



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       In first commit I did it for all types but test not passed. The reason is a UDF required an Object type.
   
   We convert Java Object Type to NullType in `HiveInspectors.javaTypeToDataType` (seems this can be changed ?)
   ```
    // Hive seems to return this for struct types?
       case c: Class[_] if c == classOf[java.lang.Object] => NullType
   ```
   
   So we can't reflect the UDF method using a NullType, the error msg is:
   ```
   in query: cannot resolve 'example_format('%o', 93)' due to data type mismatch: argument 2 requires array<null> type, however, '93' is of int type.; line 1 pos 7;
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692373281


   **[Test build #128674 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128674/testReport)** for PR 29749 at commit [`e73ccbf`](https://github.com/apache/spark/commit/e73ccbf3be4b29714c3da1cd0ddefe2b51095b59).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692512430






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r491760290



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Seems we should check data type and replace `NullType` to `AnyDataType` on by one to avoid such case `Map<Double, Object> input`.
   
   I will do an another check if we can change `HiveInspectors.javaTypeToDataType` that using `AnyDataType` directly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r489999104



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -47,7 +47,8 @@ private[hive] case class HiveSimpleUDF(
   with HiveInspectors
   with CodegenFallback
   with Logging
-  with UserDefinedExpression {
+  with UserDefinedExpression
+  with ImplicitCastInputTypes {

Review comment:
       `ScalaUDF` doesn't extend `ImplicitCastInputTypes` either. Does it have the same problem?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692512430


   Merged build finished. Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692496696


   **[Test build #128696 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128696/testReport)** for PR 29749 at commit [`f9e3d57`](https://github.com/apache/spark/commit/f9e3d5799980d5144b39a54b61bb56731b560cd8).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696873402


   I'm wondering if this test fails with '-Phive1.2' still.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694909450






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490819668



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       How about this ? 
   ```
       val expectTypes = method.getGenericParameterTypes.map(javaTypeToDataType)
       if (expectTypes.exists(_.existsRecursively(_.isInstanceOf[NullType]))) {
         children.map(_.dataType)
       } else {
         expectTypes
       }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696582746


   Thanks for the investigation! You can probably open a new PR to add comments for `HiveSimpleUDF`, explaining why it can't extend `ImplicitTypeCasts`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691973230


   **[Test build #128642 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128642/testReport)** for PR 29749 at commit [`e692b9f`](https://github.com/apache/spark/commit/e692b9f03e589f1076f8c09d3a32fd67b1333e68).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490274074



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       The issue is for decimal to double, so I only check the decimal type and skip other type at here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490214201



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)

Review comment:
       Ah I misread the code. We get children data type only to skip decimal.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692409518






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun edited a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696860910


   Hi, @ulysses-you and @cloud-fan and @maropu ?
   Can we have this test case in our Apache Spark repository?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691973663






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r491760290



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Seems we should check data type and replace `NullType` to `AnyDataType` on by one to avoid such case `Map<Double, Object> input`.
   
   I will do an another check if we can change `HiveInspectors.javaTypeToDataType` that using `AnyDataType` directly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490900438



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       method.getGenericParameterTypes.map(javaTypeToDataType).map { dt =>
     if (dt.existsRecursively(_.isInstanceOf[NullType])) AnyDataType else dt
   }




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490215506



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Sorry I didn't get it. `ImplicitCastInputTypes` can implicit cast decimal to double, doesn't it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692496696


   **[Test build #128696 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128696/testReport)** for PR 29749 at commit [`f9e3d57`](https://github.com/apache/spark/commit/f9e3d5799980d5144b39a54b61bb56731b560cd8).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692469529






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696152414


   Seems there is somethings wrong, `HiveSimpleUDF.method` is called before `ImplicitCastInputTypes` that will throw exception before we cast input types.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r490132531



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -47,7 +47,8 @@ private[hive] case class HiveSimpleUDF(
   with HiveInspectors
   with CodegenFallback
   with Logging
-  with UserDefinedExpression {
+  with UserDefinedExpression
+  with ImplicitCastInputTypes {

Review comment:
       No, `ImplicitTypeCasts` has checked `ScalaUDF ` like `case udf: ScalaUDF if udf.inputTypes.nonEmpty =>`

##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -47,7 +47,8 @@ private[hive] case class HiveSimpleUDF(
   with HiveInspectors
   with CodegenFallback
   with Logging
-  with UserDefinedExpression {
+  with UserDefinedExpression
+  with ImplicitCastInputTypes {

Review comment:
       No, `ImplicitTypeCasts` has checked `ScalaUDF ` as `case udf: ScalaUDF if udf.inputTypes.nonEmpty =>`

##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
##########
@@ -69,6 +70,23 @@ private[hive] case class HiveSimpleUDF(
     udfType != null && udfType.deterministic() && !udfType.stateful()
   }
 
+  override def inputTypes: Seq[AbstractDataType] = {
+    val inTypes = children.map(_.dataType)
+    if (!inTypes.exists(_.existsRecursively(_.isInstanceOf[DecimalType]))) {

Review comment:
       Yeah.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692373540






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691991651


   **[Test build #128642 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128642/testReport)** for PR 29749 at commit [`e692b9f`](https://github.com/apache/spark/commit/e692b9f03e589f1076f8c09d3a32fd67b1333e68).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691973663






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696582746


   Thanks for the investigation! You can probably open a new PR to add comments for `HiveSimpleUDF`, explaining why it can't extend `ImplicitTypeCasts`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694908702


   **[Test build #128879 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128879/testReport)** for PR 29749 at commit [`e13f2b9`](https://github.com/apache/spark/commit/e13f2b94ff0c2897663dd81e596c775b728db862).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691991901


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/128642/
   Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692373281


   **[Test build #128674 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128674/testReport)** for PR 29749 at commit [`e73ccbf`](https://github.com/apache/spark/commit/e73ccbf3be4b29714c3da1cd0ddefe2b51095b59).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-691973230


   **[Test build #128642 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128642/testReport)** for PR 29749 at commit [`e692b9f`](https://github.com/apache/spark/commit/e692b9f03e589f1076f8c09d3a32fd67b1333e68).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694969733






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694909450






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] ulysses-you commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696468640


   After checked Hive code, it's a Hive version issue. In Hive 2.3.x this pr will not happen since the [HIVE-13380](https://issues.apache.org/jira/browse/HIVE-13380) merged. And what I said is based on Hive 1.2.x.
   
   An other thing is we cannot implicit cast input type because we need use children data type to reflect UDF method first and get exception if it fails. So we have no chance to go in `ImplicitTypeCasts`. We should skip `method` input data type check like my first commit [89a2966](https://github.com/apache/spark/pull/29749/commits/89a2966904957d736bc5edb74269cce96f910982).
   
   Sorry for the mistake, seems it's not need to fix the issue.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-696860910






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-694969073


   **[Test build #128879 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128879/testReport)** for PR 29749 at commit [`e13f2b9`](https://github.com/apache/spark/commit/e13f2b94ff0c2897663dd81e596c775b728db862).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692409518


   Merged build finished. Test FAILed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #29749:
URL: https://github.com/apache/spark/pull/29749#issuecomment-692512288


   **[Test build #128696 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/128696/testReport)** for PR 29749 at commit [`f9e3d57`](https://github.com/apache/spark/commit/f9e3d5799980d5144b39a54b61bb56731b560cd8).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #29749: [SPARK-32877][SQL] Fix Hive UDF not support decimal type in complex type

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #29749:
URL: https://github.com/apache/spark/pull/29749#discussion_r492905954



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala
##########
@@ -658,6 +658,24 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils {
     }
   }
 
+  test("SPARK-32877: Fix Hive UDF not support decimal type in complex type") {

Review comment:
       If this is not covered in any other test case, it looks worth of having this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org