Apache Drill
  1. Apache Drill
  2. DRILL-57

Add a logical operator that returns a constant result, similar to VALUES operator in SQL

    Details

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

      Description

      Add a logical operator that returns a constant result. This is necessary to be able to create values out of thin air, if you don't know what tables exist.

      This operator is analogous to the VALUES operator in SQL. For example,

      VALUES (1, 'a'), (2, 'b'), (3, 'c')

      returns 3 rows with 2 columns and

      VALUES (1, 'a'), (2, 'b'), (3, 'c') AS t(c1, c2)

      allows you to name those columns "c1" and "c2". VALUES is useful for evaluating expressions that don't belong in a table, for example

      VALUES 10 + 3

      (Some databases would express this "SELECT 10 + 3". Same idea, and same underlying relational operator.)

      The JSON for this new operator might look like this:

      {
      op: "constant",
      content: { [

      {c1: 1, c2: "a"}

      ,

      {c1: 2, c3: ["x", "y", "z"]}

      ] }
      }

      This operator is necessary in order to implement the SQL VALUES clause.

      1. constant.patch
        16 kB
        Jason Altekruse
      2. types_meeting_6_5_13.txt
        4 kB
        Jason Altekruse

        Activity

        Tony Stevenson made changes -
        Workflow no-reopen-closed, patch-avail, testing [ 12860398 ] Drill workflow [ 12933930 ]
        Jake Farrell made changes -
        Workflow no-reopen-closed, patch-avail [ 12807450 ] no-reopen-closed, patch-avail, testing [ 12860398 ]
        Jacques Nadeau made changes -
        Target Version/s M1 [ 12324669 ]
        Fix Version/s M1 [ 12324669 ]
        Jacques Nadeau made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jake Farrell made changes -
        Workflow jira [ 12774183 ] no-reopen-closed, patch-avail [ 12807450 ]
        Jacques Nadeau made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jason Altekruse made changes -
        Attachment types_meeting_6_5_13.txt [ 12586382 ]
        Julian Hyde made changes -
        Description Add a logical operator that returns a constant result. This is necessary to be able to create values out of thin air, if you don't know what tables exist.

        This operator is analogous to the VALUES operator in SQL. For example,

          VALUES (1, 'a'), (2, 'b'), (3, 'c')

        returns 2 rows with 3 columns and

          VALUES (1, 'a'), (2, 'b'), (3, 'c') AS t(c1, c2)

        allows you to name those columns "c1" and "c2". VALUES is useful for evaluating expressions that don't belong in a table, for example

          VALUES 10 + 3

        (Some databases would express this "SELECT 10 + 3". Same idea, and same underlying relational operator.)

        The JSON for this new operator might look like this:

        {
        op: "constant",
                      content: { [
                        {c1: 1, c2: "a"},
                        {c1: 2, c3: ["x", "y", "z"]}
                      ] }
        }

        This operator is necessary in order to implement the SQL VALUES clause.
        Add a logical operator that returns a constant result. This is necessary to be able to create values out of thin air, if you don't know what tables exist.

        This operator is analogous to the VALUES operator in SQL. For example,

          VALUES (1, 'a'), (2, 'b'), (3, 'c')

        returns 3 rows with 2 columns and

          VALUES (1, 'a'), (2, 'b'), (3, 'c') AS t(c1, c2)

        allows you to name those columns "c1" and "c2". VALUES is useful for evaluating expressions that don't belong in a table, for example

          VALUES 10 + 3

        (Some databases would express this "SELECT 10 + 3". Same idea, and same underlying relational operator.)

        The JSON for this new operator might look like this:

        {
        op: "constant",
                      content: { [
                        {c1: 1, c2: "a"},
                        {c1: 2, c3: ["x", "y", "z"]}
                      ] }
        }

        This operator is necessary in order to implement the SQL VALUES clause.
        Jason Altekruse made changes -
        Attachment constant.patch [ 12586358 ]
        Jason Altekruse made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Jason Altekruse made changes -
        Due Date 06/Jun/13
        Jacques Nadeau made changes -
        Assignee Michael Hausenblas [ mhausenblas ] Jason Altekruse [ jaltekruse ]
        Michael Hausenblas made changes -
        Field Original Value New Value
        Assignee Michael Hausenblas [ mhausenblas ]
        Julian Hyde created issue -

          People

          • Assignee:
            Jason Altekruse
            Reporter:
            Julian Hyde
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development