Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11.0
    • Component/s: None
    • Labels:
      None

      Description

      similar to current unionMergeRule.

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        I'm familiar with INTERSECT DISTINCT and INTERSECT ALL - but what is INTERSECT MERGE?

        Show
        julianhyde Julian Hyde added a comment - I'm familiar with INTERSECT DISTINCT and INTERSECT ALL - but what is INTERSECT MERGE ?
        Hide
        julianhyde Julian Hyde added a comment -

        Ah, I see, "intersect merge" is not syntax, it is a planner rule. Makes sense.

        Show
        julianhyde Julian Hyde added a comment - Ah, I see, "intersect merge" is not syntax, it is a planner rule. Makes sense.
        Hide
        julianhyde Julian Hyde added a comment -

        I'm working on variants of UnionMergeRule that work on Intersect and Minus.

        Note that it is not valid to merge Minus right-deep: Minus(a, Minus(b, c)) is not equivalent to Minus(a, b, c).

        Show
        julianhyde Julian Hyde added a comment - I'm working on variants of UnionMergeRule that work on Intersect and Minus . Note that it is not valid to merge Minus right-deep: Minus(a, Minus(b, c)) is not equivalent to Minus(a, b, c) .
        Hide
        pxiong Pengcheng Xiong added a comment -

        Yes, in Hive, we only merge intersect. We have not gone that far to merge any type of minus yet.

        Show
        pxiong Pengcheng Xiong added a comment - Yes, in Hive, we only merge intersect. We have not gone that far to merge any type of minus yet.
        Hide
        julianhyde Julian Hyde added a comment - - edited

        Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/9f44aea5.

        New instances of UnionMergeRule flatten trees of Intersect and Minus operators into nodes that have more than 2 inputs.

        New rules in PruneEmptyRules act on Intersect and Minus that have empty inputs, either converting them to the empty relational expression or removing empty inputs.

        RelBuilder now allows Minus to have more than 2 inputs.

        Show
        julianhyde Julian Hyde added a comment - - edited Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/9f44aea5 . New instances of UnionMergeRule flatten trees of Intersect and Minus operators into nodes that have more than 2 inputs. New rules in PruneEmptyRules act on Intersect and Minus that have empty inputs, either converting them to the empty relational expression or removing empty inputs. RelBuilder now allows Minus to have more than 2 inputs.
        Hide
        pxiong Pengcheng Xiong added a comment - - edited

        Hi Julian Hyde, thanks for your patch. The merge rule can be further improved for

         topOp.all != bottomOp.all 

        for union and intersect cases. Right now, it is covering the cases

         topOp.all, bottomOp.all 

        are

        true,true

        ,

        false,false

        . Actually, it should also cover the case

        false,true

        . That is, if the top level is distinct, we can always merge.

        Show
        pxiong Pengcheng Xiong added a comment - - edited Hi Julian Hyde , thanks for your patch. The merge rule can be further improved for topOp.all != bottomOp.all for union and intersect cases. Right now, it is covering the cases topOp.all, bottomOp.all are true , true , false , false . Actually, it should also cover the case false , true . That is, if the top level is distinct, we can always merge.
        Hide
        julianhyde Julian Hyde added a comment - - edited

        Ah yes, missed that. Good one! Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/ab25d36c.

        Show
        julianhyde Julian Hyde added a comment - - edited Ah yes, missed that. Good one! Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/ab25d36c .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.11.0 (2017-01-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            pxiong Pengcheng Xiong
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development