Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30374 Feature Parity between PostgreSQL and Spark (ANSI/SQL)
  3. SPARK-28330

ANSI SQL: Top-level <result offset clause> in <query expression>

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.4.0
    • SQL
    • None

    Description

      LIMIT and OFFSET

      LIMIT and OFFSET allow you to retrieve just a portion of the rows that are generated by the rest of the query:

      SELECT select_list
          FROM table_expression
          [ ORDER BY ... ]
          [ LIMIT { number | ALL } ] [ OFFSET number ]
      

      If a limit count is given, no more than that many rows will be returned (but possibly fewer, if the query itself yields fewer rows). LIMIT ALL is the same as omitting the LIMIT clause, as is LIMIT with a NULL argument.

      OFFSET says to skip that many rows before beginning to return rows. OFFSET 0 is the same as omitting the OFFSET clause, as is OFFSET with a NULL argument.

      If both OFFSET and LIMIT appear, then OFFSET rows are skipped before starting to count the LIMIT rows that are returned.

      https://www.postgresql.org/docs/11/queries-limit.html

      Feature ID: F861

      Attachments

        Issue Links

          Activity

            People

              beliefer Jiaan Geng
              yumwang Yuming Wang
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: