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

Allow all value expressions in ROW

    XMLWordPrintableJSON

Details

    Description

      In SQL standard 2011 part 7 value expression, it defines the SQL syntax for explicit ROW value constructor to allows all the valid value expreesion:

      <row value constructor> ::=
          <common value expression>
        | <boolean value expression>
        | <explicit row value constructor>
      
      <common value expression> ::=
          <numeric value expression>
        | <string value expression>
        | <datetime value expression>
        | <interval value expression>
        | <user-defined type value expression>
        | <reference value expression>
        | <collection value expression>
      
      
      <explicit row value constructor> ::=
          <left paren> <row value constructor element> <comma>
              <row value constructor element list> <right paren>
        | ROW <left paren> <row value constructor element list> <right paren>
        | <row subquery>
      
      <row value constructor element> ::=
        <value expression>    
      

      I also tried the PostgreSQL 9.6 for the query:

      create table t1(
        f0 int,
        f1 varchar(20)
      );
      
      insert into t1 values(1, 'abc');
      
      -- select row(t1.f0 + 1, t1.f1) from t1; -- outputs (2, abc)
      

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              danny0405 Danny Chen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m