haibow commented on a change in pull request #4954: Support schema evolution 
for consuming segments
URL: https://github.com/apache/incubator-pinot/pull/4954#discussion_r369991242
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
 ##########
 @@ -467,13 +483,22 @@ public SegmentMetadata getSegmentMetadata() {
     return physicalColumnNames;
   }
 
+  @Override
+  public Set<String> getColumnNamesForSelectStar() {
+    return Sets.union(getPhysicalColumnNames(), 
_newlyAddedColumnsFieldMap.keySet());
+  }
+
   @Override
   public ColumnDataSource getDataSource(String columnName) {
     FieldSpec fieldSpec = _schema.getFieldSpecFor(columnName);
-    if (fieldSpec.isVirtualColumn()) {
+    if ((fieldSpec == null && 
_newlyAddedColumnsFieldMap.containsKey(columnName)) || 
fieldSpec.isVirtualColumn()) {
 
 Review comment:
   I don't see a strong reason to create another column provider factory just 
for this. I have updated the MutableSegmentImpl to cache the provider, and only 
initialize the provider or update row count when needed. This optimization will 
help other virtual columns ($segmentName and $hostName) too. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to