Skip to content

Commit

Permalink
Return TPCH table predicate when no applyFilter was called
Browse files Browse the repository at this point in the history
  • Loading branch information
sopel39 committed Sep 5, 2019
1 parent c9f3f06 commit 8ac4f72
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,22 @@ else if (partitioningEnabled && tableHandle.getTableName().equals(TpchTable.LINE
new SortingProperty<>(columns.get(columnNaming.getName(LineItemColumn.LINE_NUMBER)), SortOrder.ASC_NULLS_FIRST));
}

TupleDomain<ColumnHandle> constraint = tableHandle.getConstraint();
if (predicatePushdownEnabled && constraint.isAll()) {
if (tableHandle.getTableName().equals(TpchTable.ORDERS.getTableName())) {
constraint = toTupleDomain(ImmutableMap.of(toColumnHandle(OrderColumn.ORDER_STATUS), ORDER_STATUS_NULLABLE_VALUES));
}
else if (tableHandle.getTableName().equals(TpchTable.PART.getTableName())) {
constraint = toTupleDomain(ImmutableMap.of(
toColumnHandle(PartColumn.CONTAINER),
PART_CONTAINER_NULLABLE_VALUES,
toColumnHandle(PartColumn.TYPE),
PART_TYPE_NULLABLE_VALUES));
}
}

return new ConnectorTableProperties(
tableHandle.getConstraint(),
constraint,
tablePartitioning,
partitioningColumns,
Optional.empty(),
Expand Down

0 comments on commit 8ac4f72

Please sign in to comment.