Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Query with "WHERE FALSE" gives AssertionError in Druid adapter.
Originally logged as part of CALCITE-1775. Test case in DruidAdapterIT:
@Test public void testSelectCountFalse() { sql("select count(*) as c from \"foodmart\" where 1 < 0") .returnsUnordered("C=0"); }
gives
java.lang.AssertionError: cannot translate filter: false at org.apache.calcite.adapter.druid.DruidQuery$Translator.translateFilter(DruidQuery.java:1067) at org.apache.calcite.adapter.druid.DruidQuery$Translator.access$000(DruidQuery.java:933) at org.apache.calcite.adapter.druid.DruidQuery.getQuery(DruidQuery.java:497) at org.apache.calcite.adapter.druid.DruidQuery.deriveQuerySpec(DruidQuery.java:470) at org.apache.calcite.adapter.druid.DruidQuery.getQuerySpec(DruidQuery.java:414) at org.apache.calcite.adapter.druid.DruidQuery.deriveRowType(DruidQuery.java:308) at org.apache.calcite.rel.AbstractRelNode.getRowType(AbstractRelNode.java:224) at org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:857) at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:883) at org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:1769) at org.apache.calcite.plan.volcano.VolcanoRuleCall.transformTo(VolcanoRuleCall.java:135) at org.apache.calcite.plan.RelOptRuleCall.transformTo(RelOptRuleCall.java:225) at org.apache.calcite.adapter.druid.DruidRules$DruidFilterRule.onMatch(DruidRules.java:228) at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:211)