[ 
https://issues.apache.org/jira/browse/CALCITE-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15685293#comment-15685293
 ] 

Dayue Gao commented on CALCITE-1501:
------------------------------------

[~julianhyde], I have some problems testing EnumerableIntersect, due to 
IntersectToDistinctRule.

I've tried removing it using Hook.PROGRAM, but it doesn't work.

{code:java}
  @Test public void testIntersect() {
    CalciteAssert.hr()
        .query("select \"empid\", \"name\" from \"hr\".\"emps\" where 
\"deptno\"=10\n"
            + " intersect \n"
            + " select \"empid\", \"name\" from \"hr\".\"emps\" where 
\"empid\">=150")
        .withHook(Hook.PROGRAM, new 
Function<Pair<List<Prepare.Materialization>, Holder<Program>>,
            Void>() {
          public Void apply(Pair<List<Prepare.Materialization>, 
Holder<Program>> pair) {
            pair.right.set(new Program() {
              public RelNode run(RelOptPlanner planner, RelNode rel,
                                 RelTraitSet requiredOutputTraits) {
                planner.removeRule(IntersectToDistinctRule.INSTANCE);
                return Programs.standard().run(planner, rel, 
requiredOutputTraits);
              }
            });
            return null;
          }
        })
        .explainContains(""
            + "PLAN=EnumerableIntersect(all=[false])")
        .returns(""
            + "empid=150; name=Sebastian\n");
  }
{code}

Could you give me some suggestions?

> EnumerableUnion should use array comparator when row type is ARRAY
> ------------------------------------------------------------------
>
>                 Key: CALCITE-1501
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1501
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.0
>            Reporter: Dayue Gao
>            Assignee: Julian Hyde
>
> Reproduce using cvs adaptor example
> {noformat}
> 0: jdbc:calcite:model=target/test-classes/mod> select count(*), max(deptno) 
> from emps e1 union select count(*), max(deptno) from emps e2;
> +---------------------+--------+
> |       EXPR$0        | EXPR$1 |
> +---------------------+--------+
> | 5                   | 40     |
> | 5                   | 40     |
> +---------------------+--------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to