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

Provide default implementation for getting cost of evaluating an expression in base class of LogicalExpression, in stead of throw Exception

    XMLWordPrintableJSON

Details

    Description

      Today, the abstract class of LogicalExpression will throw Exception for two methods related to estimate the cost of evaluating an expression, in the hope that sub classes will override those two methods. However, if someone forgets to override, compiler and mvn build process will still be successful, yet will hit Exception in execution-time, complaining the sub class does not implement these methods. As Drill's adding more sub classes of LogicalExpression to the code base, it's more likely for someone to forget to override those two methods, making it error-prone to just throw Exception in the base class.

      In stead, we should provide a default implementation for those two methods in the base class. Certain sub classes will override to change the behavior.

      Attachments

        Activity

          People

            jni Jinfeng Ni
            jni Jinfeng Ni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: