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

Refactor and simplify the fragment, operator contexts for testing

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.12.0
    • Fix Version/s: 1.12.0
    • Component/s: None
    • Labels:
      None

      Description

      Drill's execution engine has a "fragment context" that provides state for a fragment as a whole, and an "operator context" which provides state for a single operator. Historically, these have both been concrete classes that make generous references to the Drillbit context, and hence need a full Drill server in order to operate.

      Drill has historically made extensive use of system-level testing: build the entire server and fire queries at it to test each component. Over time, we are augmenting that approach with unit tests: the ability to test each operator (or parts of an operator) in isolation.

      Since each operator requires access to both the operator and fragment context, the fact that the contexts depend on the overall server creates a large barrier to unit testing. An earlier checkin started down the path of defining the contexts as interfaces that can have different run-time and test-time implementations to enable testing.

      This ticket asks to refactor those interfaces: simplifying the operator context and introducing an interface for the fragment context. New code will use these new interfaces, while older code continues to use the concrete implementations. Over time, as operators are enhanced, they can be modified to allow unit-level testing.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Paul.Rogers Paul Rogers
                Reporter:
                Paul.Rogers Paul Rogers
                Reviewer:
                Sorabh Hamirwasia
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: