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

Add a "contract" for the result of a relational expression

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Add a "contract" for the result of a relational expression consisting of:

      • column names (maybe not unique),
      • possible multiple uses of the same column (without duplicating the column in the input relational expression),
      • convention,
      • column data types,
      • physical representation (e.g. as List or Object[]),
      • sort order.

      Currently that contract is expressed by a relational expression. But all of the aspects of the contract are at odds with best practices for relational expressions elsewhere in the tree. This is why we want to represent the contract not as a relational expression.

      See CALCITE-793 for an example of how a query does not ask for a sorted result, but because it is posed on a sorted table the planner assumes that the result has to be sorted. Maybe back out parts of 793's fix as part of fixing this issue.

      We would probably be able to obsolete RelCollations.PRESERVE.

      It is possible that the contract would bubble up as far as the Avatica signature.

        Activity

        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Resolved in release 1.5.0 (2015-11-10)

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.5.0 (2015-11-10)
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/5a397063 .
        Hide
        julianhyde Julian Hyde added a comment -

        Maybe the "contract" could be a special subclass of RelNode that only ever appears at the root of a tree, and has few or no rules that might screw it up.

        Show
        julianhyde Julian Hyde added a comment - Maybe the "contract" could be a special subclass of RelNode that only ever appears at the root of a tree, and has few or no rules that might screw it up.

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            julianhyde Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development