-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-8883][SQL]Remove the OverrideFunctionRegistry #7260
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ private[hive] class HiveFunctionRegistry(underlying: analysis.FunctionRegistry) | |
| } | ||
|
|
||
| override def registerFunction(name: String, builder: FunctionBuilder): Unit = | ||
| throw new UnsupportedOperationException | ||
| underlying.registerFunction(name, builder) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a unit test in hive to make sure function registration works.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The unit test does exist in the master branch. |
||
| } | ||
|
|
||
| private[hive] case class HiveSimpleUDF(funcWrapper: HiveFunctionWrapper, children: Seq[Expression]) | ||
|
|
||
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.
wouldn't this throw UnsupportedOperationException when we register a UDF?
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.
No, it will not throws exception.
HiveFunctionRegistryseems now is like a delegation, the function registry actually will apply toFunctionRegistry.builtindirectly. And I think that's the original purpose of the master code. SeeUDFSuite.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.
Maybe I'm missing something, but doesn't HiveFunctionRegistry just throw an exception?
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.
Yes, that's the tricky thing, as this code path is hidden(never be called) as we had the wrapper of
OverrideFunctionRegistry, see code in HiveContext:Since the
OverrideFunctionRegistryis removed, we should update this part too.UPDATE: I mean we should update the code of
HiveFunctionRegistry.registerFunction.