You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2024/06/05 08:28:38 UTC
[PR] [SPARK-48537][SQL] Support Hive UDAF inherit from `GenericUDAFResolver` and `GenericUDAFResolver2` [spark]
panbingkun opened a new pull request, #46878:
URL: https://github.com/apache/spark/pull/46878
### What changes were proposed in this pull request?
The pr aims to support `Hive UDAF` inherit from `GenericUDAFResolver` and `GenericUDAFResolver2`.
### Why are the changes needed?
### Does this PR introduce _any_ user-facing change?
Yes,
### How was this patch tested?
- Add new UT
- Pass GA.
### Was this patch authored or co-authored using generative AI tooling?
No.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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
Re: [PR] [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2` [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46878:
URL: https://github.com/apache/spark/pull/46878#discussion_r1627568220
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala:
##########
@@ -178,23 +178,26 @@ object HiveUDFExpressionBuilder extends SparkUDFExpressionBuilder {
// expressions don't satisfy the hive UDF, such as type mismatch, input number
// mismatch, etc. Here we catch the exception and throw AnalysisException instead.
if (classOf[UDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveSimpleUDF(name, new HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveSimpleUDF(name, HiveFunctionWrapper(clazz.getName), input))
udfExpr.get.dataType // Force it to check input data types.
} else if (classOf[GenericUDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveGenericUDF(name, new HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveGenericUDF(name, HiveFunctionWrapper(clazz.getName), input))
udfExpr.get.dataType // Force it to check input data types.
- } else if (classOf[AbstractGenericUDAFResolver].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveUDAFFunction(name, new HiveFunctionWrapper(clazz.getName), input))
+ } else if (classOf[GenericUDAFResolver2].isAssignableFrom(clazz)) {
Review Comment:
Placing `GenericUDAFResolver2` in front is to prioritize matching 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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
Re: [PR] [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2` [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #46878: [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2`
URL: https://github.com/apache/spark/pull/46878
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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
Re: [PR] [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2` [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #46878:
URL: https://github.com/apache/spark/pull/46878#discussion_r1627556949
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala:
##########
@@ -178,23 +178,26 @@ object HiveUDFExpressionBuilder extends SparkUDFExpressionBuilder {
// expressions don't satisfy the hive UDF, such as type mismatch, input number
// mismatch, etc. Here we catch the exception and throw AnalysisException instead.
if (classOf[UDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveSimpleUDF(name, new HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveSimpleUDF(name, HiveFunctionWrapper(clazz.getName), input))
udfExpr.get.dataType // Force it to check input data types.
} else if (classOf[GenericUDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveGenericUDF(name, new HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveGenericUDF(name, HiveFunctionWrapper(clazz.getName), input))
udfExpr.get.dataType // Force it to check input data types.
- } else if (classOf[AbstractGenericUDAFResolver].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveUDAFFunction(name, new HiveFunctionWrapper(clazz.getName), input))
+ } else if (classOf[GenericUDAFResolver2].isAssignableFrom(clazz)) {
Review Comment:
Why do we still handle `GenericUDAFResolver2` separately in the code?
- Because `GenericUDAFResolver` has been marked as `deprecated`, When removing `GenericUDAFResolver` in subsequent hives, we can easily delete the logic of `GenericUDAFResolver` here
- In fact, according to inheritance logic, we only need to handle `GenericUDAFResolver` to cover all `Hive UDAFs` processing (Of course, this excludes Hive UDAF that directly inherits `UDAF`)
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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
Re: [PR] [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2` [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #46878:
URL: https://github.com/apache/spark/pull/46878#issuecomment-2350735544
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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
Re: [PR] [SPARK-48537][SQL] Support Hive UDAF inherited from `GenericUDAFResolver` or `GenericUDAFResolver2` [spark]
Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on PR #46878:
URL: https://github.com/apache/spark/pull/46878#issuecomment-2149576716
@wangyum @yaooqinn @cloud-fan @viirya
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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