public static boolean selectsPartitions(Expression expr, Table table, boolean caseSensitive) {
    return table.specs().values().stream()
        .allMatch(spec -> selectsPartitions(expr, spec, caseSensitive));
  }
@Test
  public void testSelectsPartitions() {
    assertThat(
            ExpressionUtil.selectsPartitions(
                Expressions.lessThan("ts", "2021-03-09T10:00:00.000000"),
                PartitionSpec.builderFor(SCHEMA).hour("ts").build(),
                true))
        .as("Should select partitions, on boundary")
        .isTrue();

    assertThat(
            ExpressionUtil.selectsPartitions(
                Expressions.lessThanOrEqual("ts", "2021-03-09T10:00:00.000000"),
                PartitionSpec.builderFor(SCHEMA).hour("ts").build(),
                true))
        .as("Should not select partitions, 1 ms off boundary")
        .isFalse();

    assertThat(
            ExpressionUtil.selectsPartitions(
                Expressions.lessThan("ts", "2021-03-09T10:00:00.000000"),
                PartitionSpec.builderFor(SCHEMA).day("ts").build(),
                true))
        .as("Should not select partitions, on hour not day boundary")
        .isFalse();
  }