pavibhai commented on a change in pull request #668:
URL: https://github.com/apache/orc/pull/668#discussion_r610762564
##########
File path: java/core/src/java/org/apache/orc/impl/reader/tree/TypeReader.java
##########
@@ -24,22 +25,51 @@
import org.apache.orc.impl.reader.StripePlanner;
import java.io.IOException;
+import java.util.EnumSet;
public interface TypeReader {
void checkEncoding(OrcProto.ColumnEncoding encoding) throws IOException;
- void startStripe(StripePlanner planner) throws IOException;
+ void startStripe(StripePlanner planner, EnumSet<ReadLevel> readLevel) throws
IOException;
- void seek(PositionProvider[] index) throws IOException;
+ void seek(PositionProvider[] index, EnumSet<ReadLevel> readLevel) throws
IOException;
- void seek(PositionProvider index) throws IOException;
+ void seek(PositionProvider index, EnumSet<ReadLevel> readLevel) throws
IOException;
- void skipRows(long rows) throws IOException;
+ void skipRows(long rows, EnumSet<ReadLevel> readLevel) throws IOException;
void nextVector(ColumnVector previous,
boolean[] isNull,
int batchSize,
- FilterContext filterContext) throws IOException;
+ FilterContext filterContext,
+ EnumSet<ReadLevel> readLevel) throws IOException;
int getColumnId();
+
+ ReadLevel getReadLevel();
+
+ /**
+ * Determines if the child of the parent should be allowed based on the read
level. The child
+ * is allowed based on the read level or if the child is a LEAD_PARENT, this
allows the handling
+ * of FOLLOW children on the LEAD_PARENT
+ * @param reader the child reader that is being evaluated
+ * @param readLevel the requested read level
+ * @return true if allowed by read level or if it is a LEAD_PARENT otherwise
false
+ */
+ static boolean allowChild(TypeReader reader, EnumSet<ReadLevel> readLevel) {
+ return readLevel.contains(reader.getReadLevel())
+ || reader.getReadLevel() == ReadLevel.LEAD_PARENT;
+ }
+
+ enum ReadLevel {
+ LEAD_CHILD, // Read only the elementary filter columns
Review comment:
The LEAD_PARENT has significance that it should still propagate
activities on the child even if it does not satisfy the requested read level.
That is why I chose to differentiate between PARENT and CHILD.
--
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]