Class PlanAnonymizer

java.lang.Object
org.elasticsearch.xpack.esql.anonymizer.PlanAnonymizer

public final class PlanAnonymizer extends Object
Thin facade over AnonymizationContext. Each pipeline stage's tree is rendered via plan.toString(NodeStringFormat.FULL, mapper) where the mapper is the context's NodeStringMapper view — every nodeString override that mentions an identifier or literal asks the mapper for the value to emit, and the mapper interns each one via the per- submission token maps. This class also renders the schema artifact (which has its own format requirements separate from the plan toString shape).
  • Method Details

    • forSubmission

      public static PlanAnonymizer forSubmission(String clusterUuid)
      One anonymizer per query submission so literal tokens don't carry across queries.
    • anonymize

      public PlanAnonymizer.AnonymizedPlans anonymize(LogicalPlan parsed, LogicalPlan analyzed, LogicalPlan optimized, PhysicalPlan physical)
      Anonymize whichever pipeline stages reached completion. Any of the four arguments may be null (e.g. parse failed → all null; analyze failed → only parsed non-null; etc.); the corresponding record field comes back empty. Schema is rendered from analyzed when available, else optimized (the parsed plan has UnresolvedRelations with no resolved attributes, so it carries no useful schema).