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

[Data Explorer] Adding PPL to query language selector #5623

Closed

Conversation

abbyhu2000
Copy link
Member

Description

A quick solution for adding navigation from data explorer page to log explorer page by adding the option of choosing PPL in the query language selector in the top nav bar.

Issues Resolved

resolves part of #5504

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@abbyhu2000 abbyhu2000 added the data explorer Issues related to the Data Explorer project label Dec 15, 2023
@abbyhu2000 abbyhu2000 marked this pull request as ready for review December 15, 2023 20:03
@abbyhu2000 abbyhu2000 changed the title Query selector new Adding PPL to query language selector Dec 15, 2023
@abbyhu2000 abbyhu2000 changed the title Adding PPL to query language selector [Data Explorer] Adding PPL to query language selector Dec 15, 2023
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (6710ec3) 67.02% compared to head (e590676) 67.01%.
Report is 8 commits behind head on main.

Files Patch % Lines
...public/ui/query_string_input/language_switcher.tsx 40.00% 14 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5623      +/-   ##
==========================================
- Coverage   67.02%   67.01%   -0.02%     
==========================================
  Files        3294     3294              
  Lines       63309    63328      +19     
  Branches    10071    10076       +5     
==========================================
+ Hits        42435    42440       +5     
- Misses      18430    18442      +12     
- Partials     2444     2446       +2     
Flag Coverage Δ
Linux_1 35.24% <ø> (ø)
Linux_2 55.19% <ø> (ø)
Linux_3 43.86% <40.00%> (-0.02%) ⬇️
Linux_4 35.34% <ø> (ø)
Windows_1 35.26% <ø> (ø)
Windows_2 55.15% <ø> (ø)
Windows_3 43.88% <40.00%> (-0.01%) ⬇️
Windows_4 35.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Can we make this a lot simpler? Like all we want is a simple if condition where the existing pop over is placed to be replaced with a new popp er with the new options if the current app is data explorer and observability APIs are available. Feel like the whole change should be contained in just a single file that we can remove when this hard coded logic isn't needed.

Also add a to-do with an issue that call out that this is a temporary solution and needs to be removed ASAP and add the issue URL to the code comment

src/plugins/data/public/types.ts Outdated Show resolved Hide resolved
@abbyhu2000
Copy link
Member Author

Created a follow-up issue for this: #5628

@abbyhu2000 abbyhu2000 force-pushed the query_selector_new branch 2 times, most recently from d42e7a1 to aaa775e Compare December 20, 2023 22:38
const { application } = opensearchDashboards.services;
const currentApp$ = application?.currentAppId$;
let useNewQuerySelector;
application?.applications$.subscribe((applications) => {
Copy link
Member

Choose a reason for hiding this comment

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

This subscribe should be wrapped inside a useEffect I suppose?

Copy link
Member

Choose a reason for hiding this comment

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

+1

});
});

const dataExplorerOptions = [
Copy link
Member

@SuZhou-Joe SuZhou-Joe Dec 21, 2023

Choose a reason for hiding this comment

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

Can we add an enum for these language options like

enum ENUM_LANGUAGES { DQL = "DQL" }

? And I suggest adding an id field inside options though under context of language, label no need to wrapped by i18n.

Copy link
Member

Choose a reason for hiding this comment

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

We will still need i18n since its purpose is to individually identify the language name. e.g. data.query.queryBar.dqlLanguageName

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Just 2 minor changes, the rest of the code looks good to me :)

@abbyhu2000
Copy link
Member Author

Taking off the 2.12 tag since the team decided to leave this out of 2.12 release.

kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Feb 15, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Mar 12, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@abbyhu2000
Copy link
Member Author

Close this PR since we want to build a more unified experience for query language.

@abbyhu2000 abbyhu2000 closed this Mar 14, 2024
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Mar 22, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Mar 25, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Apr 18, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Apr 22, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Working query enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Reget search enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

data frames

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

temp state need to pass df

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

sending data frame

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

gets df type

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add some small ui things

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

move back query language switcher

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

updating side panel

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add ui config on query enhancement

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

support query string input

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update to say search bar

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update ppl to call once

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update when fields update

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add unknown

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Apr 22, 2024
Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Working query enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Reget search enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

data frames

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

temp state need to pass df

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

sending data frame

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

gets df type

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add some small ui things

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

move back query language switcher

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

updating side panel

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add ui config on query enhancement

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

support query string input

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update to say search bar

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update ppl to call once

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update when fields update

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add unknown

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
ananzh pushed a commit that referenced this pull request Apr 22, 2024
* [MQL] support different query languages

Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Working query enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Reget search enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

data frames

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

temp state need to pass df

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

sending data frame

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

gets df type

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add some small ui things

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

move back query language switcher

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

updating side panel

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add ui config on query enhancement

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

support query string input

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update to say search bar

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update ppl to call once

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update when fields update

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add unknown

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* clean up

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* more clean up

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* clean up licenses

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Apr 23, 2024
* [MQL] support different query languages

Only adds the quick startup for OpenSearch cluster with a SQL
plugin and observability with:
```
yarn opensearch snapshot --sql
```

Also, adds SQL to the language selector stolen shamelessly from
opensearch-project#5623

Next steps to intercept and send to SQL API or just transform basic
syntax to DSL

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Working query enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Reget search enhance

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

data frames

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

temp state need to pass df

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

sending data frame

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

gets df type

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add some small ui things

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

move back query language switcher

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

updating side panel

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add ui config on query enhancement

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

support query string input

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update to say search bar

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update ppl to call once

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

update when fields update

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

add unknown

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* clean up

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* more clean up

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* clean up licenses

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Cleanup unused helper function

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

create index pattern somewhat working

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data explorer Issues related to the Data Explorer project distinguished-contributor v2.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants