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

 ##########
 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:
   In that case, this logic is best handled like:
   ```
   if (fieldSpec != null) {
     if (fieldSpec.isVirtualColumn()) {
       // process virtual column from schema
     } else {
       // process real column from schema
     }
   } else {
     // process newly added column using the new provider factory
   }
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to