Skip to content

Anonymize xyseries command and mark it experimental in docs - #5643

Merged
penghuo merged 1 commit into
opensearch-project:mainfrom
penghuo:feat/xyseries
Jul 22, 2026
Merged

Anonymize xyseries command and mark it experimental in docs#5643
penghuo merged 1 commit into
opensearch-project:mainfrom
penghuo:feat/xyseries

Conversation

@penghuo

@penghuo penghuo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #5343 (xyseries command).

  • Adds visitXyseries to PPLQueryDataAnonymizer so the xyseries stage appears in the anonymized query logged for every PPL request, with pivot literals and options masked. Previously the visitor fell through to visitChildren and the entire | xyseries ... in ("F","M") ... clause was silently dropped from log output (including raw pivot-value literals).
  • Marks xyseries as experimental (since 3.8) in docs/user/ppl/index.md, matching how other newly-introduced commands are listed.

Related Issues

Follow-up to #5343

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Add visitXyseries to PPLQueryDataAnonymizer so the xyseries stage
appears in the anonymized query logged for every PPL request, with
pivot literals and options masked. Previously the visitor fell through
to visitChildren and the entire xyseries clause was silently dropped
from log output.

Also flip the xyseries entry in docs/user/ppl/index.md from stable to
experimental (since 3.8), matching how other newly-introduced commands
are listed.

Signed-off-by: Peng Huo <penghuo@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Possible Issue

The anonymizer always outputs 'in (***)' even when the xyseries command has no pivot values specified. If the xyseries syntax allows omitting the 'in' clause or having an empty list, this will produce incorrect anonymized output that doesn't match the original query structure.

command.append(" in (").append(MASK_LITERAL).append(")");

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Define magic string as constant

The hardcoded separator check ": " appears to be a magic value without context. If
this is the default separator value, consider defining it as a constant for better
maintainability and clarity. This makes the code more self-documenting and easier to
update if the default changes.

ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java [833-835]

-if (node.getSeparator() != null && !": ".equals(node.getSeparator())) {
+private static final String DEFAULT_SEPARATOR = ": ";
+...
+if (node.getSeparator() != null && !DEFAULT_SEPARATOR.equals(node.getSeparator())) {
   command.append(" sep=").append(MASK_LITERAL);
 }
Suggestion importance[1-10]: 4

__

Why: While defining ": " as a constant would improve code maintainability and readability, this is a minor improvement that doesn't address any functional issue or bug. The magic string is only used once in this context.

Low

@penghuo
penghuo merged commit 2b329a7 into opensearch-project:main Jul 22, 2026
43 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants