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

Error while applying rule ProjectScanRule: interpreter

    XMLWordPrintableJSON

Details

    Description

      The following test can reproduce the issue.

       

      // FrameworksTest.java
       @Test public void testMinMax() throws Exception {
       Table table = new TableImpl();
       final SchemaPlus rootSchema = Frameworks.createRootSchema(true);
       SchemaPlus schema = rootSchema.add("x", new AbstractSchema());
       schema.add("MYTABLE", table);
       List<RelTraitDef> traitDefs = new ArrayList<>();
       traitDefs.add(ConventionTraitDef.INSTANCE);
       traitDefs.add(RelDistributionTraitDef.INSTANCE);
       SqlParser.Config parserConfig =
       SqlParser.configBuilder(SqlParser.Config.DEFAULT)
       .setCaseSensitive(false)
       .build();
      final FrameworkConfig config = Frameworks.newConfigBuilder()
       .parserConfig(parserConfig)
       .defaultSchema(schema)
       .traitDefs(traitDefs)
       // define the rules you want to apply
       .ruleSets(
       RuleSets.ofList(AbstractConverter.ExpandConversionRule.INSTANCE, ProjectTableScanRule.INSTANCE))
       .programs(Programs.ofRules(Programs.RULE_SET))
       .build();
      executeQuery(config, " select min(id) as mi, max(id) as ma from mytable where id=1 group by id",
       CalciteSystemProperty.DEBUG.value());
       }
      

       

      This is from https://lists.apache.org/thread.html/67cb614ddd123a9092fdf37ace279eb563838b045a5554ad0005f030@%3Cdev.calcite.apache.org%3E

       

      Attachments

        1. CALCITE-3228.patch
          8 kB
          Jin Xing
        2. TestCalcite.java
          8 kB
          Amit Chavan

        Issue Links

          Activity

            People

              Chunwei Lei Chunwei Lei
              Chunwei Lei Chunwei Lei
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 8h 20m
                  8h 20m