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

Overuse of SchemaChangeException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.9.0
    • None
    • None
    • None

    Description

      Drill code overuses the SchemaChangeException exception. This exception is thrown any time that code attempts to allocate or access a value vector. It causes all generated methods to throw the exception, all templates to declare the exception, and all operators to handle the exception.

      The only problem is that, semantically, where the code is called that throws the exception can never actually encounter this exception. That is, in most cases, code elsewhere has already handled actual schema changes; where the exception is thrown is only a theoretical possibility. But, since schema changes are actually handled elsewhere, it is a coding error if the SchemaChangeException is thrown deep in the code.

      Since the exception in these cases is a coding error, the exception thrown should be unchecked, something like IllegalArgumentException or IllegalStateException.

      Said another way, the design of Drill should be that each operator properly handles a schema change as reported from upstream. If the operator fails to handle the schema change, and the code encounters a problem when accessing or allocating a vector, this is not a schema change, this is a programming error.

      Better to allow the programmer to focus on real issues (actual schema change) than to muddy the picture with constant, irrelevant potential schema changes.

      Most code that receives such exceptions turns around and throws an unchecked illegal state exception anyway, so we are not buying anything other than creating a mess.

      Attachments

        Activity

          People

            Unassigned Unassigned
            paul-rogers Paul Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: