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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentImpl.java:
##########
@@ -478,12 +490,12 @@ public DataSource getDataSource(String column, Schema 
schema) {
 
   @Override
   public Set<String> getColumnNames() {
-    return _segmentMetadata.getSchema().getColumnNames();
+    return _columnNames;

Review Comment:
   Added to the PR description (What section).



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/PhysicalColumnNames.java:
##########
@@ -0,0 +1,103 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.segment.local.indexsegment.immutable;
+
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.SortedMap;
+import org.apache.pinot.segment.spi.ColumnMetadata;
+
+
+/// Unmodifiable view of the physical columns of an immutable segment: the 
keys of its column metadata map whose field
+/// spec is not produced by a virtual column provider, in the map's (sorted) 
key order.
+///
+/// It is a view rather than a copy so a segment retains nothing per column 
for it: the segment schema this replaces
+/// held a `TreeMap` entry per column, and a cached `TreeSet` would hold the 
same. `contains` is one map lookup and
+/// iteration is a filtered pass over the map. The virtual column count is 
taken once at construction, which is sound

Review Comment:
   Addressed in 49a54b2cbc: the Javadoc now states the ordering it relies on 
(virtual columns registered and dropped columns removed before the segment is 
constructed; nothing writes the map afterwards).



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