Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7821

Replace Table.limit() by Table.fetch() and Table.offset()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • 1.4.0
    • 1.4.0
    • Table SQL / API
    • None

    Description

      The Table API method limit() exists in two variants:

      • limit(offset) returns all but the first offset records.
      • limit(offset, fetch) returns fetch records starting from the offset's record.

      Especially, the behavior of limit(offset) is confusing because one would rather expect a behavior of returning the offset first records instead of all but the offset first records.

      Moreover, the only way to return the first x records is to specify a 0 offset as limit(0, x).

      I propose to deprecate and replace both limit() variants by two new methods Table.offset(offset) and Table.fetch(fetch) that can be combined as follows:

      table.orderBy(...).fetch(x)
      table.orderBy(...).offset(x)
      table.orderBy(...).offset(x).fetch(y)
      

      Attachments

        Issue Links

          Activity

            People

              fhueske Fabian Hueske
              fhueske Fabian Hueske
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: