Commit 0ec1289
authored
chore(isthmus): remove dead code (#604)
Since the use of DdlSqlToRelConverter was added to SubstraitSqlToCalcite
in commit 260a1c4, the original
invocation of SqlToRelConverter that was left as a fallback when it
returns null is never called. The reason is that DdlSqlToRelConverter
itself already falls back to calling SqlToRelConverter so it never
returns null. This means that removeRedundantProjects is never applied
to the Rel structure since this only occurs in the uncalled fallback
path. All tests continue to pass, which indicates that this optimiation
is unnecessary.
If it required in the future, it might be better written as follows to
provide flexibility in the rules applied:
static RelRoot applyPlannerRules(RelRoot root, RelOptRule... rules) {
HepProgramBuilder builder = HepProgram.builder();
for (RelOptRule rule : rules) {
builder.addRuleInstance(rule);
}
HepPlanner planner = new HepPlanner(builder.build());
planner.setRoot(root.rel);
RelNode optimizedExpression = planner.findBestExp();
return root.withRel(optimizedExpression);
}
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>1 parent 442f1f2 commit 0ec1289
File tree
1 file changed
+1
-28
lines changed- isthmus/src/main/java/io/substrait/isthmus/sql
1 file changed
+1
-28
lines changedLines changed: 1 addition & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 133 | + | |
147 | 134 | | |
148 | 135 | | |
149 | 136 | | |
| |||
154 | 141 | | |
155 | 142 | | |
156 | 143 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 144 | | |
0 commit comments