Skip to content

Commit

Permalink
Replace the remaining references to SQL with ES|QL (#165426)
Browse files Browse the repository at this point in the history
## Summary

This PR updates the remaining references to SQL with ES|QL in Discover
and Unified Histogram.

Co-authored-by: Stratoula Kalafateli <[email protected]>
  • Loading branch information
davismcphee and stratoula authored Sep 1, 2023
1 parent d6b65c4 commit a2d9f7f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/plugins/discover/public/__mocks__/saved_search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export const savedSearchMockWithTimeFieldNew = {
} as unknown as SavedSearch;

export const savedSearchMockWithESQL = {
id: 'the-saved-search-id-sql',
id: 'the-saved-search-id-esql',
searchSource: createSearchSourceMock({
index: dataViewWithTimefieldMock,
query: { esql: 'FROM "the-saved-search-id-sql"' },
query: { esql: 'FROM "the-saved-search-id-esql"' },
}),
} as unknown as SavedSearch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ storiesOf('components/layout/DiscoverLayout', module).add(
);

storiesOf('components/layout/DiscoverLayout', module).add(
'SQL view',
'ES|QL view',
withDiscoverServices(() => {
const props = getPlainRecordLayoutProps(getDataViewMock(false));
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const getPlainRecordLayoutProps = (dataView: DataView) => {
columns: ['name', 'message', 'bytes'],
sort: [['date', 'desc']],
query: {
sql: 'SELECT * FROM "kibana_sample_data_ecommerce"',
esql: 'FROM "kibana_sample_data_ecommerce"',
},
filters: [],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ describe('discover responsive sidebar', function () {
expect(findTestSubject(comp, 'dataView-add-field_btn').length).toBe(1);
});

it('should render correctly in the sql mode', async () => {
it('should render correctly in the ES|QL mode', async () => {
const propsWithTextBasedMode = {
...props,
columns: ['extension', 'bytes'],
Expand All @@ -514,7 +514,7 @@ describe('discover responsive sidebar', function () {
}) as DataDocuments$,
};
const compInTextBasedMode = await mountComponent(propsWithTextBasedMode, {
query: { sql: 'SELECT * FROM `index`' },
query: { esql: 'FROM `index`' },
});

await act(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test('getTopNavLinks result', () => {
`);
});

test('getTopNavLinks result for sql mode', () => {
test('getTopNavLinks result for ES|QL mode', () => {
const topNavLinks = getTopNavLinks({
dataView: dataViewMock,
onOpenInspector: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export enum RecordRawType {
*/
DOCUMENT = 'document',
/**
* Data returned e.g. SQL queries, flat structure
* Data returned e.g. ES|QL queries, flat structure
* */
PLAIN = 'plain',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ describe('Test discover state actions', () => {
);
});

test('loadSavedSearch without id containing sql, adding no warning toast with an invalid index', async () => {
const url = "/#?_a=(index:abcde,query:(sql:'Select * from test'))&_g=()";
test('loadSavedSearch without id containing ES|QL, adding no warning toast with an invalid index', async () => {
const url = "/#?_a=(index:abcde,query:(esql:'FROM test'))&_g=()";
const { state } = await getState(url, { savedSearch: savedSearchMock, isEmptyUrl: false });
await state.actions.loadSavedSearch();
expect(discoverServiceMock.toastNotifications.addWarning).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('Discover flyout', function () {

it('should not render single/surrounding views for text based', async () => {
const { component } = await mountComponent({
query: { sql: 'Select * from indexpattern' },
query: { esql: 'FROM indexpattern' },
});
const singleDocumentView = findTestSubject(component, 'docTableRowAction');
expect(singleDocumentView.length).toBeFalsy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('useStateProps', () => {
`);
});

it('should return the correct props when an SQL query is used', () => {
it('should return the correct props when an ES|QL query is used', () => {
const stateService = getStateService({ initialState });
const { result } = renderHook(() =>
useStateProps({
Expand Down

0 comments on commit a2d9f7f

Please sign in to comment.