Copilot commented on code in PR #19473:
URL: https://github.com/apache/pinot/pull/19473#discussion_r3993194697
##########
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:
The physical-column keys are interned here, but `setTimeInfo()` still
assigns `_timeColumn` directly from `getString(...)`. For every time-column
segment this leaves a second, non-canonical column-name `String` in
`SegmentMetadataImpl`, so the claimed sharing is incomplete; intern
`_timeColumn` in that path as well.
--
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]