Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataViews] Make use of DataViewLazy in DataViews API #176426

Closed
Tracked by #167595
kertal opened this issue Feb 7, 2024 · 1 comment · Fixed by #173948
Closed
Tracked by #167595

[DataViews] Make use of DataViewLazy in DataViews API #176426

kertal opened this issue Feb 7, 2024 · 1 comment · Fixed by #173948
Assignees
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@kertal
Copy link
Member

kertal commented Feb 7, 2024

Use DataViewLazy in DataViews REST APIs

Very simple initial use case for DataViewLazy. There won't be any performance improvements since the APIs almost entirely report the entire field list.

@kertal kertal added the Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. label Feb 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal kertal added the Feature:Data Views Data Views code and UI - index patterns before 8.0 label Feb 7, 2024
@kertal kertal added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Feb 15, 2024
mattkime added a commit that referenced this issue Apr 3, 2024
## Summary

Part 1 of #178594

Initial implementation of DataViewLazy class - an alternative DataView
implementation that doesn't load the full field list on initial
creation.

```
Implements DataViewLazy (variations from DataView class)
- getFields ({ mapped = true, scripted = true, runtime = true, fieldName, forceRefresh = false, unmapped, indexFilter, metaFields = true }) => 
    Promise<{ getFieldMap: () => Record<string, DataViewField>; getFieldMapSorted: () => Record<string, DataViewField> }>
- getRuntimeFields({ fieldName = ['*'] }) => Record<string, DataViewField>
- getScriptedFields({ fieldName = ['*'] }) => Record<string, DataViewField>
- getFieldByName (string) => Promise<DataViewField>
- toSpec (same params as getFields) => Promise<DataViewSpec>

other notable changes using DataViewLazy over DataView
- won't throw if index pattern fails to match
- by default toSpec doesn't return fields, must pass in parameters for requested fields

---

DataViews service additions
- toDataView: (toDataView: DataViewLazy) => Promise<DataView>;
- toDataViewLazy: (dataView: DataView) => Promise<DataViewLazy>;
- getAllDataViewLazy: () => Promise<DataViewLazy[]>;
- getDataViewLazy: (id: string) => Promise<DataViewLazy>;
- createDataViewLazy: (spec: DataViewSpec) => Promise<DataViewLazy>;
- createAndSaveDataViewLazy: (spec: DataViewSpec, override?: boolean) => Promise<DataViewLazy>;
- getDefaultDataViewLazy: () => Promise<DataViewLazy | null>;
```

Closes #176426 and
#167750

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants