diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/planprinter/IoPlanPrinter.java b/core/trino-main/src/main/java/io/trino/sql/planner/planprinter/IoPlanPrinter.java index b323ca1e74fa..1575a4e1a160 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/planprinter/IoPlanPrinter.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/planprinter/IoPlanPrinter.java @@ -56,7 +56,6 @@ import java.util.Set; import static com.google.common.base.MoreObjects.toStringHelper; -import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static io.airlift.json.JsonCodec.jsonCodec; import static java.lang.String.format; @@ -205,17 +204,17 @@ private EstimatedStatsAndCost getEstimatedStatsAndCost() public static class TableColumnInfo { private final CatalogSchemaTableName table; - private final Set columnConstraints; + private final Constraint constraint; private final EstimatedStatsAndCost estimate; @JsonCreator public TableColumnInfo( @JsonProperty("table") CatalogSchemaTableName table, - @JsonProperty("columnConstraints") Set columnConstraints, + @JsonProperty("constraint") Constraint constraint, @JsonProperty("estimate") EstimatedStatsAndCost estimate) { this.table = requireNonNull(table, "table is null"); - this.columnConstraints = requireNonNull(columnConstraints, "columnConstraints is null"); + this.constraint = requireNonNull(constraint, "constraint is null"); this.estimate = requireNonNull(estimate, "estimate is null"); } @@ -226,9 +225,9 @@ public CatalogSchemaTableName getTable() } @JsonProperty - public Set getColumnConstraints() + public Constraint getConstraint() { - return columnConstraints; + return constraint; } @JsonProperty @@ -248,14 +247,14 @@ public boolean equals(Object obj) } TableColumnInfo o = (TableColumnInfo) obj; return Objects.equals(table, o.table) && - Objects.equals(columnConstraints, o.columnConstraints) && + Objects.equals(constraint, o.constraint) && Objects.equals(estimate, o.estimate); } @Override public int hashCode() { - return Objects.hash(table, columnConstraints, estimate); + return Objects.hash(table, constraint, estimate); } @Override @@ -263,13 +262,69 @@ public String toString() { return toStringHelper(this) .add("table", table) - .add("columnConstraints", columnConstraints) + .add("constraint", constraint) .add("estimate", estimate) .toString(); } } } + public static class Constraint + { + private final boolean isNone; + private final Set columnConstraints; + + @JsonCreator + public Constraint( + @JsonProperty("none") boolean isNone, + @JsonProperty("columnConstraints") Set columnConstraints) + { + this.isNone = isNone; + this.columnConstraints = ImmutableSet.copyOf(requireNonNull(columnConstraints, "columnConstraints is null")); + } + + @JsonProperty + public boolean isNone() + { + return isNone; + } + + @JsonProperty + public Set getColumnConstraints() + { + return columnConstraints; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + Constraint o = (Constraint) obj; + return Objects.equals(isNone, o.isNone) && + Objects.equals(columnConstraints, o.columnConstraints); + } + + @Override + public int hashCode() + { + return Objects.hash(isNone, columnConstraints); + } + + @Override + public String toString() + { + return toStringHelper(this) + .add("none", isNone) + .add("columnConstraints", columnConstraints) + .toString(); + } + } + public static class ColumnConstraint { private final String columnName; @@ -703,7 +758,7 @@ private void addInputTableConstraints(TupleDomain filterDomain, Ta tableMetadata.getCatalogName(), tableMetadata.getTable().getSchemaName(), tableMetadata.getTable().getTableName()), - parseConstraints(table, predicateDomain.intersect(filterDomain)), + parseConstraint(table, predicateDomain.intersect(filterDomain)), estimatedStatsAndCost)); } @@ -722,18 +777,20 @@ private EstimatedStatsAndCost getEstimatedStatsAndCost(TableScanNode node) return estimatedStatsAndCost; } - private Set parseConstraints(TableHandle tableHandle, TupleDomain constraint) + private Constraint parseConstraint(TableHandle tableHandle, TupleDomain constraint) { - checkArgument(!constraint.isNone()); + if (constraint.isNone()) { + return new Constraint(true, ImmutableSet.of()); + } ImmutableSet.Builder columnConstraints = ImmutableSet.builder(); - for (Map.Entry entry : constraint.getDomains().get().entrySet()) { + for (Map.Entry entry : constraint.getDomains().orElseThrow().entrySet()) { ColumnMetadata columnMetadata = plannerContext.getMetadata().getColumnMetadata(session, tableHandle, entry.getKey()); columnConstraints.add(new ColumnConstraint( columnMetadata.getName(), columnMetadata.getType(), parseDomain(entry.getValue().simplify()))); } - return columnConstraints.build(); + return new Constraint(false, columnConstraints.build()); } private FormattedDomain parseDomain(Domain domain) diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java index 54b9d431a385..ac5ba357b179 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java @@ -41,6 +41,7 @@ import io.trino.spi.type.VarcharType; import io.trino.sql.planner.Plan; import io.trino.sql.planner.plan.ExchangeNode; +import io.trino.sql.planner.planprinter.IoPlanPrinter; import io.trino.sql.planner.planprinter.IoPlanPrinter.ColumnConstraint; import io.trino.sql.planner.planprinter.IoPlanPrinter.EstimatedStatsAndCost; import io.trino.sql.planner.planprinter.IoPlanPrinter.FormattedDomain; @@ -1050,37 +1051,39 @@ public void testIoExplain() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("1"), EXACTLY), - new FormattedMarker(Optional.of("1"), EXACTLY)), - new FormattedRange( - new FormattedMarker(Optional.of("2"), EXACTLY), - new FormattedMarker(Optional.of("2"), EXACTLY))))), - new ColumnConstraint( - "processing", - BOOLEAN, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("false"), EXACTLY), - new FormattedMarker(Optional.of("false"), EXACTLY))))), - new ColumnConstraint( - "custkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.empty(), ABOVE), - new FormattedMarker(Optional.of("10"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("1"), EXACTLY), + new FormattedMarker(Optional.of("1"), EXACTLY)), + new FormattedRange( + new FormattedMarker(Optional.of("2"), EXACTLY), + new FormattedMarker(Optional.of("2"), EXACTLY))))), + new ColumnConstraint( + "processing", + BOOLEAN, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("false"), EXACTLY), + new FormattedMarker(Optional.of("false"), EXACTLY))))), + new ColumnConstraint( + "custkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.empty(), ABOVE), + new FormattedMarker(Optional.of("10"), EXACTLY))))))), estimate)), Optional.of(new CatalogSchemaTableName(catalog, "tpch", "test_io_explain")), estimate)); @@ -1098,25 +1101,27 @@ public void testIoExplain() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("1"), EXACTLY), - new FormattedMarker(Optional.of("199"), EXACTLY))))), - new ColumnConstraint( - "custkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.empty(), ABOVE), - new FormattedMarker(Optional.of("10"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("1"), EXACTLY), + new FormattedMarker(Optional.of("199"), EXACTLY))))), + new ColumnConstraint( + "custkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.empty(), ABOVE), + new FormattedMarker(Optional.of("10"), EXACTLY))))))), estimate)), Optional.of(new CatalogSchemaTableName(catalog, "tpch", "test_io_explain")), estimate)); @@ -1130,25 +1135,27 @@ public void testIoExplain() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("100"), EXACTLY), - new FormattedMarker(Optional.of("100"), EXACTLY))))), - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("100"), EXACTLY), - new FormattedMarker(Optional.of("100"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("100"), EXACTLY), + new FormattedMarker(Optional.of("100"), EXACTLY))))), + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("100"), EXACTLY), + new FormattedMarker(Optional.of("100"), EXACTLY))))))), estimate)), Optional.of(new CatalogSchemaTableName(catalog, "tpch", "test_io_explain")), finalEstimate)); @@ -1171,37 +1178,39 @@ public void testIoExplainColumnFilters() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain_column_filters"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("1"), EXACTLY), - new FormattedMarker(Optional.of("1"), EXACTLY)), - new FormattedRange( - new FormattedMarker(Optional.of("2"), EXACTLY), - new FormattedMarker(Optional.of("2"), EXACTLY))))), - new ColumnConstraint( - "custkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.empty(), ABOVE), - new FormattedMarker(Optional.of("10"), EXACTLY))))), - new ColumnConstraint( - "orderstatus", - VarcharType.createVarcharType(1), - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("P"), EXACTLY), - new FormattedMarker(Optional.of("P"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("1"), EXACTLY), + new FormattedMarker(Optional.of("1"), EXACTLY)), + new FormattedRange( + new FormattedMarker(Optional.of("2"), EXACTLY), + new FormattedMarker(Optional.of("2"), EXACTLY))))), + new ColumnConstraint( + "custkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.empty(), ABOVE), + new FormattedMarker(Optional.of("10"), EXACTLY))))), + new ColumnConstraint( + "orderstatus", + VarcharType.createVarcharType(1), + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("P"), EXACTLY), + new FormattedMarker(Optional.of("P"), EXACTLY))))))), estimate)), Optional.empty(), finalEstimate)); @@ -1212,40 +1221,42 @@ public void testIoExplainColumnFilters() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain_column_filters"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("1"), EXACTLY), - new FormattedMarker(Optional.of("1"), EXACTLY)), - new FormattedRange( - new FormattedMarker(Optional.of("2"), EXACTLY), - new FormattedMarker(Optional.of("2"), EXACTLY))))), - new ColumnConstraint( - "orderstatus", - VarcharType.createVarcharType(1), - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("P"), EXACTLY), - new FormattedMarker(Optional.of("P"), EXACTLY)), - new FormattedRange( - new FormattedMarker(Optional.of("S"), EXACTLY), - new FormattedMarker(Optional.of("S"), EXACTLY))))), - new ColumnConstraint( - "custkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.empty(), ABOVE), - new FormattedMarker(Optional.of("10"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("1"), EXACTLY), + new FormattedMarker(Optional.of("1"), EXACTLY)), + new FormattedRange( + new FormattedMarker(Optional.of("2"), EXACTLY), + new FormattedMarker(Optional.of("2"), EXACTLY))))), + new ColumnConstraint( + "orderstatus", + VarcharType.createVarcharType(1), + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("P"), EXACTLY), + new FormattedMarker(Optional.of("P"), EXACTLY)), + new FormattedRange( + new FormattedMarker(Optional.of("S"), EXACTLY), + new FormattedMarker(Optional.of("S"), EXACTLY))))), + new ColumnConstraint( + "custkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.empty(), ABOVE), + new FormattedMarker(Optional.of("10"), EXACTLY))))))), estimate)), Optional.empty(), finalEstimate)); @@ -1256,28 +1267,30 @@ public void testIoExplainColumnFilters() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_io_explain_column_filters"), - ImmutableSet.of( - new ColumnConstraint( - "orderkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("1"), EXACTLY), - new FormattedMarker(Optional.of("1"), EXACTLY)), - new FormattedRange( - new FormattedMarker(Optional.of("2"), EXACTLY), - new FormattedMarker(Optional.of("2"), EXACTLY))))), - new ColumnConstraint( - "custkey", - BIGINT, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.empty(), ABOVE), - new FormattedMarker(Optional.of("10"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "orderkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("1"), EXACTLY), + new FormattedMarker(Optional.of("1"), EXACTLY)), + new FormattedRange( + new FormattedMarker(Optional.of("2"), EXACTLY), + new FormattedMarker(Optional.of("2"), EXACTLY))))), + new ColumnConstraint( + "custkey", + BIGINT, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.empty(), ABOVE), + new FormattedMarker(Optional.of("10"), EXACTLY))))))), estimate)), Optional.empty(), finalEstimate)); @@ -1285,6 +1298,28 @@ public void testIoExplainColumnFilters() assertUpdate("DROP TABLE test_io_explain_column_filters"); } + @Test + public void testIoExplainWithEmptyPartitionedTable() + { + // Test IO explain a partitioned table with no data. + assertUpdate("CREATE TABLE test_io_explain_with_empty_partitioned_table WITH (partitioned_by = ARRAY['orderkey']) AS SELECT custkey, orderkey FROM orders WITH NO DATA", 0); + + EstimatedStatsAndCost estimate = new EstimatedStatsAndCost(0.0, 0.0, 0.0, 0.0, 0.0); + MaterializedResult result = computeActual("EXPLAIN (TYPE IO, FORMAT JSON) SELECT custkey, orderkey FROM test_io_explain_with_empty_partitioned_table"); + assertEquals( + getIoPlanCodec().fromJson((String) getOnlyElement(result.getOnlyColumnAsSet())), + new IoPlan( + ImmutableSet.of( + new TableColumnInfo( + new CatalogSchemaTableName(catalog, "tpch", "test_io_explain_with_empty_partitioned_table"), + new IoPlanPrinter.Constraint(true, ImmutableSet.of()), + estimate)), + Optional.empty(), + estimate)); + + assertUpdate("DROP TABLE test_io_explain_with_empty_partitioned_table"); + } + @Test public void testIoExplainNoFilter() { @@ -1314,16 +1349,18 @@ public void testIoExplainNoFilter() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "io_explain_test_no_filter"), - ImmutableSet.of( - new ColumnConstraint( - "ds", - VARCHAR, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("a"), EXACTLY), - new FormattedMarker(Optional.of("a"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "ds", + VARCHAR, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("a"), EXACTLY), + new FormattedMarker(Optional.of("a"), EXACTLY))))))), estimate)), Optional.empty(), finalEstimate)); @@ -1359,25 +1396,27 @@ public void testIoExplainFilterOnAgg() ImmutableSet.of( new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "io_explain_test_filter_on_agg"), - ImmutableSet.of( - new ColumnConstraint( - "ds", - VARCHAR, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("a"), EXACTLY), - new FormattedMarker(Optional.of("a"), EXACTLY))))), - new ColumnConstraint( - "b", - VARCHAR, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of("b"), EXACTLY), - new FormattedMarker(Optional.of("b"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "ds", + VARCHAR, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("a"), EXACTLY), + new FormattedMarker(Optional.of("a"), EXACTLY))))), + new ColumnConstraint( + "b", + VARCHAR, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of("b"), EXACTLY), + new FormattedMarker(Optional.of("b"), EXACTLY))))))), estimate)), Optional.empty(), finalEstimate)); @@ -1413,21 +1452,24 @@ public void testIoExplainWithPrimitiveTypes() type.getDisplayName()); assertUpdate(query, 1); + assertEquals( getIoPlanCodec().fromJson((String) getOnlyElement(computeActual("EXPLAIN (TYPE IO, FORMAT JSON) SELECT * FROM test_types_table").getOnlyColumnAsSet())), new IoPlan( ImmutableSet.of(new TableColumnInfo( new CatalogSchemaTableName(catalog, "tpch", "test_types_table"), - ImmutableSet.of( - new ColumnConstraint( - "my_col", - type, - new FormattedDomain( - false, - ImmutableSet.of( - new FormattedRange( - new FormattedMarker(Optional.of(entry.getKey().toString()), EXACTLY), - new FormattedMarker(Optional.of(entry.getKey().toString()), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new ColumnConstraint( + "my_col", + type, + new FormattedDomain( + false, + ImmutableSet.of( + new FormattedRange( + new FormattedMarker(Optional.of(entry.getKey().toString()), EXACTLY), + new FormattedMarker(Optional.of(entry.getKey().toString()), EXACTLY))))))), estimate)), Optional.empty(), estimate), @@ -8301,6 +8343,7 @@ private void assertConstraints(@Language("SQL") String query, Set constraints = getIoPlanCodec().fromJson((String) getOnlyElement(result.getOnlyColumnAsSet())) .getInputTableColumnInfos().stream() .findFirst().get() + .getConstraint() .getColumnConstraints(); assertTrue(constraints.containsAll(expected)); diff --git a/testing/trino-tests/src/test/java/io/trino/tests/tpch/TestTpchConnectorTest.java b/testing/trino-tests/src/test/java/io/trino/tests/tpch/TestTpchConnectorTest.java index 62fc67bd3575..6c74f81244c0 100644 --- a/testing/trino-tests/src/test/java/io/trino/tests/tpch/TestTpchConnectorTest.java +++ b/testing/trino-tests/src/test/java/io/trino/tests/tpch/TestTpchConnectorTest.java @@ -97,24 +97,27 @@ public void testIoExplain() MaterializedResult result = computeActual("EXPLAIN (TYPE IO, FORMAT JSON) " + query); EstimatedStatsAndCost scanEstimate = new EstimatedStatsAndCost(15000.0, 1597294.0, 1597294.0, 0.0, 0.0); EstimatedStatsAndCost totalEstimate = new EstimatedStatsAndCost(15000.0, 1597294.0, 1597294.0, 0.0, 1597294.0); + IoPlanPrinter.IoPlan.TableColumnInfo input = new IoPlanPrinter.IoPlan.TableColumnInfo( new CatalogSchemaTableName("tpch", "tiny", "orders"), - ImmutableSet.of( - new IoPlanPrinter.ColumnConstraint( - "orderstatus", - createVarcharType(1), - new IoPlanPrinter.FormattedDomain( - false, - ImmutableSet.of( - new IoPlanPrinter.FormattedRange( - new IoPlanPrinter.FormattedMarker(Optional.of("F"), EXACTLY), - new IoPlanPrinter.FormattedMarker(Optional.of("F"), EXACTLY)), - new IoPlanPrinter.FormattedRange( - new IoPlanPrinter.FormattedMarker(Optional.of("O"), EXACTLY), - new IoPlanPrinter.FormattedMarker(Optional.of("O"), EXACTLY)), - new IoPlanPrinter.FormattedRange( - new IoPlanPrinter.FormattedMarker(Optional.of("P"), EXACTLY), - new IoPlanPrinter.FormattedMarker(Optional.of("P"), EXACTLY)))))), + new IoPlanPrinter.Constraint( + false, + ImmutableSet.of( + new IoPlanPrinter.ColumnConstraint( + "orderstatus", + createVarcharType(1), + new IoPlanPrinter.FormattedDomain( + false, + ImmutableSet.of( + new IoPlanPrinter.FormattedRange( + new IoPlanPrinter.FormattedMarker(Optional.of("F"), EXACTLY), + new IoPlanPrinter.FormattedMarker(Optional.of("F"), EXACTLY)), + new IoPlanPrinter.FormattedRange( + new IoPlanPrinter.FormattedMarker(Optional.of("O"), EXACTLY), + new IoPlanPrinter.FormattedMarker(Optional.of("O"), EXACTLY)), + new IoPlanPrinter.FormattedRange( + new IoPlanPrinter.FormattedMarker(Optional.of("P"), EXACTLY), + new IoPlanPrinter.FormattedMarker(Optional.of("P"), EXACTLY))))))), scanEstimate); ObjectMapperProvider objectMapperProvider = new ObjectMapperProvider();