zhuxiangyi commented on code in PR #8943:
URL: https://github.com/apache/paimon/pull/8943#discussion_r3691639032


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/data/SparkInternalRow.scala:
##########
@@ -33,6 +35,8 @@ abstract class SparkInternalRow extends InternalRow {
 
 object SparkInternalRow {
 
+  private val blobFieldsCache = new IdentityHashMap[RowType, Set[Int]]()

Review Comment:
   Thanks for pointing this out. I replaced the strong-reference 
IdentityHashMap with a Guava LoadingCache configured with weakKeys(). This 
preserves identity-based key comparison without invoking 
RowType.equals/hashCode, while allowing a RowType to be garbage collected once 
it is no longer strongly referenced elsewhere. The cached Set[Int] does not 
reference the RowType, so it will not keep the key alive. This also removes the 
explicit global synchronization.



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

Reply via email to