drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Altekruse (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-57) Add a logical operator that returns a constant result, similar to VALUES operator in SQL
Date Wed, 05 Jun 2013 16:27:23 GMT

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

Jason Altekruse commented on DRILL-57:
--------------------------------------

I have created an implementation of this operator using the code from the JsonRecordReader
to convert the records passed in the content field into unbacked records. It looks like type
inferencing is working well with that, but we will need to develop a format for specifying
types if we would like the option to type them explicitly.
                
> Add a logical operator that returns a constant result, similar to VALUES operator in
SQL
> ----------------------------------------------------------------------------------------
>
>                 Key: DRILL-57
>                 URL: https://issues.apache.org/jira/browse/DRILL-57
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Michael Hausenblas
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message