@Override
  protected boolean shouldKeep(T record) {
    if (sourceNodes == null) {
      return true;
    }

    if (sourceNodes.isEmpty()) {
      return false;
    }

    primaryKey.primaryKey(asStructLike.apply(record));
    return sourceNodes.stream()
        .anyMatch(node -> (primaryKey.hashCode() & node.mask()) == node.index());
  }
Util to Filter data belong to specific {@link DataTreeNode}s.

@param <T> to indicate the record data type
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/NodeFilter.java