Class ChangePoint

All Implemented Interfaces:
NamedWriteable, Writeable, PostAnalysisVerificationAware, Resolvable, LicenseAware, ExecutesOn, ExecutesOn.Coordinator, SortPreserving, SurrogateLogicalPlan

Plan that detects change points in a list of values. See also: ChangePoint should always run on the coordinating node after the data is collected in sorted order by key. This is enforced by adding OrderBy in the surrogate plan. Furthermore, ChangePoint should be called with at most 1000 data points. That's enforced by the Limit in the surrogate plan.
  • Constructor Details

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable
    • info

      protected NodeInfo<ChangePoint> info()
      Description copied from class: Node
      Normally, you want to use one of the static create methods to implement this.

      For QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations like QueryPlan#transformExpressionsOnly(Function) will not have an effect.

      Specified by:
      info in class Node<LogicalPlan>
    • replaceChild

      public UnaryPlan replaceChild(LogicalPlan newChild)
      Specified by:
      replaceChild in class UnaryPlan
    • output

      public List<Attribute> output()
      Description copied from class: QueryPlan
      The ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results.
      Overrides:
      output in class UnaryPlan
    • value

      public Attribute value()
    • key

      public Attribute key()
    • targetType

      public Attribute targetType()
    • targetPvalue

      public Attribute targetPvalue()
    • computeReferences

      protected AttributeSet computeReferences()
      Description copied from class: QueryPlan
      This very likely needs to be overridden for QueryPlan.references() to be correct when inheriting. This can be called on unresolved plans and therefore must not rely on calls to QueryPlan.output().
      Overrides:
      computeReferences in class QueryPlan<LogicalPlan>
    • expressionsResolved

      public boolean expressionsResolved()
      Specified by:
      expressionsResolved in class LogicalPlan
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class UnaryPlan
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class UnaryPlan
    • surrogate

      public LogicalPlan surrogate()
      Description copied from interface: SurrogateLogicalPlan
      Returns the plan to be replaced with.
      Specified by:
      surrogate in interface SurrogateLogicalPlan
    • postAnalysisVerification

      public void postAnalysisVerification(Failures failures)
      Description copied from interface: PostAnalysisVerificationAware
      Allows the implementer to validate itself. This usually involves checking its internal setup, which often means checking the parameters it received on construction: their data or syntactic type, class, their count, expressions' structure etc. The discovered failures are added to the given Failures object.

      It is often more useful to perform the checks as extended as it makes sense, over stopping at the first failure. This will allow the author to progress faster to a correct query.

      Example: the Filter class, which models the WHERE command, checks that the expression it filters on - condition - is of a Boolean or NULL type:

           
           @Override
           void postAnalysisVerification(Failures failures) {
                if (condition.dataType() != NULL && condition.dataType() != BOOLEAN) {
                    failures.add(fail(condition, "Condition expression needs to be boolean, found [{}]", condition.dataType()));
                }
           }
           
           
      Specified by:
      postAnalysisVerification in interface PostAnalysisVerificationAware
      Parameters:
      failures - the object to add failures to.
    • licenseCheck

      public boolean licenseCheck(XPackLicenseState state)
      Description copied from interface: LicenseAware
      Return true if the implementer can be executed under the provided XPackLicenseState, otherwise false.
      Specified by:
      licenseCheck in interface LicenseAware