Skip to content

window function: should check fuction's arguments firstly. #11008

Closed
@SunRunAway

Description

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 NTH_VALUE(fieldA, -1) OVER (w1 PARTITION BY fieldB ORDER BY fieldB , fieldA ) AS 'ntile', fieldA, fieldB FROM ( SELECT `pk` AS fieldA, `col_date_key` AS fieldB FROM `table70_int_autoinc` ) as t WINDOW w1 AS ( ORDER BY fieldB ASC, fieldA DESC );
  1. What did you expect to see?
ERROR 1210 (HY000): Incorrect arguments to nth_value
  1. What did you see instead?
ERROR 3581 (HY000): A window which depends on another cannot define partitioning.
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.type/bugThe issue is confirmed as a bug.type/compatibility

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions