guiyanakuang commented on issue #1053:
URL: https://github.com/apache/orc/issues/1053#issuecomment-1058098766


   I reviewed SchemaEvolution.java and determined that it was a bug. 
   I think maybe we can initialize a map to store `fileTypeId` to `readTypeId` 
via `readerFileTypes`.
   
   ```java
   Map<Integer, Integer> typeIdsMap = new HashMap<>();
   
   for (int i = 0; i < this.readerFileTypes.length; i++) {
     this.typeIdsMap.put(readerFileTypes[i].getId(), i);
   }
   
   public boolean isPPDSafeConversion(final int colId) {
     if (hasConversion()) {
       Integer readTypeId = typeIdsMap.get(colId);
       return readTypeId != null &&
           ppdSafeConversion[readTypeId];
     }
   
     // when there is no schema evolution PPD is safe
     return true;
   }
   ```
   Welcome @PengleiShi for making this pr.  🍻


-- 
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: dev-unsubscr...@orc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to