Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-756 (Umbrella) Window function support
  3. TAJO-757

Add parser rule and algebraic expression for window function

    XMLWordPrintableJSON

    Details

      Description

      See the title. The object of this issue is to add ANTLR parser rule and algebraic expression for window function.

      According to SQL 2003 standards, BNF for window function is as follows:

      <window function>    ::=   <window function type> OVER <window name or specification>
      
      <window function type>    ::= 
               <rank function type> <left paren> <right paren>
           |     ROW_NUMBER <left paren> <right paren>
           |     <aggregate function>
      
      <rank function type>    ::=   RANK | DENSE_RANK | PERCENT_RANK | CUME_DIST
      
      <window name or specification>    ::=   <window name> | <in-line window specification>
      
      <in-line window specification>    ::=   <window specification>
      
      <window specification>    ::=   <left paren> <window specification details> <right paren>
      
      <window specification details>    ::= 
               [ <existing window name> ] [ <window partition clause> ] [ <window order clause> ] [ <window frame clause> ]
      
      <existing window name>    ::=   <window name>
      
      <window partition clause>    ::=   PARTITION BY <window partition column reference list>
      
      <window partition column reference list>    ::=   <window partition column reference> [ { <comma> <window partition column reference> }... ]
      
      <window partition column reference>    ::=   <column reference> [ <collate clause> ]
      
      <window order clause>    ::=   ORDER BY <sort specification list>
      
      <window frame clause>    ::=   <window frame units> <window frame extent> [ <window frame exclusion> ]
      
      <window frame units>    ::=   ROWS | RANGE
      
      <window frame extent>    ::=   <window frame start> | <window frame between>
      
      <window frame start>    ::=   UNBOUNDED PRECEDING | <window frame preceding> | CURRENT ROW
      
      <window frame preceding>    ::=   <unsigned value specification> PRECEDING
      
      <window frame between>    ::=   BETWEEN <window frame bound 1> AND <window frame bound 2>
      
      <window frame bound 1>    ::=   <window frame bound>
      
      <window frame bound 2>    ::=   <window frame bound>
      
      <window frame bound>    ::= 
               <window frame start>
           |     UNBOUNDED FOLLOWING 
           |     <window frame following>
      
      <window frame following>    ::=   <unsigned value specification> FOLLOWING
      
      <window frame exclusion>    ::= 
               EXCLUDE CURRENT ROW 
           |     EXCLUDE GROUP 
           |     EXCLUDE TIES 
           |     EXCLUDE NO OTHERS
      

        Attachments

        1. TAJO-757.patch
          57 kB
          Hyunsik Choi

          Activity

            People

            • Assignee:
              hyunsik Hyunsik Choi
              Reporter:
              hyunsik Hyunsik Choi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: