Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3285

Split DrillCursor.next(), clean up DrillCursor for clarity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • Client - JDBC
    • None

    Description

      Clean up the mess in DrillCursor, namely the poorly named (and of course undocumented) flow-control flags and the flag-laden next() method.

      ==========
      DRILL-3285: Part 1--Prep., Hygiene: Mainly, adding comments.

      Added/edited comments:

      • field doc. comments
      • method doc. comments
      • branch/block comments

      Removed unused recordBatchCount and getRecordBatchCount().

      Added logger call for spurious batch.

      Various cleanup:

      • Cleaned up logger.
      • Added "final" on updateColumns().
      • Wrapped some lines
      • Misc. comment whitespace.

      ==========
      DRILL-3285: Part 2--Renaming.

      Renamed state/control-flow members:

      • started -> initialSchemaLoaded
      • first -> beforeFirstBatch
      • redoFirstNext -> returnTrueForNextCallToNext
      • finished -> afterLastRow

      Renamed other items:

      • changed -> schemaChanged
      • currentBatch -> currentBatchHolder
      • DrillResultSet's currentBatch -> batchLoader

      ==========
      DRILL-3285: Part 3--Invert beforeFirstBatch -> ! afterFirstBatch.

      ==========
      DRILL-3285: Part 4--Reorder fields, updateColumns.

      ==========
      DRILL-3285: Part 5--Split old hacky next() into separate methods.

      Split the original public next() method (which was hacked to handle an extra,
      initial call to read the schema batch) into:

      • new loadInitialSchema() (for handling the call for the schema)
      • modified next() (for handling normal calls from ResultSet.next())
      • new private nextRowInternally() (for common code)

      Pulls invariant afterFirstBatch up out of bogus-batch loop.

      Attachments

        1. DRILL-3285.AllPts.1.patch.txt
          15 kB
          Daniel Barclay
        2. DRILL-3285.AllPts.2.patch.txt
          16 kB
          Daniel Barclay
        3. DRILL-3285.AllPts.3.patch.txt
          16 kB
          Daniel Barclay
        4. DRILL-3285.Pt1.1.patch.txt
          10 kB
          Daniel Barclay
        5. DRILL-3285.Pt2.1.patch.txt
          8 kB
          Daniel Barclay
        6. DRILL-3285.Pt3.1.patch.txt
          2 kB
          Daniel Barclay
        7. DRILL-3285.Pt4.1.patch.txt
          3 kB
          Daniel Barclay
        8. DRILL-3285.Pt5.1.patch.txt
          8 kB
          Daniel Barclay
        9. DRILL-3285.Pt5.2.patch.txt
          8 kB
          Daniel Barclay
        10. DRILL-3285.Pt5.3.patch.txt
          8 kB
          Daniel Barclay

        Issue Links

          Activity

            People

              mehant Mehant Baid
              dsbos Daniel Barclay
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: