Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
SQL standard supports EXCLUDE clause within window frame definition.
We currently have it in sql_yacc.yy. The statement is parsed, but ignored:
opt_window_frame_clause:
|
/* empty */ {}
|
| window_frame_units window_frame_extent opt_window_frame_exclusion
|
opt_window_frame_exclusion:
|
/* empty */ { $$= Window_frame::EXCL_NONE; }
|
| EXCLUDE_SYM CURRENT_SYM ROW_SYM
|
{ $$= Window_frame::EXCL_CURRENT_ROW; }
|
| EXCLUDE_SYM GROUP_SYM
|
{ $$= Window_frame::EXCL_GROUP; }
|
| EXCLUDE_SYM TIES_SYM
|
{ $$= Window_frame::EXCL_TIES; }
|
| EXCLUDE_SYM NO_SYM OTHERS_SYM
|
{ $$= Window_frame::EXCL_NONE; }
|
;
|
The question is - should we implement frame exclusion? It doesn't seem to be supported by anybody:
- PostgreSQL: http://www.postgresql.org/docs/9.5/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS
- Oracle: http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174
- MS SQL server: https://msdn.microsoft.com/en-us/library/ms189461.aspx
- Apache Drill: https://drill.apache.org/docs/sql-window-functions-introduction/
- Amazon Redshift: http://docs.aws.amazon.com/redshift/latest/dg/r_Window_function_synopsis.html
If we decide not to support Frame Exclusion, we should disable it in the parser so that it doesn't confuse anybody.
Attachments
Issue Links
- is part of
-
MDEV-6115 window functions as in the SQL standard
-
- Closed
-
Activity
Description |
SQL standard supports {{EXCLUDE}} clause within window frame definition.
We currently have it in sql_yacc.yy. The statement is parsed, but ignored: {noformat} opt_window_frame_clause: /* empty */ {} | window_frame_units window_frame_extent opt_window_frame_exclusion {noformat} {noformat} opt_window_frame_exclusion: /* empty */ { $$= Window_frame::EXCL_NONE; } | EXCLUDE_SYM CURRENT_SYM ROW_SYM { $$= Window_frame::EXCL_CURRENT_ROW; } | EXCLUDE_SYM GROUP_SYM { $$= Window_frame::EXCL_GROUP; } | EXCLUDE_SYM TIES_SYM { $$= Window_frame::EXCL_TIES; } | EXCLUDE_SYM NO_SYM OTHERS_SYM { $$= Window_frame::EXCL_NONE; } ; {noformat} The question is - should we implement frame exclusion? It doesn't seem to be supported by anybody: * PostgreSQL: http://www.postgresql.org/docs/9.5/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS * Oracle: http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174 * MS SQL server: https://msdn.microsoft.com/en-us/library/ms189461.aspx * Apache Drill: https://drill.apache.org/docs/sql-window-functions-introduction/ |
SQL standard supports {{EXCLUDE}} clause within window frame definition.
We currently have it in sql_yacc.yy. The statement is parsed, but ignored: {noformat} opt_window_frame_clause: /* empty */ {} | window_frame_units window_frame_extent opt_window_frame_exclusion {noformat} {noformat} opt_window_frame_exclusion: /* empty */ { $$= Window_frame::EXCL_NONE; } | EXCLUDE_SYM CURRENT_SYM ROW_SYM { $$= Window_frame::EXCL_CURRENT_ROW; } | EXCLUDE_SYM GROUP_SYM { $$= Window_frame::EXCL_GROUP; } | EXCLUDE_SYM TIES_SYM { $$= Window_frame::EXCL_TIES; } | EXCLUDE_SYM NO_SYM OTHERS_SYM { $$= Window_frame::EXCL_NONE; } ; {noformat} The question is - should we implement frame exclusion? It doesn't seem to be supported by anybody: * PostgreSQL: http://www.postgresql.org/docs/9.5/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS * Oracle: http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174 * MS SQL server: https://msdn.microsoft.com/en-us/library/ms189461.aspx * Apache Drill: https://drill.apache.org/docs/sql-window-functions-introduction/ If we decide not to support Frame Exclusion, we should disable it in the parser so that it doesn't confuse anybody. |
Summary | Window functions and EXCLUDE statement | Window functions: Frame Exclusion support |
Description |
SQL standard supports {{EXCLUDE}} clause within window frame definition.
We currently have it in sql_yacc.yy. The statement is parsed, but ignored: {noformat} opt_window_frame_clause: /* empty */ {} | window_frame_units window_frame_extent opt_window_frame_exclusion {noformat} {noformat} opt_window_frame_exclusion: /* empty */ { $$= Window_frame::EXCL_NONE; } | EXCLUDE_SYM CURRENT_SYM ROW_SYM { $$= Window_frame::EXCL_CURRENT_ROW; } | EXCLUDE_SYM GROUP_SYM { $$= Window_frame::EXCL_GROUP; } | EXCLUDE_SYM TIES_SYM { $$= Window_frame::EXCL_TIES; } | EXCLUDE_SYM NO_SYM OTHERS_SYM { $$= Window_frame::EXCL_NONE; } ; {noformat} The question is - should we implement frame exclusion? It doesn't seem to be supported by anybody: * PostgreSQL: http://www.postgresql.org/docs/9.5/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS * Oracle: http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174 * MS SQL server: https://msdn.microsoft.com/en-us/library/ms189461.aspx * Apache Drill: https://drill.apache.org/docs/sql-window-functions-introduction/ If we decide not to support Frame Exclusion, we should disable it in the parser so that it doesn't confuse anybody. |
SQL standard supports {{EXCLUDE}} clause within window frame definition.
We currently have it in sql_yacc.yy. The statement is parsed, but ignored: {noformat} opt_window_frame_clause: /* empty */ {} | window_frame_units window_frame_extent opt_window_frame_exclusion {noformat} {noformat} opt_window_frame_exclusion: /* empty */ { $$= Window_frame::EXCL_NONE; } | EXCLUDE_SYM CURRENT_SYM ROW_SYM { $$= Window_frame::EXCL_CURRENT_ROW; } | EXCLUDE_SYM GROUP_SYM { $$= Window_frame::EXCL_GROUP; } | EXCLUDE_SYM TIES_SYM { $$= Window_frame::EXCL_TIES; } | EXCLUDE_SYM NO_SYM OTHERS_SYM { $$= Window_frame::EXCL_NONE; } ; {noformat} The question is - should we implement frame exclusion? It doesn't seem to be supported by anybody: * PostgreSQL: http://www.postgresql.org/docs/9.5/static/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS * Oracle: http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions004.htm#SQLRF06174 * MS SQL server: https://msdn.microsoft.com/en-us/library/ms189461.aspx * Apache Drill: https://drill.apache.org/docs/sql-window-functions-introduction/ * Amazon Redshift: http://docs.aws.amazon.com/redshift/latest/dg/r_Window_function_synopsis.html If we decide not to support Frame Exclusion, we should disable it in the parser so that it doesn't confuse anybody. |
Assignee | Vicentiu Ciorbaru [ cvicentiu ] |
Assignee | Vicentiu Ciorbaru [ cvicentiu ] | Sergei Petrunia [ psergey ] |
Fix Version/s | N/A [ 14700 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Component/s | Optimizer - Window functions [ 13502 ] | |
Component/s | Optimizer [ 10200 ] |
Workflow | MariaDB v3 [ 74542 ] | MariaDB v4 [ 132807 ] |