xiangfu0 commented on code in PR #19473:
URL: https://github.com/apache/pinot/pull/19473#discussion_r3993284602


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/metadata/SegmentMetadataImpl.java:
##########
@@ -308,9 +308,14 @@ private static void setCustomConfigs(Configuration 
segmentMetadataPropertiesConf
   }
 
   /// Helper method to add the physical columns from source list to 
destination set.
+  ///
+  /// Column names are interned: the same names recur in every segment of a 
table and each one is retained by the
+  /// column metadata map key, the FieldSpec, the segment Schema and the 
loader's per-column maps, so one JVM-wide
+  /// instance replaces a copy per segment (the JVM string table holds them 
weakly, so they live exactly as long as a
+  /// loaded segment references them).
   private static void addPhysicalColumns(List<Object> src, Set<String> dest) {
     for (Object o : src) {
-      String column = o.toString();
+      String column = o.toString().intern();

Review Comment:
   Fixed in d03dd47dcd. `setTimeInfo()` now interns a non-null time-column 
name. The regression test failed before the fix on equal-but-distinct names and 
now verifies identity across directory loads, with the physical-column map key, 
and between directory/stream loads. Segments without a time column still return 
null.
   
   Also added the suggested custom STRING/JSON default identity test using 
distinct input strings in separate parses. All 42 focused metadata tests and 
Spotless, Checkstyle, and license checks pass.



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