Skip to content

Commit

Permalink
Remove TODO comment about predicates on struct type in Iceberg
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Dec 20, 2022
1 parent 070d20f commit 71d4656
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private static Expression toIcebergExpression(String columnName, Type type, Doma
return domain.isNullAllowed() ? alwaysTrue() : not(isNull(columnName));
}

// Skip structural types. TODO (https://github.com/trinodb/trino/issues/8759) Evaluate Apache Iceberg's support for predicate on structural types
if (type instanceof ArrayType || type instanceof MapType || type instanceof RowType) {
// Fail fast. Ignoring expression could lead to data loss in case of deletions.
throw new UnsupportedOperationException("Unsupported type for expression: " + type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(C
Map<IcebergColumnHandle, Domain> newUnenforced = new LinkedHashMap<>();
Map<IcebergColumnHandle, Domain> domains = predicate.getDomains().orElseThrow(() -> new VerifyException("No domains"));
domains.forEach((columnHandle, domain) -> {
// TODO (https://github.com/trinodb/trino/issues/8759) structural types cannot be used to filter a table scan in Iceberg library.
// structural types cannot be used to filter a table scan in Iceberg library.
if (isStructuralType(columnHandle.getType()) ||
// Iceberg orders UUID values differently than Trino (perhaps due to https://bugs.openjdk.org/browse/JDK-7025832), so allow only IS NULL / IS NOT NULL checks
(columnHandle.getType() == UUID && !(domain.isOnlyNull() || domain.getValues().isAll()))) {
Expand Down

0 comments on commit 71d4656

Please sign in to comment.