LuciferYang commented on code in PR #40747:
URL: https://github.com/apache/spark/pull/40747#discussion_r1166346957
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -49,8 +49,10 @@ trait FunctionRegistryBase[T] {
final def registerFunction(
name: FunctionIdentifier, builder: FunctionBuilder, source: String):
Unit = {
+ var builderClassName = builder.getClass.getCanonicalName
Review Comment:
Java 11+ has `Objects.requireNonNullElse(obj, defaultObj)`.
For Java 8, maybe we can use `MoreObjects.firstNonNull`, then
`builderClassName` can be a `val` and it will check `builder.getClass.getName`
not null (MoreObjects from Guava )
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -49,8 +49,10 @@ trait FunctionRegistryBase[T] {
final def registerFunction(
name: FunctionIdentifier, builder: FunctionBuilder, source: String):
Unit = {
+ var builderClassName = builder.getClass.getCanonicalName
Review Comment:
Java 11+ has `Objects.requireNonNullElse(obj, defaultObj)`.
For Java 8, maybe we can use `MoreObjects.firstNonNull`, then
`builderClassName` can be a `val` and it will check `builder.getClass.getName`
not null too(MoreObjects from Guava )
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]