gengliangwang commented on code in PR #39682:
URL: https://github.com/apache/spark/pull/39682#discussion_r1083255631


##########
sql/core/src/main/scala/org/apache/spark/status/protobuf/sql/SQLPlanMetricSerializer.scala:
##########
@@ -19,18 +19,24 @@ package org.apache.spark.status.protobuf.sql
 
 import org.apache.spark.sql.execution.ui.SQLPlanMetric
 import org.apache.spark.status.protobuf.StoreTypes
+import org.apache.spark.status.protobuf.Utils._
+import org.apache.spark.util.Utils.weakIntern
 
 object SQLPlanMetricSerializer {
 
   def serialize(metric: SQLPlanMetric): StoreTypes.SQLPlanMetric = {
-    StoreTypes.SQLPlanMetric.newBuilder()
-      .setName(metric.name)
-      .setAccumulatorId(metric.accumulatorId)
-      .setMetricType(metric.metricType)
-      .build()
+    val builder = StoreTypes.SQLPlanMetric.newBuilder()
+    setStringField(metric.name, builder.setName)
+    builder.setAccumulatorId(metric.accumulatorId)
+    setStringField(metric.metricType, builder.setMetricType)
+    builder.build()
   }
 
   def deserialize(metrics: StoreTypes.SQLPlanMetric): SQLPlanMetric = {
-    SQLPlanMetric(metrics.getName, metrics.getAccumulatorId, 
metrics.getMetricType)
+    SQLPlanMetric(
+      name = getStringField(metrics.hasName, () => 
weakIntern(metrics.getName)),

Review Comment:
   ok you are adding weakIntern here



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to