Skip to content

Commit

Permalink
[CALCITE-4114] Remove method CalciteAssert.forceDecorrelate (Jiatao Tao)
Browse files Browse the repository at this point in the history
Remove because its name is misleading.

close apache#2073
  • Loading branch information
Aaaaaaron authored and danny0405 committed Jul 27, 2020
1 parent 8a459d9 commit a412ac1
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/src/test/java/org/apache/calcite/test/CalciteAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -1830,21 +1830,16 @@ public AssertQuery withRel(final Function<RelBuilder, RelNode> relFn) {
return withHook(Hook.STRING_TO_QUERY,
(Consumer<Pair<FrameworkConfig, Holder<CalcitePrepare.Query>>>)
pair -> {
final FrameworkConfig config = forceDecorrelate(pair.left);
final FrameworkConfig config = Frameworks.newConfigBuilder(pair.left)
.context(
Contexts.of(CalciteConnectionConfig.DEFAULT
.set(CalciteConnectionProperty.FORCE_DECORRELATE,
Boolean.toString(false))))
.build();
final RelBuilder b = RelBuilder.create(config);
pair.right.set(CalcitePrepare.Query.of(relFn.apply(b)));
});
}

/** Creates a {@link FrameworkConfig} that does not decorrelate. */
private FrameworkConfig forceDecorrelate(FrameworkConfig config) {
return Frameworks.newConfigBuilder(config)
.context(
Contexts.of(CalciteConnectionConfig.DEFAULT
.set(CalciteConnectionProperty.FORCE_DECORRELATE,
Boolean.toString(false))))
.build();
}
}

/** Fluent interface for building a metadata query to be tested. */
Expand Down

0 comments on commit a412ac1

Please sign in to comment.