Skip to content

ES|QL Views#134995

Merged
craigtaverner merged 31 commits intoelastic:mainfrom
craigtaverner:views_prototype
Jan 29, 2026
Merged

ES|QL Views#134995
craigtaverner merged 31 commits intoelastic:mainfrom
craigtaverner:views_prototype

Conversation

@craigtaverner
Copy link
Contributor

@craigtaverner craigtaverner commented Sep 18, 2025

Initial support for ES|QL Views. It is based on the underlying sub-query support added in ..., and builds on the Views REST API work done in #137818.

Checklist:

  • Core prototype
    • Extract key parts of Nik's original prototype
    • Write testing infrastructure to test views within csv-spec tests (single and multi-node tests)
    • Expand REST API to cover get, list, create/update, delete views
    • Add size and count limitations to stored view definitions
    • Write testing infrastructure to test views in CsvTest (csv-spec unit testing)
    • Expand scope to nested views
    • Expand scope to multiple views and views+indexes
  • Split into multiple PRs for easy review
  • Enhancements
    • Prototype CCS and CPS
    • Enforce view/index name uniqueness (done in separate PR)
    • Add serialization tests to test source deserialization in re-written plans
    • Ensure views are gated behind SNAPSHOT and/or feature flag
    • Increate test coverage at least to the same extent as sub-queries
    • Control and/or restrict nesting/branching depth/width
@craigtaverner craigtaverner added >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL Feature:ES|QL labels Sep 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @craigtaverner, I've created a changelog YAML for you.

@craigtaverner craigtaverner force-pushed the views_prototype branch 2 times, most recently from f4adfab to 28c0641 Compare September 18, 2025 13:54
@craigtaverner craigtaverner force-pushed the views_prototype branch 10 times, most recently from f645590 to 7a59a68 Compare September 26, 2025 10:30
@craigtaverner craigtaverner force-pushed the views_prototype branch 2 times, most recently from dbe379c to c7eb252 Compare October 1, 2025 17:05
@craigtaverner craigtaverner force-pushed the views_prototype branch 2 times, most recently from 10c5744 to 9e81ef7 Compare October 2, 2025 12:24
@craigtaverner craigtaverner force-pushed the views_prototype branch 4 times, most recently from b716097 to dc8d921 Compare October 17, 2025 18:36
* @return A warnings collector object
*/
// TODO: rename to createWarningsTreatedAsNull
public static Warnings createWarnings(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a good paradigm. It caused a 400 file change. How about we provide a createWarnings that takes source in? Then the next time you need to pass something from the source it is a one file change and not 400 file change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@julian-elastic julian-elastic left a comment

Choose a reason for hiding this comment

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

Overall, still looks good with the latest changes. However, I would recommend fixing tech debt where passing something from source to warnings requires 400+ files change.

@craigtaverner craigtaverner added the test-release Trigger CI checks against release build label Jan 27, 2026
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_VIEWS_COUNT_SETTING, (i) -> this.maxViewsCount = i);
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_VIEW_LENGTH_SETTING, (i) -> this.maxViewLength = i);
clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_VIEW_DEPTH_SETTING, (i) -> this.maxViewDepth = i);
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT:
Instead of

 this.something = SETTING.get(settings);
clusterService.getClusterSettings().addSettingsUpdateConsumer(SETTING, (i) -> this.something = i);

please use

clusterService.getClusterSettings().initializeAndWatch(SETTING, v -> this.something = v);

that takes care about both initialization and keeping the value updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I did this and simplified my use of settings in general.

@craigtaverner craigtaverner merged commit 4e0cf9c into elastic:main Jan 29, 2026
37 checks passed
@elasticsearchmachine
Copy link
Collaborator

@craigtaverner according to this PR's labels, I need to update the changelog YAML, but I can't because the PR is closed. Please either update the changelog yourself on the appropriate branch, or adjust the labels. Specifically:

  • The PR is not labelled release highlight but the changelog has a highlight section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL Feature:ES|QL >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-release Trigger CI checks against release build v9.4.0

5 participants