Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion orc/src/main/java/org/apache/iceberg/orc/OrcIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ public CloseableIterator<T> iterator() {
// to push down filters to ORC's SearchArgument, since we are not reading anything from files at all
boolean isEmptyStruct = readOrcSchema.getChildren().size() == 0;

// If the projected ORC schema has union type, we can't reliably build a pushdown filter for the
// underlying ORC files, since the Iceberg schema has a different representation than the ORC schema.
boolean containsUnion = readOrcSchema.toString().contains("uniontype");

SearchArgument sarg = null;
if (filter != null && !isEmptyStruct) {
if (filter != null && !isEmptyStruct && !containsUnion) {
Expression boundFilter = Binder.bind(schema.asStruct(), filter, caseSensitive);
sarg = ExpressionToSearchArgument.convert(boundFilter, readOrcSchema);
}
Expand Down