-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21101][SQL] Catch IllegalStateException when CREATE TEMPORARY FUNCTION #18527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #79152 has finished for PR 18527 at commit
|
|
Retest this please |
| throw new AnalysisException(s"No handler for Hive UDF '${clazz.getCanonicalName}'") | ||
| } | ||
| } catch { | ||
| case ise: IllegalStateException => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @wangyum .
Can we move this after line 112, case NonFatal(e) =>?
IMO, these 8 lines are mostly duplication logic of line 113~116. The only difference is error message.
I guess we can append the new error message more simply.
|
Test build #79160 has finished for PR 18527 at commit
|
|
Can you add a test? I think it's okay to add a source file for UDTF in |
|
IMO it'd be better to fix code so we could call both interfaces (deprecated and non-deprecated |
|
Test build #79173 has finished for PR 18527 at commit
|
|
Test build #79199 has finished for PR 18527 at commit
|
|
Retest this please |
|
Test build #79204 has finished for PR 18527 at commit
|
configure found in Hive UDFs
#18768
## What changes were proposed in this pull request? This pr added documents about unsupported functions in Hive UDF/UDTF/UDAF. This pr relates to apache#18768 and apache#18527. ## How was this patch tested? N/A Author: Takeshi Yamamuro <[email protected]> Closes apache#18792 from maropu/HOTFIX-20170731.
|
ping @wangyum This sounds a reasonable fix. Could you resolve the conflicts? |
# Conflicts: # sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala # sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
|
Test build #83007 has finished for PR 18527 at commit
|
|
Retest this please |
|
Test build #83009 has finished for PR 18527 at commit
|
| new AnalysisException(s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e" + | ||
| s"\nIf you create a UDTF, please make sure your function override " + | ||
| s"`public StructObjectInspector initialize(ObjectInspector[] args)`, " + | ||
| s"per: SPARK-21101") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val noHandlerMsg = s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e"
val errorMsg =
if (classOf[GenericUDTF].isAssignableFrom(clazz)) {
s"$noHandlerMsg\nPlease make sure your function overrides " +
"`public StructObjectInspector initialize(ObjectInspector[] args)`."
} else {
noHandlerMsg
}
val analysisException = new AnalysisException(errorMsg)|
Test build #83021 has finished for PR 18527 at commit
|
|
LGTM |
|
Thanks! Merged to master. |
What changes were proposed in this pull request?
It must
overridepublic StructObjectInspector initialize(ObjectInspector[] argOIs)when create a UDTF.If you
overridepublic StructObjectInspector initialize(StructObjectInspector argOIs),IllegalStateExceptionwill throw. per: HIVE-12377.This PR catch
IllegalStateExceptionand point user tooverridepublic StructObjectInspector initialize(ObjectInspector[] argOIs).How was this patch tested?
unit tests
Source code and binary jar: SPARK-21101.zip
These two source code copy from : https://github.com/apache/hive/blob/release-2.0.0/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFStack.java