jamisonbennett commented on a change in pull request #23398: [SPARK-26493][SQL]
Allow multiple spark.sql.extensions
URL: https://github.com/apache/spark/pull/23398#discussion_r246382355
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
##########
@@ -103,7 +104,13 @@ class SimpleFunctionRegistry extends FunctionRegistry {
name: FunctionIdentifier,
info: ExpressionInfo,
builder: FunctionBuilder): Unit = synchronized {
- functionBuilders.put(normalizeFuncName(name), (info, builder))
+ val normalizedName = normalizeFuncName(name)
+ val newFunction = (info, builder)
+ functionBuilders.put(normalizedName, newFunction) match {
+ case Some(previousFunction) if previousFunction != newFunction =>
+ logWarning(s"The function $normalizedName replaced a previously
registered function.")
+ case _ => Unit
Review comment:
I made a change here which I think was what you were recommending. I didn't
want to remove the `case _ =>` otherwise I think it may result in a
non-exhaustive match exception. If you wanted me to remove the entire match
statement, just let me know.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]