PengleiShi commented on a change in pull request #1055:
URL: https://github.com/apache/orc/pull/1055#discussion_r820416126



##########
File path: java/core/src/java/org/apache/orc/impl/SchemaEvolution.java
##########
@@ -296,13 +303,13 @@ private boolean typesAreImplicitConversion(final 
TypeDescription fileType,
 
   /**
    * Check if column is safe for ppd evaluation
-   * @param colId reader column id
+   * @param colId file column id
    * @return true if the specified column is safe for ppd evaluation else false
    */
   public boolean isPPDSafeConversion(final int colId) {
     if (hasConversion()) {
-      return !(colId < 0 || colId >= ppdSafeConversion.length) &&
-          ppdSafeConversion[colId];
+      Integer readerTypeId = typeIdsMap.get(colId);
+      return readerTypeId != null && ppdSafeConversion[readerTypeId];

Review comment:
       > Since we only use `ppdSafeConversion[]` in this method, I think 
changing `ppdSafeConversion[]` to be indexed by file column ids is a simpler 
solution, i.e. modifying the assignment in `populatePpdSafeConversion` and 
`populatePpdSafeConversionForChildren` to use file ids.
   
   This looks better. Done




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