zhuxiangyi commented on code in PR #8943:
URL: https://github.com/apache/paimon/pull/8943#discussion_r3691646081
##########
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`
/ `RowType.hashCode`, while allowing a `RowType` to be garbage collected once
it is no longer strongly referenced elsewhere.
The cached value is only `Set[Int]`, so it does not reference the `RowType`
back and will not keep the weak key alive. This also removes the explicit
global synchronization on cache access.
--
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]