All Implemented Interfaces:
NamedWriteable, Writeable, PostAnalysisVerificationAware, TelemetryAware, Resolvable, GeneratingPlan<CompoundOutputEval<UserAgent>>, Streaming

public class UserAgent extends CompoundOutputEval<UserAgent>
The logical plan for the USER_AGENT command.
  • Field Details

  • Constructor Details

  • Method Details

    • createInitialInstance

      public static UserAgent createInitialInstance(Source source, LogicalPlan child, Expression input, Attribute outputFieldPrefix, boolean extractDeviceType, String regexFile, SequencedMap<String,Class<?>> filteredOutputFields)
      Creates the initial logical plan instance, computing output attributes from the filtered output fields. The caller (LogicalPlanBuilder) resolves properties and extractDeviceType into the filtered output fields map.
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class CompoundOutputEval<UserAgent>
      Throws:
      IOException
    • createNewInstance

      public UserAgent createNewInstance(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes)
      Description copied from class: CompoundOutputEval
      Creates a new instance of the specific CompoundOutputEval subclass with the provided parameters. Subclasses should call their corresponding constructor with the provided arguments and the concrete evaluator instance.
      Specified by:
      createNewInstance in class CompoundOutputEval<UserAgent>
      Parameters:
      source - the source information
      child - the child logical plan
      input - the input expression
      outputFieldNames - the output field names, used for the computation of the output attributes
      outputFieldAttributes - the output attributes
      Returns:
      a new instance of the specific CompoundOutputEval subclass
    • info

      protected NodeInfo<? extends LogicalPlan> 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.

      Overrides:
      info in class CompoundOutputEval<UserAgent>
    • innerHashCode

      protected int innerHashCode()
      Specified by:
      innerHashCode in class CompoundOutputEval<UserAgent>
    • innerEquals

      protected boolean innerEquals(CompoundOutputEval<?> other)
      Specified by:
      innerEquals in class CompoundOutputEval<UserAgent>
    • getWriteableName

      public String getWriteableName()
    • telemetryLabel

      public String telemetryLabel()
      Returns:
      the label reported in the telemetry data. Only needs to be overwritten if the label doesn't match the class name.
    • 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()));
                }
           }
           
           
      Parameters:
      failures - the object to add failures to.
    • extractDeviceType

      public boolean extractDeviceType()
    • regexFile

      public String regexFile()