Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

[PPL] Support index name with date suffix #983

Conversation

dai-chen
Copy link
Member

@dai-chen dai-chen commented Jan 11, 2021

Issue #, if available: #980

Description of changes:

  1. Support index name with date suffix separated by dash or dot: Add an alternative for index name rule to avoid change on qualified name and thus impact on other identifiers, such as alias and field name.
  2. Disable nested field rule in grammar: because it is not supported in core engine.

With the first change, the following index names are supported now. Please find more details in user manual doc below.

  1. Date suffix: filebeat-2020.01.11
  2. Multi date suffix separated by dash: filebeat-7.10-2020.01.11
  3. Wildcard: filebeat-2020.* or filebeat-2020.*.11

Documentation: Add a new paragraph for this support for index name only. https://github.com/dai-chen/sql/blob/support-index-name-with-dots-in-ppl/docs/experiment/ppl/general/identifiers.rst#description

Testing: All old UT/IT passed. Add new UT/IT to verify different index names.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dai-chen dai-chen self-assigned this Jan 11, 2021
@dai-chen dai-chen added enhancement New feature or request PPL labels Jan 11, 2021
@codecov
Copy link

codecov bot commented Jan 11, 2021

Codecov Report

Merging #983 (47eb262) into develop (6650a10) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #983      +/-   ##
=============================================
- Coverage      99.87%   99.87%   -0.01%     
- Complexity      2381     2383       +2     
=============================================
  Files            234      234              
  Lines           5477     5470       -7     
  Branches         357      357              
=============================================
- Hits            5470     5463       -7     
  Misses             5        5              
  Partials           2        2              
Impacted Files Coverage Δ Complexity Δ
...troforelasticsearch/sql/ppl/parser/AstBuilder.java 100.00% <100.00%> (ø) 33.00 <1.00> (ø)
...ticsearch/sql/ppl/parser/AstExpressionBuilder.java 100.00% <100.00%> (ø) 28.00 <4.00> (+2.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6650a10...47eb262. Read the comment docs.

@dai-chen dai-chen marked this pull request as ready for review January 12, 2021 04:32
Copy link
Member

@chloe-zh chloe-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the changes!

Copy link
Contributor

@penghuo penghuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change.

@dai-chen dai-chen merged commit d82fb35 into opendistro-for-elasticsearch:develop Jan 12, 2021
@dai-chen dai-chen deleted the support-index-name-with-dots-in-ppl branch January 12, 2021 18:32
dai-chen added a commit that referenced this pull request Jan 12, 2021
* Change grammar and UT

* Add more UT and IT

* Support wildcard in index name with dots

* Update doc with wildcard case

* Add assertion for IT

* Disable nested field in PPL grammar

* Remove commented out code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request PPL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants