private static com.netflix.iceberg.expressions.Expression filter( Operation op, String name, int value, Function<Integer, Long> startTsMicros) { switch (op) { case LT: return predicate(Operation.LT, name, tsLiteral(startTsMicros.apply(value))); case LT_EQ: return predicate(Operation.LT, name, tsLiteral(startTsMicros.apply(value + 1))); case GT: return predicate(Operation.GT_EQ, name, tsLiteral(startTsMicros.apply(value + 1))); case GT_EQ: return predicate(Operation.GT_EQ, name, tsLiteral(startTsMicros.apply(value))); case EQ: return and( predicate(Operation.GT_EQ, name, tsLiteral(startTsMicros.apply(value))), predicate(Operation.LT, name, tsLiteral(startTsMicros.apply(value + 1))) ); case NOT_EQ: return or( predicate(Operation.GT_EQ, name, tsLiteral(startTsMicros.apply(value + 1))), predicate(Operation.LT, name, tsLiteral(startTsMicros.apply(value))) ); case IN: case NOT_IN: default: throw new IllegalArgumentException("Cannot convert operation to year filter: " + op); } }