Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window function: A window which depends on another cannot define partitioning. #11007

Closed
SunRunAway opened this issue Jul 1, 2019 · 1 comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility

Comments

@SunRunAway
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
SELECT FIRST_VALUE(fieldA) RESPECT NULLS OVER (w1 PARTITION BY fieldB ORDER BY fieldB ASC, fieldA DESC ROWS 2 PRECEDING) AS 'first_value', fieldA, fieldB FROM ( SELECT `col_datetime_key` AS fieldA, `col_datetime` AS fieldB FROM `table50_int_autoinc` ) as t WINDOW w1 AS (PARTITION BY fieldB ORDER BY fieldB ASC, fieldA ASC );
  1. What did you expect to see?
ERROR 3581 (HY000) at line 1: A window which depends on another cannot define partitioning.
  1. What did you see instead?
ERROR 3583 (HY000) at line 1: Window '<unnamed window>' cannot inherit 'w1' since both contain an ORDER BY clause.
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
@SunRunAway SunRunAway added type/bug The issue is confirmed as a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility labels Jul 1, 2019
@b41sh
Copy link
Member

b41sh commented Jul 3, 2019

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

2 participants