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

Revert incorrect logic to infer collation of LogicalAggregate

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: core
    • Labels:
      None
    1. CALCITE-822-0.patch
      3 kB
      Milinda Lakmal Pathirage

      Activity

      Hide
      milinda Milinda Lakmal Pathirage added a comment - - edited

      Fix which removes the incorrect inferring of LogicalAggregate's collations.

      With this fix I had to change the test LatticeTest#testJG also. When collation inferring logic was there the RelNode to string conversion added some extra characters to the output. For example:

      • m1=[SUM($5)] becomes m1=[$SUM0($5)]

      But I'm not sure about the exact reason behind this. Julian Hyde may know why this is happening when collation metadata is there in LogicalAggregate.

      Show
      milinda Milinda Lakmal Pathirage added a comment - - edited Fix which removes the incorrect inferring of LogicalAggregate's collations. With this fix I had to change the test LatticeTest#testJG also. When collation inferring logic was there the RelNode to string conversion added some extra characters to the output. For example: m1= [SUM($5)] becomes m1= [$SUM0($5)] But I'm not sure about the exact reason behind this. Julian Hyde may know why this is happening when collation metadata is there in LogicalAggregate.
      Hide
      julianhyde Julian Hyde added a comment -

      Maryann Xue noticed the issue with SUM and $SUM0. They are similar aggregate functions that may both be viable and have the same cost; thus plans will oscillate between SUM and $SUM0. Her patch to CALCITE-793 fixes the issue by making $SUM0 slightly more expensive.

      Show
      julianhyde Julian Hyde added a comment - Maryann Xue noticed the issue with SUM and $SUM0. They are similar aggregate functions that may both be viable and have the same cost; thus plans will oscillate between SUM and $SUM0. Her patch to CALCITE-793 fixes the issue by making $SUM0 slightly more expensive.
      Show
      julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/ac934f69 with a test case in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/e827bf0a .
      Hide
      jnadeau Jacques Nadeau added a comment -

      Resolved in release 1.4.0-incubating (2015-08-23)

      Show
      jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

        People

        • Assignee:
          milinda Milinda Lakmal Pathirage
          Reporter:
          milinda Milinda Lakmal Pathirage
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development