-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Bump OUI to 1.8.0 (#7363) (cherry picked from commit c1bae75) * [Auto Suggest] OpenSearch SQL autosuggest with ANTLR (#7336) * cherry pick * SQL keyword suggestion * column and values suggestions * adjust values suggestions and ignored token * suggestion type casting * ignore functions * case insensitive * change to use grammar for insensitive case * fix multi-line issue * code cleanup * move ppl out of scope * rename folder and add ignoring rules * resolve type issue * fix ppl suggestion provider issue * remove function suggestion * some code clean up and adding tests * cursor tests * remove testing setup * add changelog * update yarn file * add missing testing library * MDS integration * minor interface change and disable word based suggestion * update ID_LITERAL and recompile grammar * column suggest for agg function * revert version * opensearch sql syntax highlighting * add utility tests * symbol table test * error listener test * parse test * add suggestion provider to single line query editor * remove one test * add connection service type --------- (cherry picked from commit 9348bd4) * Move TopNavLinks to new Nav Bar Discover (#7326) This PR aims to introduce a new Nav bar in Discover that would contain the Date Picker as well as the Navigation links that are currently part of headers. The Navigation Links have been replaced with the corresponding Icons to provide a modern UX. These setting are currently controlled by query:enhancements:enabled Advanced Setting Flag and would be visible when the above flag is turned on. (cherry picked from commit e46e54a) * [navigation-next]fix: breadcrumb issue found in data source management and other similar cases. (#7401) * feat: add scoped breadcrumbs * Changeset file for PR #7401 created/updated * feat: move data source management register logic up a little bit * feat: add unit test * feat: revert the home related change * fix: overview error in all use case when workspace is enabled * fix: update snapshot * Changeset file for PR #7401 created/updated * fix: hide nav groups that should be displayed * feat: hide expand icon in left navigation * feat: update --------- (cherry picked from commit 3f78c94) * [Bug][Data Source] Move data source manageable feature flag to DSM plugin (#7440) * Move data source manageable feature flag to DSM plugin * Changeset file for PR #7440 created/updated --------- (cherry picked from commit dfcd2e1) * [Discover-next] data set picker (#7426) * update using query manager * aggs not working * almost there * stablish * thanks ashwin * update ref name * fix timefields * clean up some console logs * go safer route of setting language * its working again * fix names * restore code editor and indices * sql df * fix external datasources again --------- (cherry picked from commit 6a079d3) * Fix add filter for numeric scripted field (#7022) * Fix add filter for scripted field * add unit test * change from nested ternary to if else * add more unit tests * change unit tests * fix typo --------- (cherry picked from commit 7c1f8fc) * [Bug][Workspace] Add permission validation at workspace detail page (#7435) * [Bug][Workspace] Add permission validate at workspace detail page * Changeset file for PR #7435 created/updated --------- (cherry picked from commit 45d34b5) * Revert "[Discover-next] data set picker (#7426)" (#7479) This reverts commit 6a079d3. --------- (cherry picked from commit 0515fb2) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Miki <miki@amazon.com> Co-authored-by: Eric Wei <menwe@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: yuboluo <yubonluo@amazon.com> Co-authored-by: Kawika Avilla <kavilla414@gmail.com> Co-authored-by: Qingyang(Abby) Hu <abigailhu2000@gmail.com> Co-authored-by: Sean Li <lnse@amazon.com>
- Loading branch information
1 parent
95b2ef6
commit 975d670
Showing
76 changed files
with
44,032 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- [Auto Suggest] OpenSearch SQL autosuggest with ANTLR ([#7336](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7336)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Bump OUI to 1.8.0 ([#7363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7363)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 157 additions & 0 deletions
157
packages/osd-monaco/src/xjson/lexer_rules/opensearchsql.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { monaco } from '../../monaco'; | ||
|
||
export const ID = 'SQL'; | ||
|
||
const keywords = [ | ||
'ALL', | ||
'AND', | ||
'AS', | ||
'ASC', | ||
'BOOLEAN', | ||
'BETWEEN', | ||
'BY', | ||
'CASE', | ||
'CAST', | ||
'CROSS', | ||
'COLUMNS', | ||
'DATETIME', | ||
'DELETE', | ||
'DESC', | ||
'DESCRIBE', | ||
'DISTINCT', | ||
'DOUBLE', | ||
'ELSE', | ||
'EXISTS', | ||
'FALSE', | ||
'FLOAT', | ||
'FIRST', | ||
'FROM', | ||
'GROUP', | ||
'HAVING', | ||
'IN', | ||
'INNER', | ||
'INT', | ||
'INTEGER', | ||
'IS', | ||
'JOIN', | ||
'LAST', | ||
'LEFT', | ||
'LIKE', | ||
'LIMIT', | ||
'LONG', | ||
'MATCH', | ||
'NATURAL', | ||
'NOT', | ||
'NULL', | ||
'NULLS', | ||
'ON', | ||
'OR', | ||
'ORDER', | ||
'OUTER', | ||
'OVER', | ||
'PARTITION', | ||
'REGEXP', | ||
'RIGHT', | ||
'SELECT', | ||
'SHOW', | ||
'STRING', | ||
'THEN', | ||
'TRUE', | ||
'UNION', | ||
'USING', | ||
'WHEN', | ||
'WHERE', | ||
'EXCEPT', | ||
]; | ||
|
||
const functions = [ | ||
'AVG', | ||
'COUNT', | ||
'MAX', | ||
'MIN', | ||
'SUM', | ||
'VAR_POP', | ||
'VAR_SAMP', | ||
'VARIANCE', | ||
'STD', | ||
'STDDEV', | ||
'STDDEV_POP', | ||
'STDDEV_SAMP', | ||
'SUBSTRING', | ||
'TRIM', | ||
]; | ||
|
||
const operators = [ | ||
'=', | ||
'>', | ||
'<', | ||
'!', | ||
'~', | ||
'\\|', | ||
'&', | ||
'\\^', | ||
'\\*', | ||
'/', | ||
'%', | ||
'\\+', | ||
'-', | ||
'DIV', | ||
'MOD', | ||
]; | ||
|
||
const brackets = [ | ||
{ open: '(', close: ')', token: 'delimiter.parenthesis' }, | ||
{ open: '[', close: ']', token: 'delimiter.square' }, | ||
]; | ||
|
||
export const lexerRules = { | ||
defaultToken: 'invalid', | ||
ignoreCase: true, | ||
tokenPostfix: '', | ||
keywords, | ||
functions, | ||
operators, | ||
brackets, | ||
tokenizer: { | ||
root: [ | ||
[ | ||
/[a-zA-Z_$][a-zA-Z0-9_$]*/, | ||
{ | ||
cases: { | ||
'@keywords': 'keyword', | ||
'@functions': 'function', | ||
'@default': 'identifier', | ||
}, | ||
}, | ||
], | ||
{ include: '@whitespace' }, | ||
[/[()]/, '@brackets'], | ||
[new RegExp(operators.join('|')), 'operator'], | ||
[/[0-9]+(\.[0-9]+)?/, 'number'], | ||
[/'([^'\\]|\\.)*$/, 'string.invalid'], // non-terminated string | ||
[/'/, 'string', '@string'], | ||
[/"/, 'string', '@string'], | ||
], | ||
whitespace: [ | ||
[/[ \t\r\n]+/, 'white'], | ||
[/\/\*/, 'comment', '@comment'], | ||
[/--.*$/, 'comment'], | ||
], | ||
string: [ | ||
[/[^'\\]+/, 'string'], | ||
[/\\./, 'string.escape'], | ||
[/'/, 'string', '@pop'], | ||
[/"/, 'string', '@pop'], | ||
], | ||
comment: [ | ||
[/[^/*]+/, 'comment'], | ||
[/\*\//, 'comment', '@pop'], | ||
[/[\/*]/, 'comment'], | ||
], | ||
}, | ||
} as monaco.languages.IMonarchLanguage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.