Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31512

make window function using order by optional

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.4.5
    • None
    • SQL
    • None
    • spark2.4.5

      hadoop2.7.7

    Description

      Hi all

      In other sql dialect ,order by is not the must when using window function,we may make it pararmteterized

      the below is the case :

      select row_number()over() from test1

      Error: org.apache.spark.sql.AnalysisException: Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; (state=,code=0)

       

      So. i suggest make it as a choice,or we will meet the error when migrate sql from other dialect,such as hive

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              小郭飞飞刀 philipse
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: