tedyu commented on code in PR #44976:
URL: https://github.com/apache/spark/pull/44976#discussion_r1637390982


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -1032,7 +1026,11 @@ class SimpleTableFunctionRegistry extends 
SimpleFunctionRegistryBase[LogicalPlan
 
   override def clone(): SimpleTableFunctionRegistry = synchronized {

Review Comment:
   We can introduce `ReentrantReadWriteLock` guarding the `ConcurrentHashMap`.
   `clone` and `clear` would take the write lock on the `ConcurrentHashMap`.
   The other methods take read lock on the map.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -1032,7 +1026,11 @@ class SimpleTableFunctionRegistry extends 
SimpleFunctionRegistryBase[LogicalPlan
 
   override def clone(): SimpleTableFunctionRegistry = synchronized {

Review Comment:
   We can introduce a `ReentrantReadWriteLock` guarding the `ConcurrentHashMap`.
   `clone` and `clear` would take the write lock on the `ConcurrentHashMap`.
   The other methods take read lock on the map.



-- 
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]

Reply via email to