Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1777

Druid adapter: "WHERE FALSE" causes AssertionError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.13.0
    • 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)
      

      Attachments

        Activity

          People

            bslim Slim Bouguerra
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: