-
Notifications
You must be signed in to change notification settings - Fork 898
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
Indexed views framework #8851
Indexed views framework #8851
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8851 +/- ##
==========================================
- Coverage 60.90% 56.39% -4.52%
==========================================
Files 3800 1239 -2561
Lines 90845 25913 -64932
Branches 14316 4437 -9879
==========================================
- Hits 55331 14613 -40718
+ Misses 31994 10559 -21435
+ Partials 3520 741 -2779
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callout that there are multiple ci items failing - please take a look (looks like lint and snapshot tests, and patch coverage). Also, given patch coverage % and the fact that this is a framework for adding additional functionality, would expect unit test coverage to be higher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this incorporate all feedback addressed in #8818?
Can you point out the major new changes from previous PRs?
/** Optional reference to the source dataset. Example usage is for indexed views to store the | ||
* reference to the table dataset | ||
*/ | ||
ref?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we name this something less generic?
@kavilla Is this the right place for this? Isn't the source an attribute of the index that was created? Would expect that to be part of DataSource definition I guess, although if this is a two-way door seems fine for now (I think it would be as not having source in the right place wouldn't impact functionality for saved query/recent dataset?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a good point. for example we do store the session id wtih the meta info about the data source since it's the data source that decides that where as the data source would also include the index that is pointing to. originally i think we though it should go in the data source meta but didn't have too much of hard buy in on the data source. but reflecting it makes more sense there.
agreeed as well this is a two way door. as i believe we can still be able to query the info i think the ref now is used for ui purposes (for now) but def will need to update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create an issue to track the rename and move?
} | ||
)} | ||
</EuiFormLabel> } | ||
onChange={(e) => setSelectIndexedView(e.target.checked)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't @riysaxen-amzn add tests for a bunch of these? Looks like they're all here, but not sure why coverage report looks different
src/plugins/discover/public/application/view_components/canvas/index.tsx
Outdated
Show resolved
Hide resolved
...public/application/view_components/canvas/query_result_extensions/query_result_extension.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt get a chance to review the configurator changes but had a look at the rest. Added my comments below. I agree with Viraj, can we add unit tests for the new code introduced?
src/plugins/data/public/query/query_string/dataset_service/types.ts
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/query_results_service/index.ts
Outdated
Show resolved
Hide resolved
src/plugins/vis_builder/public/application/components/data_tab/field_selector.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/query_results_service/query_result_service.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: Amardeepsingh Siglani <[email protected]>
488dd43
to
502cdab
Compare
/** Optional reference to the source dataset. Example usage is for indexed views to store the | ||
* reference to the table dataset | ||
*/ | ||
sourceDatasetRef?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
where you able to comment on @virajsanghvi previous feedback?
def could be follow up but just some insight url length is limited:
- Application and global state are stored in URL parameters
- Although we're far from URL length limits, field name length matters
- Should follow existing naming conventions (e.g. 'timeFieldName' from index patterns)
- Consider shorter property names when possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested this name - ideally we aren't coupling our interfaces to urls so they aren't impacted by url limits.
Do you have a suggested name that accurately reflects what this is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a suggested name that accurately reflects what this is?
nope :). i didn't have a good suggestion and was being pedantic and something to keep track of.
src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we resolve @kavilla's concern around the connected data source?
src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx
Show resolved
Hide resolved
/** Optional reference to the source dataset. Example usage is for indexed views to store the | ||
* reference to the table dataset | ||
*/ | ||
sourceDatasetRef?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested this name - ideally we aren't coupling our interfaces to urls so they aren't impacted by url limits.
Do you have a suggested name that accurately reflects what this is?
Signed-off-by: Amardeepsingh Siglani <[email protected]>
@@ -141,7 +141,7 @@ | |||
} | |||
|
|||
.osdQueryEditor__bottomPanel { | |||
margin: 5px 0; | |||
margin: $euiSizeXS 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a call out - this isn't equivalent to 5px
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it from here and yes 4px would also be fine in this case
Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: Amardeepsingh Siglani <[email protected]>
return dataset; | ||
} | ||
|
||
let connectedDataSource; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be a fast follow but i think the indexed view service could handle fetching the datasource and creating and returning an indexed view vs the configurator doing this work
/** | ||
* Currently set Query | ||
*/ | ||
query: Query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what are we using this for? if it's for accessing the current query since it's with the same component it should already have access to the same query. therefore we could just access this query directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to access the dataset on the query, passed in query to be future safe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving assuming ci passes
Signed-off-by: Amardeepsingh Siglani <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restarted failing ci, did pass on linux so assuming it'll pass on windows
Skipping CI group 10 since the failed test case seems to be flakey. The rest of the tests in the suite pass queries.spec.js.mp4 |
* indexed-view-working Signed-off-by: Amardeepsingh Siglani <[email protected]> * working skeleton Signed-off-by: Amardeepsingh Siglani <[email protected]> * Changeset file for PR opensearch-project#8851 created/updated * removed unwanted changes Signed-off-by: Amardeepsingh Siglani <[email protected]> * fixed linter errors; failing UT Signed-off-by: Amardeepsingh Siglani <[email protected]> * added some UTs Signed-off-by: Amardeepsingh Siglani <[email protected]> * added more UTs Signed-off-by: Amardeepsingh Siglani <[email protected]> * refactored code to address comments Signed-off-by: Amardeepsingh Siglani <[email protected]> * minor updates Signed-off-by: Amardeepsingh Siglani <[email protected]> * minor updates Signed-off-by: Amardeepsingh Siglani <[email protected]> * updated tests Signed-off-by: Amardeepsingh Siglani <[email protected]> * fixed UT Signed-off-by: Amardeepsingh Siglani <[email protected]> --------- Signed-off-by: Amardeepsingh Siglani <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
In this PR we add support for
Issues Resolved
New feature
Screenshot
Note: Below screenshots were produced by making changes to the S3 type config for testing and are not part of this PR since this PR is only adding the framework.
Testing the changes
Set up workspace with query enhancements enabled
Changelog
Check List
yarn test:jest
yarn test:jest_integration