Details

    • Sub-task
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.1.0
    • None
    • SQL
    • None

    Description

       Lead/Lag window function throws AnalysisException without ORDER BY clause:

      SELECT lead(ten, four + 1) OVER (PARTITION BY four), ten, four
      FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s
      org.apache.spark.sql.AnalysisException
      Window function lead(ten#x, (four#x + 1), null) requires window to be ordered, please add ORDER BY clause. For example SELECT lead(ten#x, (four#x + 1), null)(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table;
      

       

      Maybe we need fix this issue.

      Attachments

        Issue Links

          Activity

            angerszhuuu angerszhu added a comment -

            our production meet this problem too when hive sql run in spark engine, I am working on this and will raise a  pr soon

            angerszhuuu angerszhu added a comment - our production meet this problem too when hive sql run in spark engine, I am working on this and will raise a  pr soon
            angerszhuuu angerszhu added a comment - add pr in  https://github.com/apache/spark/pull/27861
            catalinii Catalin Toda added a comment -

            At Lyft we are also in the process of deprecating Hive and we hit the same issue as the one highlighted here.

            hyukjin.kwon  going over the PR I was wondering what is the feedback for improvement for this specific ?

            angerszhuuu are you still interested in merging it ?

            catalinii Catalin Toda added a comment - At Lyft we are also in the process of deprecating Hive and we hit the same issue as the one highlighted here. hyukjin.kwon   going over the PR I was wondering what is the feedback for improvement for this specific ? angerszhuuu  are you still interested in merging it ?

            People

              Unassigned Unassigned
              beliefer Jiaan Geng
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: