Skip to content

Commit

Permalink
Tests that code is dead within the SqlTranslatorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Palinkas committed Feb 18, 2021
1 parent 6035c31 commit 9fc11a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public Query asQuery(Expression e) {
@Override
public Query wrapFunctionQuery(ScalarFunction sf, Expression field, Supplier<Query> querySupplier) {
if (field instanceof StDistance && querySupplier.get() instanceof GeoDistanceQuery) {
if (true) {
throw new RuntimeException("If this code is not dead, QueryTranslatorTests.testTranslateStDistanceToQuery should " +
"trigger this Exception");
}
return ExpressionTranslator.wrapIfNested(querySupplier.get(), ((StDistance) field).left());
}
if (field instanceof FieldAttribute) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ public void testTranslateStDistanceToQuery() {
assertEquals(20.0, gq.lat(), 0.00001);
assertEquals(10.0, gq.lon(), 0.00001);
assertEquals(25.0, gq.distance(), 0.00001);
optimizeAndPlan(p);
}

public void testTranslateStXY() {
Expand Down

0 comments on commit 9fc11a5

Please sign in to comment.