diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index 148742c2ae046f..13b346794f7b42 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -54,7 +54,7 @@ const STORYBOOKS = [ 'language_documentation_popover', 'unified_search', 'random_sampling', - 'text_based_editor', + 'esql_editor', ]; const GITHUB_CONTEXT = 'Build and Publish Storybooks'; diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ee4aac2503b9b1..307cecba446510 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -429,6 +429,7 @@ src/plugins/esql @elastic/kibana-esql packages/kbn-esql-ast @elastic/kibana-esql examples/esql_ast_inspector @elastic/kibana-esql src/plugins/esql_datagrid @elastic/kibana-esql +packages/kbn-esql-editor @elastic/kibana-esql packages/kbn-esql-utils @elastic/kibana-esql packages/kbn-esql-validation-autocomplete @elastic/kibana-esql examples/esql_validation_example @elastic/kibana-esql @@ -919,7 +920,6 @@ test x-pack/test x-pack/performance @elastic/appex-qa x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations -packages/kbn-text-based-editor @elastic/kibana-esql x-pack/examples/third_party_lens_navigation_prompt @elastic/kibana-visualizations x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations diff --git a/.i18nrc.json b/.i18nrc.json index 9dcba18d2dba36..e9500448b9a09f 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -98,7 +98,7 @@ "presentationUtil": "src/plugins/presentation_util", "randomSampling": "x-pack/packages/kbn-random-sampling", "reactPackages": "packages/react", - "textBasedEditor": "packages/kbn-text-based-editor", + "esqlEditor": "packages/kbn-esql-editor", "esqlUtils": "packages/kbn-esql-utils", "reporting": "packages/kbn-reporting", "savedObjects": "src/plugins/saved_objects", diff --git a/package.json b/package.json index 5dabc8310644fa..ea24d9016a81cb 100644 --- a/package.json +++ b/package.json @@ -483,6 +483,7 @@ "@kbn/esql-ast": "link:packages/kbn-esql-ast", "@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector", "@kbn/esql-datagrid": "link:src/plugins/esql_datagrid", + "@kbn/esql-editor": "link:packages/kbn-esql-editor", "@kbn/esql-utils": "link:packages/kbn-esql-utils", "@kbn/esql-validation-autocomplete": "link:packages/kbn-esql-validation-autocomplete", "@kbn/esql-validation-example-plugin": "link:examples/esql_validation_example", @@ -919,7 +920,6 @@ "@kbn/telemetry-test-plugin": "link:test/plugin_functional/plugins/telemetry", "@kbn/test-feature-usage-plugin": "link:x-pack/test/licensing_plugin/plugins/test_feature_usage", "@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens", - "@kbn/text-based-editor": "link:packages/kbn-text-based-editor", "@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt", "@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example", "@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence", diff --git a/packages/kbn-text-based-editor/.storybook/main.js b/packages/kbn-esql-editor/.storybook/main.js similarity index 100% rename from packages/kbn-text-based-editor/.storybook/main.js rename to packages/kbn-esql-editor/.storybook/main.js diff --git a/packages/kbn-text-based-editor/.storybook/preview.js b/packages/kbn-esql-editor/.storybook/preview.js similarity index 100% rename from packages/kbn-text-based-editor/.storybook/preview.js rename to packages/kbn-esql-editor/.storybook/preview.js diff --git a/packages/kbn-text-based-editor/README.md b/packages/kbn-esql-editor/README.md similarity index 92% rename from packages/kbn-text-based-editor/README.md rename to packages/kbn-esql-editor/README.md index ae7846a58d2071..f36b3388160a69 100644 --- a/packages/kbn-text-based-editor/README.md +++ b/packages/kbn-esql-editor/README.md @@ -1,8 +1,7 @@ -# @kbn/text-based-editor +# @kbn/esql-editor Contains the editor for text based languages. Specifically for: - ESQL, with autocomplete and syntax highlighting - - SQL, with syntax highlighting --- @@ -10,7 +9,7 @@ Contains the ESQL editor with the autocomplete and the autosuggest functionality The antlr code can be found in packages/kbn-monaco/src/esql A **monaco** based editor that is part of the unified search experience. It is rendered for all the applications that support text-based languages. -In order to enable text based languages on your unified search bar add `textBasedLanguages: ['SQL', 'ESQL', '...']` to the dataViewPicker properties. +In order to enable text based languages on your unified search bar add `textBasedLanguages: ['ESQL', '...']` to the dataViewPicker properties. ## Languages supported diff --git a/packages/kbn-text-based-editor/index.ts b/packages/kbn-esql-editor/index.ts similarity index 76% rename from packages/kbn-text-based-editor/index.ts rename to packages/kbn-esql-editor/index.ts index 6366240e5fda3e..39367eaecda589 100644 --- a/packages/kbn-text-based-editor/index.ts +++ b/packages/kbn-esql-editor/index.ts @@ -7,10 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export type { TextBasedLanguagesEditorProps } from './src/types'; +export type { ESQLEditorProps } from './src/types'; export { fetchFieldsFromESQL } from './src/fetch_fields_from_esql'; -import { TextBasedLanguagesEditor } from './src/text_based_languages_editor'; +import { ESQLEditor } from './src/esql_editor'; // React.lazy support // eslint-disable-next-line import/no-default-export -export default TextBasedLanguagesEditor; +export default ESQLEditor; diff --git a/packages/kbn-text-based-editor/jest.config.js b/packages/kbn-esql-editor/jest.config.js similarity index 79% rename from packages/kbn-text-based-editor/jest.config.js rename to packages/kbn-esql-editor/jest.config.js index 971a573bba7073..303950b3716826 100644 --- a/packages/kbn-text-based-editor/jest.config.js +++ b/packages/kbn-esql-editor/jest.config.js @@ -10,6 +10,6 @@ module.exports = { preset: '@kbn/test', rootDir: '../..', - roots: ['/packages/kbn-text-based-editor'], - setupFilesAfterEnv: ['/packages/kbn-text-based-editor/setup_tests.ts'], + roots: ['/packages/kbn-esql-editor'], + setupFilesAfterEnv: ['/packages/kbn-esql-editor/setup_tests.ts'], }; diff --git a/packages/kbn-text-based-editor/kibana.jsonc b/packages/kbn-esql-editor/kibana.jsonc similarity index 66% rename from packages/kbn-text-based-editor/kibana.jsonc rename to packages/kbn-esql-editor/kibana.jsonc index 1046c18b094e71..005fdb2e6e3580 100644 --- a/packages/kbn-text-based-editor/kibana.jsonc +++ b/packages/kbn-esql-editor/kibana.jsonc @@ -1,5 +1,5 @@ { "type": "shared-browser", - "id": "@kbn/text-based-editor", + "id": "@kbn/esql-editor", "owner": "@elastic/kibana-esql", } \ No newline at end of file diff --git a/packages/kbn-text-based-editor/package.json b/packages/kbn-esql-editor/package.json similarity index 80% rename from packages/kbn-text-based-editor/package.json rename to packages/kbn-esql-editor/package.json index 47d3d426b21f2b..d6eff671d89fa8 100644 --- a/packages/kbn-text-based-editor/package.json +++ b/packages/kbn-esql-editor/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/text-based-editor", + "name": "@kbn/esql-editor", "private": true, "version": "1.0.0", "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", diff --git a/packages/kbn-text-based-editor/setup_tests.ts b/packages/kbn-esql-editor/setup_tests.ts similarity index 100% rename from packages/kbn-text-based-editor/setup_tests.ts rename to packages/kbn-esql-editor/setup_tests.ts diff --git a/packages/kbn-text-based-editor/src/__stories__/text_based_editor.stories.mdx b/packages/kbn-esql-editor/src/__stories__/esql_editor.stories.mdx similarity index 83% rename from packages/kbn-text-based-editor/src/__stories__/text_based_editor.stories.mdx rename to packages/kbn-esql-editor/src/__stories__/esql_editor.stories.mdx index 004cc3729dfa6d..44792be565886f 100644 --- a/packages/kbn-text-based-editor/src/__stories__/text_based_editor.stories.mdx +++ b/packages/kbn-esql-editor/src/__stories__/esql_editor.stories.mdx @@ -1,7 +1,7 @@ import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs/blocks'; import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { TextBasedLanguagesEditor } from '../text_based_languages_editor'; +import { ESQLEditor } from '../esql_editor'; export const Template = (args) => @@ -12,19 +12,19 @@ export const Template = (args) => uiSettings: { get: () => {} }, }} > - + ; # Overview -The TextBasedLanguagesEditor component is a reusable component and can be used to support text based languages in your application (SQL, ESQL): +The ESQLEditor component is a reusable component and can be used to support text based languages in your application (SQL, ESQL): \ No newline at end of file +../esql_editor \ No newline at end of file diff --git a/packages/kbn-text-based-editor/src/editor_footer/errors_warnings_popover.tsx b/packages/kbn-esql-editor/src/editor_footer/errors_warnings_popover.tsx similarity index 89% rename from packages/kbn-text-based-editor/src/editor_footer/errors_warnings_popover.tsx rename to packages/kbn-esql-editor/src/editor_footer/errors_warnings_popover.tsx index 58f84ba618e5f5..fd38177ce41e90 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/errors_warnings_popover.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/errors_warnings_popover.tsx @@ -26,22 +26,22 @@ const getConstsByType = (type: 'error' | 'warning', count: number) => { if (type === 'error') { return { color: 'danger', - message: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.errorCount', { + message: i18n.translate('esqlEditor.query.errorCount', { defaultMessage: '{count} {count, plural, one {error} other {errors}}', values: { count }, }), - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.errorsTitle', { + label: i18n.translate('esqlEditor.query.errorsTitle', { defaultMessage: 'Errors', }), }; } else { return { color: 'warning', - message: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.warningCount', { + message: i18n.translate('esqlEditor.query.warningCount', { defaultMessage: '{count} {count, plural, one {warning} other {warnings}}', values: { count }, }), - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.warningsTitle', { + label: i18n.translate('esqlEditor.query.warningsTitle', { defaultMessage: 'Warnings', }), }; @@ -79,14 +79,14 @@ function ErrorsWarningsContent({ - {i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.lineNumber', { + {i18n.translate('esqlEditor.query.lineNumber', { defaultMessage: 'Line {lineNumber}', values: { lineNumber: item.startLineNumber }, })} - + {item.message} diff --git a/packages/kbn-text-based-editor/src/editor_footer/feedback_component.tsx b/packages/kbn-esql-editor/src/editor_footer/feedback_component.tsx similarity index 86% rename from packages/kbn-text-based-editor/src/editor_footer/feedback_component.tsx rename to packages/kbn-esql-editor/src/editor_footer/feedback_component.tsx index 1a17cfbfe66838..f3bfc672c7ba0d 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/feedback_component.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/feedback_component.tsx @@ -23,11 +23,11 @@ export function SubmitFeedbackComponent({ isSpaceReduced }: { isSpaceReduced?: b href={FEEDBACK_LINK} external={false} target="_blank" - data-test-subj="TextBasedLangEditor-feedback-link" + data-test-subj="ESQLEditor-feedback-link" > @@ -57,9 +57,9 @@ export function SubmitFeedbackComponent({ isSpaceReduced }: { isSpaceReduced?: b font-size: 12px; margin-right: ${euiTheme.size.m}; `} - data-test-subj="TextBasedLangEditor-feedback-link" + data-test-subj="ESQLEditor-feedback-link" > - {i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.submitFeedback', { + {i18n.translate('esqlEditor.query.submitFeedback', { defaultMessage: 'Submit feedback', })} diff --git a/packages/kbn-text-based-editor/src/editor_footer/index.tsx b/packages/kbn-esql-editor/src/editor_footer/index.tsx similarity index 78% rename from packages/kbn-text-based-editor/src/editor_footer/index.tsx rename to packages/kbn-esql-editor/src/editor_footer/index.tsx index 2771f5118ec8f9..389fd264d25137 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/index.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/index.tsx @@ -30,7 +30,7 @@ import { ErrorsWarningsFooterPopover } from './errors_warnings_popover'; import { QueryHistoryAction, QueryHistory } from './query_history'; import { SubmitFeedbackComponent } from './feedback_component'; import { QueryWrapComponent } from './query_wrap_component'; -import type { TextBasedEditorDeps } from '../types'; +import type { ESQLEditorDeps } from '../types'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; const COMMAND_KEY = isMac ? '⌘' : '^'; @@ -81,7 +81,7 @@ export const EditorFooter = memo(function EditorFooter({ measuredContainerWidth, code, }: EditorFooterProps) { - const kibana = useKibana(); + const kibana = useKibana(); const { docLinks } = kibana.services; const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false); const [isLanguageComponentOpen, setIsLanguageComponentOpen] = useState(false); @@ -126,7 +126,7 @@ export const EditorFooter = memo(function EditorFooter({ @@ -141,13 +141,9 @@ export const EditorFooter = memo(function EditorFooter({ > - +

- {i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.lineCount', { + {i18n.translate('esqlEditor.query.lineCount', { defaultMessage: '{count} {count, plural, one {line} other {lines}}', values: { count: lines }, })} @@ -159,28 +155,18 @@ export const EditorFooter = memo(function EditorFooter({ - +

{isSpaceReduced ? '@timestamp' : detectedTimestamp - ? i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.timestampDetected', - { - defaultMessage: '{detectedTimestamp} found', - values: { detectedTimestamp }, - } - ) - : i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected', - { - defaultMessage: '@timestamp not found', - } - )} + ? i18n.translate('esqlEditor.query.timestampDetected', { + defaultMessage: '{detectedTimestamp} found', + values: { detectedTimestamp }, + }) + : i18n.translate('esqlEditor.query.timestampNotDetected', { + defaultMessage: '@timestamp not found', + })}

@@ -190,27 +176,17 @@ export const EditorFooter = memo(function EditorFooter({ - +

{isSpaceReduced - ? i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.limitInfoReduced', - { - defaultMessage: 'LIMIT {limit}', - values: { limit }, - } - ) - : i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.limitInfo', - { - defaultMessage: 'LIMIT {limit} rows', - values: { limit }, - } - )} + ? i18n.translate('esqlEditor.query.limitInfoReduced', { + defaultMessage: 'LIMIT {limit}', + values: { limit }, + }) + : i18n.translate('esqlEditor.query.limitInfo', { + defaultMessage: 'LIMIT {limit} rows', + values: { limit }, + })}

@@ -263,18 +239,11 @@ export const EditorFooter = memo(function EditorFooter({ - +

- {i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.runQuery', - { - defaultMessage: 'Run query', - } - )} + {i18n.translate('esqlEditor.query.runQuery', { + defaultMessage: 'Run query', + })}

@@ -294,7 +263,7 @@ export const EditorFooter = memo(function EditorFooter({ toggleLanguageComponent()} css={css` diff --git a/packages/kbn-text-based-editor/src/editor_footer/query_history.test.tsx b/packages/kbn-esql-editor/src/editor_footer/query_history.test.tsx similarity index 90% rename from packages/kbn-text-based-editor/src/editor_footer/query_history.test.tsx rename to packages/kbn-esql-editor/src/editor_footer/query_history.test.tsx index 352eb4b7856569..df41e2a2d3b918 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/query_history.test.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/query_history.test.tsx @@ -32,19 +32,17 @@ describe('QueryHistory', () => { it('should render the history action component as a button if is spaceReduced is undefined', () => { render(); expect( - screen.getByTestId('TextBasedLangEditor-toggle-query-history-button-container') + screen.getByTestId('ESQLEditor-toggle-query-history-button-container') ).toBeInTheDocument(); expect( - screen.getByTestId('TextBasedLangEditor-toggle-query-history-button-container') + screen.getByTestId('ESQLEditor-toggle-query-history-button-container') ).toHaveTextContent('Hide recent queries'); }); it('should render the history action component as an icon if is spaceReduced is true', () => { render(); - expect( - screen.getByTestId('TextBasedLangEditor-toggle-query-history-icon') - ).toBeInTheDocument(); + expect(screen.getByTestId('ESQLEditor-toggle-query-history-icon')).toBeInTheDocument(); }); }); @@ -134,7 +132,7 @@ describe('QueryHistory', () => { /> ); expect( - screen.queryByTestId('TextBasedLangEditor-queryHistory-queryString-expanded') + screen.queryByTestId('ESQLEditor-queryHistory-queryString-expanded') ).not.toBeInTheDocument(); }); @@ -155,7 +153,7 @@ describe('QueryHistory', () => { /> ); expect( - screen.getByTestId('TextBasedLangEditor-queryHistory-queryString-expanded') + screen.getByTestId('ESQLEditor-queryHistory-queryString-expanded') ).toBeInTheDocument(); }); }); diff --git a/packages/kbn-text-based-editor/src/editor_footer/query_history.tsx b/packages/kbn-esql-editor/src/editor_footer/query_history.tsx similarity index 71% rename from packages/kbn-text-based-editor/src/editor_footer/query_history.tsx rename to packages/kbn-esql-editor/src/editor_footer/query_history.tsx index 20c837bf685e73..18593d4856e4e3 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/query_history.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/query_history.tsx @@ -47,23 +47,17 @@ export function QueryHistoryAction({ return ( <> {isSpaceReduced && ( - + )} {!isSpaceReduced && ( - + {isHistoryOpen - ? i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel', { + ? i18n.translate('esqlEditor.query.hideQueriesLabel', { defaultMessage: 'Hide recent queries', }) - : i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel', { + : i18n.translate('esqlEditor.query.showQueriesLabel', { defaultMessage: 'Show recent queries', })} @@ -126,18 +117,15 @@ export const getTableColumns = ( return ( ); @@ -145,18 +133,15 @@ export const getTableColumns = ( return ( ); @@ -164,18 +149,15 @@ export const getTableColumns = ( return ( ); @@ -187,12 +169,9 @@ export const getTableColumns = ( { field: 'queryString', 'data-test-subj': 'queryString', - name: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel', - { - defaultMessage: 'Recent queries', - } - ), + name: i18n.translate('esqlEditor.query.recentQueriesColumnLabel', { + defaultMessage: 'Recent queries', + }), render: (queryString: QueryHistoryItem['queryString']) => ( onUpdateAndSubmit(item.queryString)} @@ -276,12 +249,9 @@ export function QueryHistory({ {(copy) => ( )} @@ -349,14 +316,11 @@ export function QueryHistory({ `; return ( -
+
{ setIsRowExpanded(!isRowExpanded); }} - data-test-subj="TextBasedLangEditor-queryHistory-queryString-expanded" + data-test-subj="ESQLEditor-queryHistory-queryString-expanded" aria-label={ isRowExpanded - ? i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.collapseLabel', { + ? i18n.translate('esqlEditor.query.collapseLabel', { defaultMessage: 'Collapse', }) - : i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.expandLabel', { + : i18n.translate('esqlEditor.query.expandLabel', { defaultMessage: 'Expand', }) } diff --git a/packages/kbn-text-based-editor/src/editor_footer/query_history_helpers.test.ts b/packages/kbn-esql-editor/src/editor_footer/query_history_helpers.test.ts similarity index 100% rename from packages/kbn-text-based-editor/src/editor_footer/query_history_helpers.test.ts rename to packages/kbn-esql-editor/src/editor_footer/query_history_helpers.test.ts diff --git a/packages/kbn-text-based-editor/src/editor_footer/query_history_helpers.ts b/packages/kbn-esql-editor/src/editor_footer/query_history_helpers.ts similarity index 100% rename from packages/kbn-text-based-editor/src/editor_footer/query_history_helpers.ts rename to packages/kbn-esql-editor/src/editor_footer/query_history_helpers.ts diff --git a/packages/kbn-text-based-editor/src/editor_footer/query_wrap_component.tsx b/packages/kbn-esql-editor/src/editor_footer/query_wrap_component.tsx similarity index 66% rename from packages/kbn-text-based-editor/src/editor_footer/query_wrap_component.tsx rename to packages/kbn-esql-editor/src/editor_footer/query_wrap_component.tsx index 8abcc475a9390f..5ca2759123e0b2 100644 --- a/packages/kbn-text-based-editor/src/editor_footer/query_wrap_component.tsx +++ b/packages/kbn-esql-editor/src/editor_footer/query_wrap_component.tsx @@ -29,13 +29,10 @@ export function QueryWrapComponent({ position="top" content={ isWrappedByPipes - ? i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel', - { - defaultMessage: 'Remove line breaks on pipes', - } - ) - : i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel', { + ? i18n.translate('esqlEditor.query.disableWordWrapLabel', { + defaultMessage: 'Remove line breaks on pipes', + }) + : i18n.translate('esqlEditor.query.EnableWordWrapLabel', { defaultMessage: 'Add line breaks on pipes', }) } @@ -44,21 +41,15 @@ export function QueryWrapComponent({ iconType={isWrappedByPipes ? 'pipeNoBreaks' : 'pipeBreaks'} color="text" size="xs" - data-test-subj="TextBasedLangEditor-toggleWordWrap" + data-test-subj="ESQLEditor-toggleWordWrap" aria-label={ isWrappedByPipes - ? i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel', - { - defaultMessage: 'Remove line breaks on pipes', - } - ) - : i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel', - { - defaultMessage: 'Add line breaks on pipes', - } - ) + ? i18n.translate('esqlEditor.query.disableWordWrapLabel', { + defaultMessage: 'Remove line breaks on pipes', + }) + : i18n.translate('esqlEditor.query.EnableWordWrapLabel', { + defaultMessage: 'Add line breaks on pipes', + }) } onClick={() => { const updatedCode = prettifyQuery(code, isWrappedByPipes); diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.styles.ts b/packages/kbn-esql-editor/src/esql_editor.styles.ts similarity index 98% rename from packages/kbn-text-based-editor/src/text_based_languages_editor.styles.ts rename to packages/kbn-esql-editor/src/esql_editor.styles.ts index 03c960477b92a4..7af40ea75e35c2 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.styles.ts +++ b/packages/kbn-esql-editor/src/esql_editor.styles.ts @@ -14,7 +14,7 @@ export const EDITOR_INITIAL_HEIGHT_INLINE_EDITING = 140; export const EDITOR_MIN_HEIGHT = 40; export const EDITOR_MAX_HEIGHT = 400; -export const textBasedLanguageEditorStyles = ( +export const esqlEditorStyles = ( euiTheme: EuiThemeComputed, editorHeight: number, hasErrors: boolean, diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx b/packages/kbn-esql-editor/src/esql_editor.test.tsx similarity index 50% rename from packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx rename to packages/kbn-esql-editor/src/esql_editor.test.tsx index 0855d0326263f6..ac00604e5508b3 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.test.tsx +++ b/packages/kbn-esql-editor/src/esql_editor.test.tsx @@ -13,12 +13,12 @@ import { IUiSettingsClient } from '@kbn/core/public'; import { mountWithIntl as mount } from '@kbn/test-jest-helpers'; import { findTestSubject } from '@elastic/eui/lib/test'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { TextBasedLanguagesEditor } from './text_based_languages_editor'; -import type { TextBasedLanguagesEditorProps } from './types'; +import { ESQLEditor } from './esql_editor'; +import type { ESQLEditorProps } from './types'; import { ReactWrapper } from 'enzyme'; import { of } from 'rxjs'; -describe('TextBasedLanguagesEditor', () => { +describe('ESQLEditor', () => { const uiConfig: Record = {}; const uiSettings = { get: (key: string) => uiConfig[key], @@ -35,14 +35,14 @@ describe('TextBasedLanguagesEditor', () => { theme, }; - function renderTextBasedLanguagesEditorComponent(testProps: TextBasedLanguagesEditorProps) { + function renderESQLEditorComponent(testProps: ESQLEditorProps) { return ( - + ); } - let props: TextBasedLanguagesEditorProps; + let props: ESQLEditorProps; beforeEach(() => { props = { @@ -52,22 +52,20 @@ describe('TextBasedLanguagesEditor', () => { }; }); it('should render the editor component', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect(component.find('[data-test-subj="TextBasedLangEditor"]').length).not.toBe(0); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor"]').length).not.toBe(0); }); it('should render the date info with no @timestamp found', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect( - component.find('[data-test-subj="TextBasedLangEditor-date-info"]').at(0).text() - ).toStrictEqual('@timestamp not found'); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-date-info"]').at(0).text()).toStrictEqual( + '@timestamp not found' + ); }); it('should render the feedback link', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect(component.find('[data-test-subj="TextBasedLangEditor-feedback-link"]').length).not.toBe( - 0 - ); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-feedback-link"]').length).not.toBe(0); }); it('should not render the date info if hideTimeFilterInfo is set to true', async () => { @@ -75,8 +73,8 @@ describe('TextBasedLanguagesEditor', () => { ...props, hideTimeFilterInfo: true, }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); - expect(component.find('[data-test-subj="TextBasedLangEditor-date-info"]').length).toBe(0); + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-date-info"]').length).toBe(0); }); it('should render the date info with @timestamp found if detectedTimestamp is given', async () => { @@ -84,17 +82,17 @@ describe('TextBasedLanguagesEditor', () => { ...props, detectedTimestamp: '@timestamp', }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); - expect( - component.find('[data-test-subj="TextBasedLangEditor-date-info"]').at(0).text() - ).toStrictEqual('@timestamp found'); + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-date-info"]').at(0).text()).toStrictEqual( + '@timestamp found' + ); }); it('should render the limit information', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect( - component.find('[data-test-subj="TextBasedLangEditor-limit-info"]').at(0).text() - ).toStrictEqual('LIMIT 1000 rows'); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-limit-info"]').at(0).text()).toStrictEqual( + 'LIMIT 1000 rows' + ); }); it('should not render the query history action if hideQueryHistory is set to true', async () => { @@ -102,40 +100,37 @@ describe('TextBasedLanguagesEditor', () => { ...props, hideQueryHistory: true, }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); + const component = mount(renderESQLEditorComponent({ ...newProps })); expect( - component.find('[data-test-subj="TextBasedLangEditor-toggle-query-history-button-container"]') - .length + component.find('[data-test-subj="ESQLEditor-toggle-query-history-button-container"]').length ).toBe(0); }); it('should render the correct buttons for the expanded code editor mode', async () => { let component: ReactWrapper; await act(async () => { - component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); + component = mount(renderESQLEditorComponent({ ...props })); }); component!.update(); - expect( - component!.find('[data-test-subj="TextBasedLangEditor-toggleWordWrap"]').length - ).not.toBe(0); + expect(component!.find('[data-test-subj="ESQLEditor-toggleWordWrap"]').length).not.toBe(0); }); it('should render the resize for the expanded code editor mode', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect(component.find('[data-test-subj="TextBasedLangEditor-resize"]').length).not.toBe(0); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-resize"]').length).not.toBe(0); }); it('should render the footer for the expanded code editor mode', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect(component.find('[data-test-subj="TextBasedLangEditor-footer"]').length).not.toBe(0); - expect(component.find('[data-test-subj="TextBasedLangEditor-footer-lines"]').at(0).text()).toBe( + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-footer"]').length).not.toBe(0); + expect(component.find('[data-test-subj="ESQLEditor-footer-lines"]').at(0).text()).toBe( '1 line' ); }); it('should render the run query text', async () => { - const component = mount(renderTextBasedLanguagesEditorComponent({ ...props })); - expect(component.find('[data-test-subj="TextBasedLangEditor-run-query"]').length).not.toBe(0); + const component = mount(renderESQLEditorComponent({ ...props })); + expect(component.find('[data-test-subj="ESQLEditor-run-query"]').length).not.toBe(0); }); it('should render the doc icon if the displayDocumentationAsFlyout is true', async () => { @@ -144,10 +139,8 @@ describe('TextBasedLanguagesEditor', () => { displayDocumentationAsFlyout: true, editorIsInline: false, }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); - expect(component.find('[data-test-subj="TextBasedLangEditor-documentation"]').length).not.toBe( - 0 - ); + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-documentation"]').length).not.toBe(0); }); it('should not render the run query text if the hideRunQueryText prop is set to true', async () => { @@ -155,8 +148,8 @@ describe('TextBasedLanguagesEditor', () => { ...props, hideRunQueryText: true, }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); - expect(component.find('[data-test-subj="TextBasedLangEditor-run-query"]').length).toBe(0); + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-run-query"]').length).toBe(0); }); it('should render correctly if editorIsInline prop is set to true', async () => { @@ -167,12 +160,10 @@ describe('TextBasedLanguagesEditor', () => { editorIsInline: true, onTextLangQuerySubmit, }; - const component = mount(renderTextBasedLanguagesEditorComponent({ ...newProps })); - expect(component.find('[data-test-subj="TextBasedLangEditor-run-query"]').length).toBe(0); - expect( - component.find('[data-test-subj="TextBasedLangEditor-run-query-button"]').length - ).not.toBe(1); - findTestSubject(component, 'TextBasedLangEditor-run-query-button').simulate('click'); + const component = mount(renderESQLEditorComponent({ ...newProps })); + expect(component.find('[data-test-subj="ESQLEditor-run-query"]').length).toBe(0); + expect(component.find('[data-test-subj="ESQLEditor-run-query-button"]').length).not.toBe(1); + findTestSubject(component, 'ESQLEditor-run-query-button').simulate('click'); expect(onTextLangQuerySubmit).toHaveBeenCalled(); }); }); diff --git a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx b/packages/kbn-esql-editor/src/esql_editor.tsx similarity index 96% rename from packages/kbn-text-based-editor/src/text_based_languages_editor.tsx rename to packages/kbn-esql-editor/src/esql_editor.tsx index 2ebd5a42a966a5..337c0133e7d20e 100644 --- a/packages/kbn-text-based-editor/src/text_based_languages_editor.tsx +++ b/packages/kbn-esql-editor/src/esql_editor.tsx @@ -49,9 +49,9 @@ import { EDITOR_INITIAL_HEIGHT_INLINE_EDITING, EDITOR_MAX_HEIGHT, EDITOR_MIN_HEIGHT, - textBasedLanguageEditorStyles, -} from './text_based_languages_editor.styles'; -import type { TextBasedLanguagesEditorProps, TextBasedEditorDeps } from './types'; + esqlEditorStyles, +} from './esql_editor.styles'; +import type { ESQLEditorProps, ESQLEditorDeps } from './types'; import './overwrite.scss'; @@ -61,7 +61,7 @@ const KEYCODE_ARROW_DOWN = 40; // for editor width smaller than this value we want to start hiding some text const BREAKPOINT_WIDTH = 540; -export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ +export const ESQLEditor = memo(function ESQLEditor({ query, onTextLangQueryChange, onTextLangQuerySubmit, @@ -79,11 +79,11 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ hideQueryHistory, hasOutline, displayDocumentationAsFlyout, -}: TextBasedLanguagesEditorProps) { +}: ESQLEditorProps) { const popoverRef = useRef(null); const datePickerOpenStatusRef = useRef(false); const { euiTheme } = useEuiTheme(); - const kibana = useKibana(); + const kibana = useKibana(); const { dataViews, expressions, @@ -235,7 +235,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ openTimePickerPopover(); }); - const styles = textBasedLanguageEditorStyles( + const styles = esqlEditorStyles( euiTheme, editorHeight, Boolean(editorMessages.errors.length), @@ -396,7 +396,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ const queryRunButtonProperties = useMemo(() => { if (allowQueryCancellation && isLoading) { return { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.cancel', { + label: i18n.translate('esqlEditor.query.cancel', { defaultMessage: 'Cancel', }), iconType: 'cross', @@ -405,7 +405,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ } if (code !== codeWhenSubmitted) { return { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.runQuery', { + label: i18n.translate('esqlEditor.query.runQuery', { defaultMessage: 'Run query', }), iconType: 'play', @@ -413,7 +413,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ }; } return { - label: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.refreshLabel', { + label: i18n.translate('esqlEditor.query.refreshLabel', { defaultMessage: 'Refresh', }), iconType: 'refresh', @@ -611,7 +611,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ @@ -622,7 +622,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ size="s" isLoading={isLoading && !allowQueryCancellation} isDisabled={Boolean(disableSubmitAction && !allowQueryCancellation)} - data-test-subj="TextBasedLangEditor-run-query-button" + data-test-subj="ESQLEditor-run-query-button" aria-label={queryRunButtonProperties.label} > {queryRunButtonProperties.label} @@ -639,8 +639,8 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({ >
{ }; } else if (error.message.includes('expression was aborted')) { return { - message: i18n.translate('textBasedEditor.query.textBasedLanguagesEditor.aborted', { + message: i18n.translate('esqlEditor.query.aborted', { defaultMessage: 'Request was aborted', }), startColumn: 1, diff --git a/packages/kbn-text-based-editor/src/history_local_storage.test.ts b/packages/kbn-esql-editor/src/history_local_storage.test.ts similarity index 100% rename from packages/kbn-text-based-editor/src/history_local_storage.test.ts rename to packages/kbn-esql-editor/src/history_local_storage.test.ts diff --git a/packages/kbn-text-based-editor/src/history_local_storage.ts b/packages/kbn-esql-editor/src/history_local_storage.ts similarity index 100% rename from packages/kbn-text-based-editor/src/history_local_storage.ts rename to packages/kbn-esql-editor/src/history_local_storage.ts diff --git a/packages/kbn-text-based-editor/src/overwrite.scss b/packages/kbn-esql-editor/src/overwrite.scss similarity index 53% rename from packages/kbn-text-based-editor/src/overwrite.scss rename to packages/kbn-esql-editor/src/overwrite.scss index 5f96bb4a580f29..0f675c02cd7684 100644 --- a/packages/kbn-text-based-editor/src/overwrite.scss +++ b/packages/kbn-esql-editor/src/overwrite.scss @@ -1,40 +1,40 @@ /* Editor styles for any layout mode */ /* NOTE: Much of this is overriding Monaco styles so the specificity is intentional */ -.TextBasedLangEditor .monaco-editor .monaco-hover { +.ESQLEditor .monaco-editor .monaco-hover { display: block !important; } -.TextBasedLangEditor .monaco-editor .margin-view-overlays .line-numbers { +.ESQLEditor .monaco-editor .margin-view-overlays .line-numbers { color: $euiColorDisabledText; } // Currently focused line(s) -.TextBasedLangEditor .monaco-editor .current-line ~ .line-numbers { +.ESQLEditor .monaco-editor .current-line ~ .line-numbers { color: $euiTextSubduedColor; } // Suggest (autocomplete) menu -.TextBasedLangEditor .monaco-editor .suggest-widget, .TextBasedLangEditor .monaco-editor .suggest-details-container { +.ESQLEditor .monaco-editor .suggest-widget, .ESQLEditor .monaco-editor .suggest-details-container { @include euiBottomShadow; border-radius: $euiBorderRadius; } -.TextBasedLangEditor .monaco-editor .suggest-details-container { +.ESQLEditor .monaco-editor .suggest-details-container { background-color: $euiColorEmptyShade; line-height: 1.5rem; } -.TextBasedLangEditor_errorMessage { +.ESQLEditor_errorMessage { @include euiTextBreakWord; } // All scrollable containers (e.g. main container and suggest menu) -.TextBasedLangEditor .monaco-editor .monaco-scrollable-element { +.ESQLEditor .monaco-editor .monaco-scrollable-element { margin-left: $euiSizeS; } -.TextBasedLangEditor .monaco-editor .monaco-list .monaco-scrollable-element { +.ESQLEditor .monaco-editor .monaco-list .monaco-scrollable-element { margin-left: 0; .monaco-list-row.focused { diff --git a/packages/kbn-text-based-editor/src/resizable_button.tsx b/packages/kbn-esql-editor/src/resizable_button.tsx similarity index 96% rename from packages/kbn-text-based-editor/src/resizable_button.tsx rename to packages/kbn-esql-editor/src/resizable_button.tsx index 4ca2fc70d232d9..6217526de70182 100644 --- a/packages/kbn-text-based-editor/src/resizable_button.tsx +++ b/packages/kbn-esql-editor/src/resizable_button.tsx @@ -24,7 +24,7 @@ export function ResizableButton({ }) { return ( { +export const ESQLLangEditor = (props: ESQLEditorProps) => { const { loading, value } = useAsync(() => { const startServicesPromise = untilPluginStartServicesReady(); - const modulePromise = import('@kbn/text-based-editor'); + const modulePromise = import('@kbn/esql-editor'); return Promise.all([startServicesPromise, modulePromise]); }, []); - const TextBasedLanguagesEditor = value?.[1]?.default; + const ESQLEditor = value?.[1]?.default; const deps = value?.[0]; - if (loading || !deps || !TextBasedLanguagesEditor) return ; + if (loading || !deps || !ESQLEditor) return ; return ( { ...deps, }} > - + ); }; diff --git a/src/plugins/esql/public/index.ts b/src/plugins/esql/public/index.ts index 7d31026023aa83..8101796e28b4e5 100644 --- a/src/plugins/esql/public/index.ts +++ b/src/plugins/esql/public/index.ts @@ -8,9 +8,9 @@ */ import { EsqlPlugin } from './plugin'; -export type { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor'; +export type { ESQLEditorProps } from '@kbn/esql-editor'; export type { EsqlPluginStart } from './types'; -export { TextBasedLangEditor } from './create_editor'; +export { ESQLLangEditor } from './create_editor'; export function plugin() { return new EsqlPlugin(); diff --git a/src/plugins/esql/public/types.ts b/src/plugins/esql/public/types.ts index 7802cec327c0d2..fbbc549ee44364 100644 --- a/src/plugins/esql/public/types.ts +++ b/src/plugins/esql/public/types.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor'; +import { ESQLEditorProps } from '@kbn/esql-editor'; export interface EsqlPluginStart { - Editor: React.ComponentType; + Editor: React.ComponentType; } diff --git a/src/plugins/esql/tsconfig.json b/src/plugins/esql/tsconfig.json index 6420a9535197d1..85503fd846b4c2 100644 --- a/src/plugins/esql/tsconfig.json +++ b/src/plugins/esql/tsconfig.json @@ -10,7 +10,7 @@ "server/**/*", ], "kbn_references": [ - "@kbn/text-based-editor", + "@kbn/esql-editor", "@kbn/kibana-react-plugin", "@kbn/core", "@kbn/expressions-plugin", diff --git a/src/plugins/unified_search/.storybook/main.js b/src/plugins/unified_search/.storybook/main.js index 05b8068b140d05..86528a888e70e0 100644 --- a/src/plugins/unified_search/.storybook/main.js +++ b/src/plugins/unified_search/.storybook/main.js @@ -14,7 +14,7 @@ import { resolve } from 'path'; const mockConfig = { resolve: { alias: { - '@kbn/esql/public': resolve(__dirname, '../public/mocks/text_based_languages_editor.tsx'), + '@kbn/esql/public': resolve(__dirname, '../public/mocks/esql_editor.tsx'), }, }, }; diff --git a/src/plugins/unified_search/public/mocks/text_based_languages_editor.tsx b/src/plugins/unified_search/public/mocks/esql_editor.tsx similarity index 69% rename from src/plugins/unified_search/public/mocks/text_based_languages_editor.tsx rename to src/plugins/unified_search/public/mocks/esql_editor.tsx index 3a7ee60e9da6fd..8869308696576b 100644 --- a/src/plugins/unified_search/public/mocks/text_based_languages_editor.tsx +++ b/src/plugins/unified_search/public/mocks/esql_editor.tsx @@ -9,14 +9,14 @@ import React from 'react'; import { withSuspense } from '@kbn/shared-ux-utility'; -import { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor'; +import { ESQLEditorProps } from '@kbn/esql-editor'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -const TextBasedLanguagesEditorLazy = React.lazy(() => import('@kbn/text-based-editor')); -const TextBasedLanguagesEditor = withSuspense(TextBasedLanguagesEditorLazy); +const ESQLEditorLazy = React.lazy(() => import('@kbn/esql-editor')); +const ESQLEditor = withSuspense(ESQLEditorLazy); function createEditor() { - return (props: TextBasedLanguagesEditorProps) => { + return (props: ESQLEditorProps) => { return ( {} }, }} > - + ); }; } -export const TextBasedLangEditor = createEditor(); +export const ESQLLangEditor = createEditor(); diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx index 7df585bd1e968d..9805381800ccc0 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx @@ -20,7 +20,7 @@ import { isOfAggregateQueryType, getLanguageDisplayName, } from '@kbn/es-query'; -import { TextBasedLangEditor } from '@kbn/esql/public'; +import { ESQLLangEditor } from '@kbn/esql/public'; import { EMPTY } from 'rxjs'; import { map } from 'rxjs'; import { throttle } from 'lodash'; @@ -728,7 +728,7 @@ export const QueryBarTopRow = React.memo( isQueryLangSelected && props.query && isOfAggregateQueryType(props.query) && ( - { @@ -400,7 +400,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await header.waitUntilLoadingHasFinished(); await discover.waitUntilSearchingHasFinished(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); const historyItems = await esql.getHistoryItems(); log.debug(historyItems); const queryAdded = historyItems.some((item) => { @@ -416,7 +416,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await discover.waitUntilSearchingHasFinished(); await unifiedFieldList.waitUntilSidebarHasLoaded(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); // click a history item await esql.clickHistoryItem(1); @@ -441,9 +441,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await header.waitUntilLoadingHasFinished(); await discover.waitUntilSearchingHasFinished(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); const historyItem = await esql.getHistoryItem(0); - await historyItem.findByTestSubject('TextBasedLangEditor-queryHistory-error'); + await historyItem.findByTestSubject('ESQLEditor-queryHistory-error'); }); }); diff --git a/test/functional/apps/discover/group5/_no_data.ts b/test/functional/apps/discover/group5/_no_data.ts index 6c65dbb2fd7350..b6dfa30743fb70 100644 --- a/test/functional/apps/discover/group5/_no_data.ts +++ b/test/functional/apps/discover/group5/_no_data.ts @@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await header.waitUntilLoadingHasFinished(); await discover.waitUntilSearchingHasFinished(); - await testSubjects.existOrFail('TextBasedLangEditor'); + await testSubjects.existOrFail('ESQLEditor'); await testSubjects.existOrFail('unifiedHistogramChart'); const rows = await dataGrid.getDocTableRows(); expect(rows.length).to.be.above(0); diff --git a/test/functional/services/esql.ts b/test/functional/services/esql.ts index aa303257e75707..81ccb22d208e96 100644 --- a/test/functional/services/esql.ts +++ b/test/functional/services/esql.ts @@ -14,7 +14,7 @@ export class ESQLService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); public async getHistoryItems(): Promise { - const queryHistory = await this.testSubjects.find('TextBasedLangEditor-queryHistory'); + const queryHistory = await this.testSubjects.find('ESQLEditor-queryHistory'); const tableBody = await this.retry.try(async () => queryHistory.findByTagName('tbody')); const $ = await tableBody.parseDomContent(); return $('tr') @@ -38,7 +38,7 @@ export class ESQLService extends FtrService { } public async getHistoryItem(rowIndex = 0) { - const queryHistory = await this.testSubjects.find('TextBasedLangEditor-queryHistory'); + const queryHistory = await this.testSubjects.find('ESQLEditor-queryHistory'); const tableBody = await this.retry.try(async () => queryHistory.findByTagName('tbody')); const rows = await this.retry.try(async () => tableBody.findAllByTagName('tr')); @@ -47,7 +47,7 @@ export class ESQLService extends FtrService { public async clickHistoryItem(rowIndex = 0) { const row = await this.getHistoryItem(rowIndex); - const toggle = await row.findByTestSubject('TextBasedLangEditor-queryHistory-runQuery-button'); + const toggle = await row.findByTestSubject('ESQLEditor-queryHistory-runQuery-button'); await toggle.click(); } } diff --git a/tsconfig.base.json b/tsconfig.base.json index a1687ebbd835dc..84d2b4a258c1c6 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -852,6 +852,8 @@ "@kbn/esql-ast-inspector-plugin/*": ["examples/esql_ast_inspector/*"], "@kbn/esql-datagrid": ["src/plugins/esql_datagrid"], "@kbn/esql-datagrid/*": ["src/plugins/esql_datagrid/*"], + "@kbn/esql-editor": ["packages/kbn-esql-editor"], + "@kbn/esql-editor/*": ["packages/kbn-esql-editor/*"], "@kbn/esql-utils": ["packages/kbn-esql-utils"], "@kbn/esql-utils/*": ["packages/kbn-esql-utils/*"], "@kbn/esql-validation-autocomplete": ["packages/kbn-esql-validation-autocomplete"], @@ -1832,8 +1834,6 @@ "@kbn/test-suites-xpack-performance/*": ["x-pack/performance/*"], "@kbn/testing-embedded-lens-plugin": ["x-pack/examples/testing_embedded_lens"], "@kbn/testing-embedded-lens-plugin/*": ["x-pack/examples/testing_embedded_lens/*"], - "@kbn/text-based-editor": ["packages/kbn-text-based-editor"], - "@kbn/text-based-editor/*": ["packages/kbn-text-based-editor/*"], "@kbn/third-party-lens-navigation-prompt-plugin": ["x-pack/examples/third_party_lens_navigation_prompt"], "@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"], "@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"], diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx index d50ee4c8916f13..f2ac83e1d4bfba 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx @@ -12,7 +12,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { usePageUrlState } from '@kbn/ml-url-state'; import { FullTimeRangeSelector, DatePickerWrapper } from '@kbn/ml-date-picker'; -import { TextBasedLangEditor } from '@kbn/esql/public'; +import { ESQLLangEditor } from '@kbn/esql/public'; import type { AggregateQuery } from '@kbn/es-query'; import { @@ -268,7 +268,7 @@ export const IndexDataVisualizerESQL: FC = (dataVi borderRight: euiTheme.euiBorderThin, })} > - - { setQuery(q); diff --git a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.test.tsx b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.test.tsx index d12ac172b72cd1..85c7036a3e9df1 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.test.tsx @@ -258,7 +258,7 @@ describe('LensEditConfigurationFlyout', () => { await renderConfigFlyout({ canEditTextBasedQuery: false, }); - expect(screen.queryByTestId('TextBasedLangEditor')).toBeNull(); + expect(screen.queryByTestId('ESQLEditor')).toBeNull(); }); it('should not display the editor if canEditTextBasedQuery prop is true but the query is not text based', async () => { @@ -275,7 +275,7 @@ describe('LensEditConfigurationFlyout', () => { }, }, }); - expect(screen.queryByTestId('TextBasedLangEditor')).toBeNull(); + expect(screen.queryByTestId('ESQLEditor')).toBeNull(); }); it('should not display the suggestions if hidesSuggestions prop is true', async () => { diff --git a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx index 5c8758c948eb60..ecc392a7e56b76 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx +++ b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx @@ -26,7 +26,7 @@ import { getLanguageDisplayName, } from '@kbn/es-query'; import type { AggregateQuery, Query } from '@kbn/es-query'; -import { TextBasedLangEditor } from '@kbn/esql/public'; +import { ESQLLangEditor } from '@kbn/esql/public'; import { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; import { buildExpression } from '../../../editor_frame_service/editor_frame/expression_helpers'; import { MAX_NUM_OF_COLUMNS } from '../../../datasources/text_based/utils'; @@ -477,7 +477,7 @@ export function LensEditConfigurationFlyout({ > {isOfAggregateQueryType(query) && canEditTextBasedQuery && ( - { setQuery(q); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/formula_editor.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/formula_editor.tsx index a39a12d471d5ca..4041d0e7fdd91b 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/formula_editor.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/formula/editor/formula_editor.tsx @@ -849,7 +849,7 @@ export function FormulaEditor({ buttonProps={{ color: 'text', className: 'lnsFormula__editorHelp lnsFormula__editorHelp--overlay', - 'data-test-subj': 'TextBasedLangEditor-documentation', + 'data-test-subj': 'ESQLEditor-documentation', 'aria-label': i18n.translate( 'xpack.lens.formula.editorHelpInlineShowToolTip', { diff --git a/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx b/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx index 9d8d06cee48720..5b0032caff0d29 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiFormRow } from '@elastic/eui'; import { euiThemeVars } from '@kbn/ui-theme'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; -import { fetchFieldsFromESQL } from '@kbn/text-based-editor'; +import { fetchFieldsFromESQL } from '@kbn/esql-editor'; import type { DatasourceDimensionEditorProps, DataType } from '../../../types'; import { FieldSelect, type FieldOptionCompatible } from './field_select'; import type { TextBasedPrivateState } from '../types'; diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index a615c8a4b5bccd..32de68cc7ef45c 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -101,7 +101,7 @@ "@kbn/test-eui-helpers", "@kbn/shared-ux-utility", "@kbn/esql-utils", - "@kbn/text-based-editor", + "@kbn/esql-editor", "@kbn/managed-content-badge", "@kbn/sort-predicates", "@kbn/presentation-publishing", diff --git a/x-pack/plugins/maps/public/classes/sources/esql_source/esql_editor.tsx b/x-pack/plugins/maps/public/classes/sources/esql_source/esql_editor.tsx index be9b75dedf4d4d..32bd798b57ed4f 100644 --- a/x-pack/plugins/maps/public/classes/sources/esql_source/esql_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/esql_source/esql_editor.tsx @@ -11,7 +11,7 @@ import { isEqual } from 'lodash'; import useMountedState from 'react-use/lib/useMountedState'; import type { AggregateQuery } from '@kbn/es-query'; import type { ESQLColumn } from '@kbn/es-types'; -import { TextBasedLangEditor } from '@kbn/esql/public'; +import { ESQLLangEditor } from '@kbn/esql/public'; import { getESQLMeta, verifyGeometryColumn } from './esql_utils'; interface Props { @@ -41,7 +41,7 @@ export function ESQLEditor(props: Props) { return ( <> - { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx index 0ddb42bc41e996..0516bc7d9190c3 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx @@ -7,7 +7,7 @@ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiPanel, EuiTitle } from '@elastic/eui'; import { css } from '@emotion/css'; -import { TextBasedLangEditor } from '@kbn/esql/public'; +import { ESQLLangEditor } from '@kbn/esql/public'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { AddFromLibraryButton } from '../add_from_library_button'; @@ -67,7 +67,7 @@ export function AddInvestigationItem() { - { diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.test.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.test.tsx index e7913a36dd6a11..99cffa8ac780e7 100644 --- a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.test.tsx @@ -21,10 +21,10 @@ jest.mock('../validation', () => ({ })); const { hasExpressionValidationErrors } = jest.requireMock('../validation'); -jest.mock('@kbn/text-based-editor', () => ({ +jest.mock('@kbn/esql-editor', () => ({ fetchFieldsFromESQL: jest.fn(), })); -const { fetchFieldsFromESQL } = jest.requireMock('@kbn/text-based-editor'); +const { fetchFieldsFromESQL } = jest.requireMock('@kbn/esql-editor'); const { getFields } = jest.requireMock('@kbn/triggers-actions-ui-plugin/public'); const AppWrapper = React.memo>(({ children }) => ( diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx index da8559a958d99c..cfa6cde15ee508 100644 --- a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx @@ -16,8 +16,8 @@ import { EuiSpacer, } from '@elastic/eui'; import { getFields, RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public'; -import { TextBasedLangEditor } from '@kbn/esql/public'; -import { fetchFieldsFromESQL } from '@kbn/text-based-editor'; +import { ESQLLangEditor } from '@kbn/esql/public'; +import { fetchFieldsFromESQL } from '@kbn/esql-editor'; import { getESQLAdHocDataview } from '@kbn/esql-utils'; import type { AggregateQuery } from '@kbn/es-query'; import { parseDuration } from '@kbn/alerting-plugin/common'; @@ -187,7 +187,7 @@ export const EsqlQueryExpression: React.FC< /> } > - { setQuery(q); diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index 48321590359fff..c539176666b8fa 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -39,7 +39,7 @@ "@kbn/rule-data-utils", "@kbn/alerts-as-data-utils", "@kbn/esql", - "@kbn/text-based-editor", + "@kbn/esql-editor", "@kbn/expressions-plugin", "@kbn/core-http-browser", "@kbn/core-doc-links-browser", diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index aa2b38cc19bd0b..c470f0e6937cc1 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7083,13 +7083,13 @@ "telemetry.telemetryOptedInNoticeTitle": "Aidez-nous à améliorer la Suite Elastic.", "telemetry.usageCollectionConstant": "collecte de données d’utilisation", "telemetry.usageDataTitle": "Collecte de données d’utilisation", - "textBasedEditor.query.textBasedLanguagesEditor.aborted": "La demande a été annulée", + "esqlEditor.query.aborted": "La demande a été annulée", "languageDocumentation.documentationESQL.aggregationFunctions": "Fonctions d'agrégation", "languageDocumentation.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "Ces fonctions peuvent être utilisées avec STATS...BY :", - "textBasedEditor.query.textBasedLanguagesEditor.cancel": "Annuler", - "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "Réduire", + "esqlEditor.query.cancel": "Annuler", + "esqlEditor.query.collapseLabel": "Réduire", "languageDocumentation.documentationESQL.commandsDescription": "Une commande source produit un tableau, habituellement avec des données issues d'Elasticsearch. ES|QL est compatible avec les commandes sources suivantes.", - "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "Supprimer les sauts de ligne des barres verticales", + "esqlEditor.query.disableWordWrapLabel": "Supprimer les sauts de ligne des barres verticales", "languageDocumentation.documentationESQL.abs": "ABS", "languageDocumentation.documentationESQL.abs.markdown": "\n\n ### ABS\n Renvoie la valeur absolue.\n\n ````\n Numéro ROW = -1.0 \n | EVAL abs_number = ABS(number)\n ````\n ", "languageDocumentation.documentationESQL.acos": "ACOS", @@ -7315,36 +7315,36 @@ "languageDocumentation.documentationESQL.trim.markdown": "\n\n ### TRIM\n Supprime les espaces de début et de fin d'une chaîne.\n\n ````\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ````\n ", "languageDocumentation.documentationESQL.where": "WHERE", "languageDocumentation.documentationESQL.where.markdown": "### WHERE\nUtilisez `WHERE` afin d'obtenir un tableau qui comprend toutes les lignes du tableau d'entrée pour lesquelles la condition fournie est évaluée à `true` :\n \n````\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n````\n\n#### Opérateurs\n\nPour obtenir un aperçu des opérateurs pris en charge, consultez la section **Opérateurs**.\n\n#### Fonctions\n`WHERE` prend en charge diverses fonctions de calcul des valeurs. Pour en savoir plus, consultez la section **Fonctions**.\n ", - "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", - "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}", - "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "Erreurs", - "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "Développer", - "textBasedEditor.query.textBasedLanguagesEditor.feedback": "Commentaires", + "esqlEditor.query.EnableWordWrapLabel": "Ajouter des sauts de ligne aux barres verticales", + "esqlEditor.query.errorCount": "{count} {count, plural, one {erreur} other {erreurs}}", + "esqlEditor.query.errorsTitle": "Erreurs", + "esqlEditor.query.expandLabel": "Développer", + "esqlEditor.query.feedback": "Commentaires", "languageDocumentation.documentationESQL.functions": "Fonctions", "languageDocumentation.documentationESQL.functionsDocumentationESQLDescription": "Les fonctions sont compatibles avec \"ROW\" (Ligne), \"EVAL\" (Évaluation) et \"WHERE\" (Où).", "languageDocumentation.documentationESQL.groupingFunctions": "Fonctions de groupage", "languageDocumentation.documentationESQL.groupingFunctionsDocumentationESQLDescription": "Ces fonctions de regroupement peuvent être utilisées avec `STATS...BY` :", - "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "Masquer les recherches récentes", - "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, one {ligne} other {lignes}}", - "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "Ligne {lineNumber}", + "esqlEditor.query.hideQueriesLabel": "Masquer les recherches récentes", + "esqlEditor.query.lineCount": "{count} {count, plural, one {ligne} other {lignes}}", + "esqlEditor.query.lineNumber": "Ligne {lineNumber}", "languageDocumentation.documentationESQL.operators": "Opérateurs", "languageDocumentation.documentationESQL.operatorsDocumentationESQLDescription": "ES|QL est compatible avec les opérateurs suivants :", "languageDocumentation.documentationESQL.processingCommands": "Traitement des commandes", "languageDocumentation.documentationESQL.processingCommandsDescription": "Le traitement des commandes transforme un tableau des entrées par l'ajout, le retrait ou la modification des lignes et des colonnes. ES|QL est compatible avec le traitement des commandes suivant.", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "La requête a échouée", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "La requête a été exécuté avec succès", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "Copier la requête dans le presse-papier", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryRun": "Exécuter la requête", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryTable": "Tableau d'historique des recherches", - "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "Recherches récentes", - "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "Exécuter la requête", - "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "Afficher les recherches récentes", + "esqlEditor.query.querieshistory.error": "La requête a échouée", + "esqlEditor.query.querieshistory.success": "La requête a été exécuté avec succès", + "esqlEditor.query.querieshistoryCopy": "Copier la requête dans le presse-papier", + "esqlEditor.query.querieshistoryRun": "Exécuter la requête", + "esqlEditor.query.querieshistoryTable": "Tableau d'historique des recherches", + "esqlEditor.query.recentQueriesColumnLabel": "Recherches récentes", + "esqlEditor.query.runQuery": "Exécuter la requête", + "esqlEditor.query.showQueriesLabel": "Afficher les recherches récentes", "languageDocumentation.documentationESQL.sourceCommands": "Commandes sources", - "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "Soumettre un commentaire", - "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "Temps exécuté", - "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "@timestamp non trouvé", - "textBasedEditor.query.textBasedLanguagesEditor.warningCount": "{count} {count, plural, one {avertissement} other {avertissements}}", - "textBasedEditor.query.textBasedLanguagesEditor.warningsTitle": "Avertissements", + "esqlEditor.query.submitFeedback": "Soumettre un commentaire", + "esqlEditor.query.timeRanColumnLabel": "Temps exécuté", + "esqlEditor.query.timestampNotDetected": "@timestamp non trouvé", + "esqlEditor.query.warningCount": "{count} {count, plural, one {avertissement} other {avertissements}}", + "esqlEditor.query.warningsTitle": "Avertissements", "timelion.emptyExpressionErrorMessage": "Erreur Timelion : aucune expression fournie", "timelion.expressionSuggestions.argument.description.acceptsText": "Accepte", "timelion.expressionSuggestions.func.description.chainableHelpText": "Enchaînable", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index dca8c141ec20cc..fc88d13bdc2736 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7076,268 +7076,28 @@ "telemetry.telemetryOptedInNoticeTitle": "Elastic Stack の改善にご協力ください", "telemetry.usageCollectionConstant": "使用状況の収集", "telemetry.usageDataTitle": "使用状況の収集", - "textBasedEditor.query.textBasedLanguagesEditor.aborted": "リクエストが中断されました", - "languageDocumentation.documentationESQL.aggregationFunctions": "集約関数", - "languageDocumentation.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "これらの関数はSTATS...BYで使用できます。", - "textBasedEditor.query.textBasedLanguagesEditor.cancel": "キャンセル", - "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "縮小", - "languageDocumentation.documentationESQL.commandsDescription": "通常、ソースコマンドはElasticsearchのデータを使ってテーブルを生成します。ES|QLは以下のソースコマンドをサポートしています。", - "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "パイプの改行を削除", - "languageDocumentation.documentationESQL.abs": "ABS", - "languageDocumentation.documentationESQL.abs.markdown": "\n\n ### ABS\n 絶対値を返します。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", - "languageDocumentation.documentationESQL.acos": "ACOS", - "languageDocumentation.documentationESQL.acos.markdown": "\n\n ### ACOS\n nのアークコサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", - "languageDocumentation.documentationESQL.asin": "ASIN", - "languageDocumentation.documentationESQL.asin.markdown": "\n\n ### ASIN\n 入力\n 数値式のアークサインをラジアンで表記された角度として返します。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.atan": "ATAN", - "languageDocumentation.documentationESQL.atan.markdown": "\n\n ### ATAN\n 入力\n 数値式のアークタンジェントをラジアンで表記された角度として返します。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.atan2": "ATAN2", - "languageDocumentation.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 直交平面上の原点から点(x , y)に向かう光線と正のx軸のなす角(ラジアン表記)。\n \n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", - "languageDocumentation.documentationESQL.autoBucketFunction": "BUCKET", - "languageDocumentation.documentationESQL.autoBucketFunction.markdown": "### バケット\n日時または数値入力から、値(バケット)のグループを作成します。バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\nBUCKETは次の2つのモードで動作します。\n\n1.バケットのサイズがバケット数の提案(4つのパラメーター)と範囲に基づいて計算される。\n2.バケットサイズが直接指定される(2つのパラメーター)。\n\n目標バケット数、開始日、終了日を使用すると、目標バケット数以下のバケットを生成するために適切なバケットサイズがBUCKETによって選択されます。\n\nたとえば、1年に最大20バケットをリクエストすると、データが1か月間隔で整理されます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注**:ここでは、正確な目標バケット数を指定するのではなく、目標バケット数を_上限_として範囲を指定します。\n\nBUCKETを集約と組み合わせ、ヒストグラムを作成できます。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注**:BUCKETは、どのドキュメントにも一致しないバケットを作成しません。そのため、前の例では1985-03-01やその他の日付が抜けています。\n\nその他のバケットを要求すると、範囲が小さくなることがあります。たとえば、1年に最大100バケットをリクエストすると、1週間単位のバケットになります。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注**:AUTO_BUCKETは行をフィルタリングしません。指定された範囲のみを使用して、適切なバケットサイズを選択します。範囲外の値の行に対しては、範囲外のバケツに対応するバケット値を返します。行をフィルタリングするには、BUCKETとWHEREを組み合わせます。\n\n事前に任意のバケットサイズがわかっている場合は、2番目の引数として指定し、範囲を除外します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、時間の期間または日付の期間を選択する必要があります。\n\nBUCKETは数値フィールドでも動作します。たとえば、給与ヒストグラムを作成します。\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n日付範囲で意図的フィルタリングする前の例とは異なり、数値フィールドでフィルタリングすることはほとんどありません。最小値と最大値を別々に見つける必要があります。ES|QLにはそれを自動的に実行するための簡単な方法がありません。\n\n任意のバケットサイズが事前にわかっている場合は、範囲を省略できます。2番目の引数として指定します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注**:バケットサイズを2番目のパラメーターとして指定するときには、**浮動小数点数型**でなければなりません。\n\n次の例は、過去24時間の1時間単位のバケットを作成し、1時間当たりのイベント数を計算します。\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n次の例は、1985年の1か月単位のバケットを作成し、採用月別に平均給与を計算します。\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n集約部で関数が**グループ部で定義されたエイリアスによって参照されている**場合、またはまったく同じ式で呼び出されている場合、BUCKETは、 STATS …​ BY …コマンドの集約部とグループ部の両方で使用できます。\n\n例:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "languageDocumentation.documentationESQL.binaryOperators": "バイナリ演算子", - "languageDocumentation.documentationESQL.binaryOperators.markdown": "### バイナリ演算子\n次のバイナリ比較演算子がサポートされています。\n\n* 等号:`==`\n* 不等号:`!=`\n* より小さい:`<`\n* 以下:`<=`\n* より大きい:`>`\n* 以上:`>=`\n* 加算:`+`\n* 減算:`-`\n* 乗算:`*`\n* 除算:`/`\n* 係数:`%`\n ", - "languageDocumentation.documentationESQL.booleanOperators": "ブール演算子", - "languageDocumentation.documentationESQL.booleanOperators.markdown": "### ブール演算子\n次のブール演算子がサポートされています。\n\n* `AND`\n* `OR`\n* `NOT`\n ", - "languageDocumentation.documentationESQL.bucket": "BUCKET", - "languageDocumentation.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 日時または数値入力から、値(バケット)のグループを作成します。\n バケットのサイズは直接指定するか、推奨される数と値の範囲に基づいて選択できます。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", - "languageDocumentation.documentationESQL.case": "CASE", - "languageDocumentation.documentationESQL.case.markdown": "\n\n ### CASE\n 条件と値のペアを指定できます。この関数は、trueと評価される\n 最初の条件に属する値を返します。\n\n 引数の数が奇数の場合、最後の引数は条件に一致しない場合に返されるデフォルト値になります。\n 引数の数が偶数で、\n 条件が一致しない場合、この関数はnullを返します。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", - "languageDocumentation.documentationESQL.castOperator": "Cast (::)", - "languageDocumentation.documentationESQL.castOperator.markdown": "### CAST (`::`)\n::演算子はO_型変換関数に代わる便利な構文です。\n\n例:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", - "languageDocumentation.documentationESQL.cbrt": "CBRT", - "languageDocumentation.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 数値の立方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 無限大の立方根はnullです。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", - "languageDocumentation.documentationESQL.ceil": "CEIL", - "languageDocumentation.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 最も近い整数に数値を切り上げます。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。doubleの場合、JavaのMath.ceilと同様に、整数に最も近いdoubleの値を選びます。\n ", - "languageDocumentation.documentationESQL.cidr_match": "CIDR_MATCH", - "languageDocumentation.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 指定されたIPが指定されたCIDRブロックのいずれかに含まれていればtrueを返します。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", - "languageDocumentation.documentationESQL.coalesce": "COALESCE", - "languageDocumentation.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n nullでない最初の引数を返します。すべての引数がnullの場合はnullを返します。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", - "languageDocumentation.documentationESQL.concat": "CONCAT", - "languageDocumentation.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 2つ以上の文字列を連結します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", - "languageDocumentation.documentationESQL.cos": "COS", - "languageDocumentation.documentationESQL.cos.markdown": "\n\n ### COS\n 角度の余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", - "languageDocumentation.documentationESQL.cosh": "COSH", - "languageDocumentation.documentationESQL.cosh.markdown": "\n\n ### COSH\n 角度の双曲余弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "languageDocumentation.documentationESQL.date_diff": "DATE_DIFF", - "languageDocumentation.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n startTimestampをendTimestampから減算し、unitの乗数の差を返します。\n startTimestampがendTimestampより後の場合は、負の値が返されます。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", - "languageDocumentation.documentationESQL.date_extract": "DATE_EXTRACT", - "languageDocumentation.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 年、月、日、時間など、日付の一部を抽出します。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", - "languageDocumentation.documentationESQL.date_format": "DATE_FORMAT", - "languageDocumentation.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 指定した書式の日付の文字列表現を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", - "languageDocumentation.documentationESQL.date_parse": "DATE_PARSE", - "languageDocumentation.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 最初の引数で指定した形式を使用して、2番目の引数を解析することで、日付を返します。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", - "languageDocumentation.documentationESQL.date_trunc": "DATE_TRUNC", - "languageDocumentation.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 最も近い区間まで日付を切り捨てます。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", - "languageDocumentation.documentationESQL.dissect": "DISSECT", - "languageDocumentation.documentationESQL.dissect.markdown": "### DISSECT\nDISSECTは文字列から構造化データを取り出すことができます。DISSECTは文字列を区切り文字ベースのパターンと照合し、指定されたキーを列として抽出します。\n\ndissectパターンの構文については、[dissectプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)を参照してください。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", - "languageDocumentation.documentationESQL.drop": "DROP", - "languageDocumentation.documentationESQL.drop.markdown": "### DROP\nテーブルから列を削除するには、DROPを使用します。\n \n```\nFROM employees\n| DROP height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて削除することができます。\n\n```\nFROM employees\n| DROP height*\n```\n ", - "languageDocumentation.documentationESQL.e": "E", - "languageDocumentation.documentationESQL.e.markdown": "\n\n ### E\n オイラー数を返します。\n\n ```\n ROW E()\n ```\n ", - "languageDocumentation.documentationESQL.ends_with": "ENDS_WITH", - "languageDocumentation.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n キーワード文字列が他の文字列で終わるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", - "languageDocumentation.documentationESQL.enrich": "ENRICH", - "languageDocumentation.documentationESQL.enrich.markdown": "### ENRICH\nENRICH`を使用すると、既存のインデックスのデータを受信レコードに追加することができます。[インジェストエンリッチ](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html)と似ていますが、クエリー時に動作します。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\nENRICHでは、[エンリッチポリシー](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)を実行する必要があります。エンリッチポリシーは、一致フィールド (キーフィールド) とエンリッチフィールドのセットを定義します。\n\nENRICHは、一致フィールド値に基づいて、[エンリッチインデックス](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)のレコードを検索します。入力データセットの一致するキーは、ON を使用して定義できます。指定しない場合は、エンリッチポリシーで定義された一致フィールドと同じ名前のフィールドで一致が実行されます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\nWITH , ...構文を使用して、結果に追加される属性(ポリシーでエンリッチフィールドとして定義された属性の間)を指定できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n属性の名前は、WITH new_name=を使用して変更できます。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\nデフォルトでは、(WITHが定義されていない場合)、ENRICHはエンリッチポリシーで定義されたすべてのエンリッチフィールドを結果に追加します。\n\n名前の競合が発生した場合、新しく作成されたフィールドが既存のフィールドを上書きします。\n ", - "languageDocumentation.documentationESQL.eval": "EVAL", - "languageDocumentation.documentationESQL.eval.markdown": "### EVAL\nEVALでは、新しい列を追加できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n指定した列がすでに存在する場合、既存の列は削除され、新しい列がテーブルに追加されます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 関数\nEVALは値を計算するためのさまざまな関数をサポートしています。関数をクリックすると詳細が表示されます。\n ", - "languageDocumentation.documentationESQL.floor": "FLOOR", - "languageDocumentation.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 最も近い整数に数値を切り捨てます。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注:これはlong(符号なしを含む)とintegerのnoopです。\n doubleの場合、Math.floorと同様に、整数に最も近いdoubleの値を選びます。\n \n ", - "languageDocumentation.documentationESQL.from": "FROM", - "languageDocumentation.documentationESQL.from_base64": "FROM_BASE64", - "languageDocumentation.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n base64文字列をデコードします。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", - "languageDocumentation.documentationESQL.from.markdown": "### FROM\nソースコマンドFROMは、データストリーム、インデックス、またはエイリアスから、最大10,000ドキュメントを含むテーブルを返します。結果のテーブルの各行はドキュメントを表します。各列はフィールドに対応し、そのフィールドの名前でアクセスできます。\n\n```\nFROM employees\n```\n\n[日付演算](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names) を使用して、インデックス、エイリアス、データストリームを参照できます。これは時系列データの場合に便利です。\n\nカンマ区切りのリストまたはワイルドカードを使用して、複数のデータストリーム、インデックス、またはエイリアスをクエリーします。\n\n```\nFROM employees-00001,employees-*\n```\n\n#### メタデータ\n\nES|QLは以下のメタデータフィールドにアクセスできます。\n\n* `_index`:ドキュメントが属するインデックス。このフィールドはkeyword型です。\n* `_id`:ソースドキュメントのID。このフィールドはkeyword型です。### `_version`:ソースドキュメントのバージョン。フィールドの型はlongです。\n\nメタデータフィールドを有効にするには、METADATAディレクティブを使います。\n\n```\nFROM index [METADATA _index, _id]\n```\n\nメタデータフィールドは、データのソースがインデックスである場合にのみ使用できます。その結果、FROMはMETADATAディレクティブをサポートする唯一のソースコマンドです。\n\nこのフィールドが有効になると、他のインデックスフィールドと同様に、後続の処理コマンドで利用できるようになります。\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\nまた、インデックス・フィールドと同様に、一度集約が実行されると、グループ化フィールドとして使用されないかぎり、メタデータフィールドは後続のコマンドからはアクセスできなくなります。\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", - "languageDocumentation.documentationESQL.greatest": "GREATEST", - "languageDocumentation.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 多数の列から最大値を返します。これはMV_MAX\n と似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注:keywordまたはtextフィールドに対して実行すると、アルファベット順の最後の文字列を返します。boolean列に対して実行すると、値がtrueの場合にtrueを返します。\n ", - "languageDocumentation.documentationESQL.grok": "GROK", - "languageDocumentation.documentationESQL.grok.markdown": "### GROK\nGROKを使うと、文字列から構造化データを抽出できます。GROKは正規表現に基づいて文字列をパターンと一致させ、指定されたパターンを列として抽出します。\n\ngrokパターンの構文については、 [grokプロセッサードキュメント](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)を参照してください。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", - "languageDocumentation.documentationESQL.inOperator": "IN", - "languageDocumentation.documentationESQL.inOperator.markdown": "### IN\nIN演算子は、フィールドや式がリテラル、フィールド、式のリストの要素と等しいかどうかをテストすることができます。\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", - "languageDocumentation.documentationESQL.ip_prefix": "IP_PREFIX", - "languageDocumentation.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n IPを特定のプレフィックス長に切り詰めます。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", - "languageDocumentation.documentationESQL.keep": "KEEP", - "languageDocumentation.documentationESQL.keep.markdown": "### KEEP\nKEEPコマンドは、返される列と、列が返される順序を指定することができます。\n\n返される列を制限するには、カンマで区切りの列名リストを使用します。列は指定された順序で返されます。\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n各列を名前で指定するのではなく、ワイルドカードを使って、パターンと一致する名前の列をすべて返すことができます。\n\n```\nFROM employees\n| KEEP h*\n```\n\nアスタリスクワイルドカード(*)は単独で、他の引数と一致しないすべての列に変換されます。このクエリーは、最初にhで始まる名前の列をすべて返し、その後にその他の列をすべて返します。\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", - "languageDocumentation.documentationESQL.least": "LEAST", - "languageDocumentation.documentationESQL.least.markdown": "\n\n ### LEAST\n 多数の列から最小値を返します。これはMV_MINと似ていますが、一度に複数の列に対して実行します。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", - "languageDocumentation.documentationESQL.left": "LEFT", - "languageDocumentation.documentationESQL.left.markdown": "\n\n ### LEFT\n stringから左から順にlength文字を抜き出したサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "languageDocumentation.documentationESQL.length": "LENGTH", - "languageDocumentation.documentationESQL.length.markdown": "\n\n ### LENGTH\n 文字列の文字数を返します。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", - "languageDocumentation.documentationESQL.limit": "LIMIT", - "languageDocumentation.documentationESQL.limit.markdown": "### LIMIT\nLIMIT`処理コマンドは行数を制限することができます。\n \n```\nFROM employees\n| LIMIT 5\n```\n ", - "languageDocumentation.documentationESQL.locate": "LOCATE", - "languageDocumentation.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 別の文字列内のキーワードサブ文字列の位置を示す整数を返します。\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", - "languageDocumentation.documentationESQL.log": "LOG", - "languageDocumentation.documentationESQL.log.markdown": "\n\n ### LOG\n 基数に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n ゼロの対数、負数、1の基数はnullと警告を返します。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", - "languageDocumentation.documentationESQL.log10": "LOG10", - "languageDocumentation.documentationESQL.log10.markdown": "\n\n ### LOG10\n 基数10に対する値の対数を返します。入力は任意の数値で、戻り値は常にdoubleです。\n\n 0の対数および負数はnullと警告を返します。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", - "languageDocumentation.documentationESQL.ltrim": "LTRIM", - "languageDocumentation.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 文字列から先頭の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "languageDocumentation.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch クエリー言語)クエリーは、パイプ文字の|で区切られた一連のコマンドで構成されます。各クエリーは**ソースコマンド**で始まり、通常はElasticsearchのデータを使ってテーブルを生成します。\n\nソースコマンドには、1つ以上の**処理コマンド**を続けることができます。処理コマンドは、行や列を追加、削除、変更することで、前のコマンドの出力テーブルを変更することができます。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\nクエリーの結果は、最終的な処理コマンドによって生成されるテーブルです。 \n ", - "languageDocumentation.documentationESQL.mv_append": "MV_APPEND", - "languageDocumentation.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 2つの複数値フィールドの値を連結します\n\n ", - "languageDocumentation.documentationESQL.mv_avg": "MV_AVG", - "languageDocumentation.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 複数値フィールドを、すべての値の平均を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_concat": "MV_CONCAT", - "languageDocumentation.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 複数値文字列式を、区切り文字で区切られたすべての値を連結した単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", - "languageDocumentation.documentationESQL.mv_count": "MV_COUNT", - "languageDocumentation.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 複数値式を、値の数をカウントする単一値列に変換します。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_dedupe": "MV_DEDUPE", - "languageDocumentation.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 複数値フィールドから重複する値を削除します。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注:MV_DEDUPEは列の値をソートすることがありますが、常にソートするわけではありません。\n ", - "languageDocumentation.documentationESQL.mv_first": "MV_FIRST", - "languageDocumentation.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n \n 複数値式を、最初の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最小値が必要な場合は、MV_FIRSTの代わりに、MV_MINを使用します。\n MV_MINは、ソートされた値向けに最適化されているため、\n MV_FIRSTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", - "languageDocumentation.documentationESQL.mv_last": "MV_LAST", - "languageDocumentation.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n \n 複数値式を、最後の値を含む単一値列に変換します。これは、SPLITなどの既知の順序で複数値列を発行する関数から読み取るときに役立ちます。\n \n\n 複数値フィールドが基本ストレージから読み取られる順序は保証されません。\n \n 通常は昇順ですが、必ずしもそうであるわけではありません。最大値が必要な場合は、MV_LASTの代わりに、MV_MAXを使用します。\n MV_MAXは、ソートされた値向けに最適化されているため、\n MV_LASTにパフォーマンスの利点はありません。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", - "languageDocumentation.documentationESQL.mv_max": "MV_MAX", - "languageDocumentation.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 複数値フィールドを、最大値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_median": "MV_MEDIAN", - "languageDocumentation.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 複数値フィールドを、中央値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_min": "MV_MIN", - "languageDocumentation.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 複数値フィールドを、最小値を含む単一値フィールドに変換します。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_slice": "MV_SLICE", - "languageDocumentation.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 開始インデックス値と終了インデックス値を使用して、複数値フィールドのサブセットを返します。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", - "languageDocumentation.documentationESQL.mv_sort": "MV_SORT", - "languageDocumentation.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 辞書の順序で複数値フィールドを並べ替えます。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", - "languageDocumentation.documentationESQL.mv_sum": "MV_SUM", - "languageDocumentation.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 複数値フィールドを、すべての値の合計を含む単一値フィールドに変換します。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_zip": "MV_ZIP", - "languageDocumentation.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 値を結合する区切り文字を使用して、2つの複数値フィールドの値を結合します。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", - "languageDocumentation.documentationESQL.mvExpand": "MV_EXPAND", - "languageDocumentation.documentationESQL.mvExpand.markdown": "### MV_EXPAND\nMV_EXPAND処理コマンドは、複数値フィールドを値ごとに1行に展開し、他のフィールドを複製します。 \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", - "languageDocumentation.documentationESQL.now": "NOW", - "languageDocumentation.documentationESQL.now.markdown": "\n\n ### NOW\n 現在の日付と時刻を返します。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "languageDocumentation.documentationESQL.pi": "PI", - "languageDocumentation.documentationESQL.pi.markdown": "\n\n ### PI\n 円の円周と直径の比率であるPiを返します。\n\n ```\n ROW PI()\n ```\n ", - "languageDocumentation.documentationESQL.pow": "POW", - "languageDocumentation.documentationESQL.pow.markdown": "\n\n ### POW\n exponentのべき乗にしたbaseの値を返します。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注:ここでは、倍精度浮動小数点数の結果でもオーバーフローする可能性があります。その場合は、NULLが返されます。\n ", - "languageDocumentation.documentationESQL.predicates": "NULL値", - "languageDocumentation.documentationESQL.predicates.markdown": "### NULL値\nNULLの比較には、IS NULLとIS NOT NULL述語を使います。\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", - "languageDocumentation.documentationESQL.rename": "RENAME", - "languageDocumentation.documentationESQL.rename.markdown": "### RENAME\nRENAMEを使用して、次の構文で列の名前を変更します。\n\n```\nRENAME AS \n```\n\n例:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n新しい名前の列がすでに存在する場合、その列は新しい列に置き換えられます。\n\n複数の列の名前を1つのRENAMEコマンドで変更することができます。\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", - "languageDocumentation.documentationESQL.repeat": "REPEAT", - "languageDocumentation.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 指定したnumberの回数、文字列stringとそれ自身を連結して構成された文字列を返します。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", - "languageDocumentation.documentationESQL.replace": "REPLACE", - "languageDocumentation.documentationESQL.replace.markdown": "\n\n ### REPLACE\n \n この関数は、正規表現regexと置換文字列newStrの任意の一致を文字列strに代入します。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", - "languageDocumentation.documentationESQL.right": "RIGHT", - "languageDocumentation.documentationESQL.right.markdown": "\n\n ### RIGHT\n strのうち右から数えてlength文字までのサブ文字列を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "languageDocumentation.documentationESQL.round": "ROUND", - "languageDocumentation.documentationESQL.round.markdown": "\n\n ### ROUND\n 数値を指定した小数点以下の桁数に丸めます。\n デフォルトは0で、最も近い整数を返します。\n 精度が負の場合、小数点以下の桁数に丸めます。\n \n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", - "languageDocumentation.documentationESQL.row": "ROW", - "languageDocumentation.documentationESQL.row.markdown": "### ROW\nROWソースコマンドは、指定した値の列を1つ以上含む行を作成します。これはテストの場合に便利です。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n複数の値を含む列を作成するには角括弧を使用します。\n\n```\nROW a = [2, 1]\n```\n\nROWは関数の使用をサポートしています。\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", - "languageDocumentation.documentationESQL.rtrim": "RTRIM", - "languageDocumentation.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 文字列から末尾の空白を取り除きます。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "languageDocumentation.documentationESQL.show": "SHOW", - "languageDocumentation.documentationESQL.show.markdown": "### SHOW\nSHOW ソースコマンドはデプロイとその能力に関する情報を返します。\n\n* デプロイのバージョン、ビルド日、ハッシュを返すには、SHOW INFOを使用します。\n* SHOW FUNCTIONSを使用すると、サポートされているすべての関数のリストと各関数の概要を返します。\n ", - "languageDocumentation.documentationESQL.signum": "SIGNUM", - "languageDocumentation.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 任意の数値の符号を返します。\n 負の数値の場合は-1を返します。0の場合は0を返します。正の数値の場合は1を返します。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", - "languageDocumentation.documentationESQL.sin": "SIN", - "languageDocumentation.documentationESQL.sin.markdown": "\n\n ### SIN\n 角度の正弦三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.sinh": "SINH", - "languageDocumentation.documentationESQL.sinh.markdown": "\n\n ### SINH\n 角度の双曲線正弦を返します。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", - "languageDocumentation.documentationESQL.sort": "SORT", - "languageDocumentation.documentationESQL.sort.markdown": "### SORT\nSORTコマンドを使用すると、1つ以上のフィールドで行をソートすることができます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\nデフォルトのソート順は昇順です。ASCまたはDESCを使って明示的なソート順を設定します。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n2つの行のソートキーが同じ場合、元の順序が保持されます。タイブレーカーとなるソート式を追加で指定できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### null値\nデフォルトでは、null値は他のどの値よりも大きい値として扱われます。昇順のソートではnull値は最後にソートされ、降順のソートではnull値は最初にソートされます。NULLS FIRSTまたはNULLS LASTを指定することで変更できます。\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", - "languageDocumentation.documentationESQL.split": "SPLIT", - "languageDocumentation.documentationESQL.split.markdown": "\n\n ### SPLIT\n 単一の値の文字列を複数の文字列に分割します。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", - "languageDocumentation.documentationESQL.sqrt": "SQRT", - "languageDocumentation.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 数値の平方根を返します。入力は任意の数値で、戻り値は常にdoubleです。\n 負数と無限大の平方根はnullです。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", - "languageDocumentation.documentationESQL.st_contains": "ST_CONTAINS", - "languageDocumentation.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 最初のジオメトリに2番目のジオメトリが含まれるかどうかを返します。\n これはST_WITHIN関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_disjoint": "ST_DISJOINT", - "languageDocumentation.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 2つのジオメトリまたはジオメトリ列が結合解除されているかどうかを返します。\n これはST_INTERSECTS関数の逆関数です。\n 数学的には次のようになります。ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_distance": "ST_DISTANCE", - "languageDocumentation.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 2点間の距離を計算します。\n デカルト幾何学の場合、これは元の座標と同じ単位でのピタゴラス距離です。\n 地理的幾何学では、これはメートル単位での円に沿った円周距離です。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", - "languageDocumentation.documentationESQL.st_intersects": "ST_INTERSECTS", - "languageDocumentation.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 2つのジオメトリが交差している場合はTrueを返します。\n 内部点を含め、共通の点がある場合は交差しています\n (線に沿った点または多角形内の点)。\n これはST_DISJOINT関数の逆関数です。\n 数学的には次のようになります。ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", - "languageDocumentation.documentationESQL.st_within": "ST_WITHIN", - "languageDocumentation.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 最初のジオメトリが2番目のジオメトリ内にあるかどうかを返します。\n これはST_CONTAINS関数の逆関数です。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_x": "ST_X", - "languageDocumentation.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 指定された点からx座標を抽出します。\n この点がgeo_pointタイプの場合は、longitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "languageDocumentation.documentationESQL.st_y": "ST_Y", - "languageDocumentation.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 指定された点からy座標を抽出します。\n この点がgeo_pointタイプの場合は、latitude値を抽出するのと同じ結果になります。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "languageDocumentation.documentationESQL.starts_with": "STARTS_WITH", - "languageDocumentation.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n キーワード文字列が他の文字列で始まるかどうかを示すブール値を返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", - "languageDocumentation.documentationESQL.statsby": "STATS ...BY", - "languageDocumentation.documentationESQL.statsby.markdown": "### STATS ...BY\nSTATS ...BYを使用すると、共通の値に従って行をグループ化し、グループ化された行に対する1つ以上の集約値を計算します。\n\n**例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\nBYが省略された場合、出力テーブルには、データセット全体に適用された集約が正確に1行だけ含まれます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n複数の値を計算することができます。\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n複数の値でグループ化することも可能です(longおよびkeywordファミリーフィールドでのみサポート)。\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\nSTATS ...BYで使用できる関数の一覧については、**集計関数**を参照してください。\n\n集計関数とグループ式の両方で他の関数を使用できます。これは、複数値列でSTATS...BYを使用するときに有用です。たとえば、平均給与変動を計算するには、まず、MV_AVGを使用して従業員ごとに複数の値の平均を求め、その結果にAVG関数を適用します。\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n式によるグループ化の例は、姓の最初の文字で従業員をグループ化することです。\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n出力列名の指定は任意です。指定しない場合は、新しい列名が式と等しくなります。次のクエリーは列\"AVG(salary)\"を返します。\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\nこの名前には特殊文字が含まれているため、後続のコマンドで使用するときには、バッククオート(`)で囲む必要があります。\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注**:グループなしのSTATSは、グループを追加するよりも大幅に高速です。\n\n**注**:単一式でのグループは、現在、複数式でのグループよりも大幅に最適化されています。\n ", - "languageDocumentation.documentationESQL.stringOperators": "LIKEおよびRLIKE", - "languageDocumentation.documentationESQL.stringOperators.markdown": "### LIKEおよびRLIKE\nワイルドカードや正規表現を使った文字列比較にはLIKEまたはRLIKEを使います。\n\nワイルドカードを使って文字列を一致させるにはLIKEを使います。次のワイルドカード文字がサポートされています。\n\n* `*`は0文字以上と一致します。\n* `?`は1文字と一致します。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n正規表現を使って文字列を一致させるには、RLIKEを使います。\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", - "languageDocumentation.documentationESQL.substring": "SUBSTRING", - "languageDocumentation.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 文字列のサブ文字列を、開始位置とオプションの長さで指定して返します。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "languageDocumentation.documentationESQL.tan": "TAN", - "languageDocumentation.documentationESQL.tan.markdown": "\n\n ### TAN\n 角度の正接三角関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.tanh": "TANH", - "languageDocumentation.documentationESQL.tanh.markdown": "\n\n ### TANH\n 角度の正接双曲線関数を返します。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", - "languageDocumentation.documentationESQL.tau": "TAU", - "languageDocumentation.documentationESQL.tau.markdown": "\n\n ### TAU\n 円の円周と半径の比率を返します。\n\n ```\n ROW TAU()\n ```\n ", - "languageDocumentation.documentationESQL.to_base64": "TO_BASE64", - "languageDocumentation.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 文字列をbase64文字列にエンコードします。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", - "languageDocumentation.documentationESQL.to_boolean": "TO_BOOLEAN", - "languageDocumentation.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 入力値をブール値に変換します。\n 文字列値*true*は、大文字小文字を区別せずにブール値*true*に変換されます。\n 空文字列を含むそれ以外の値に対しては、この関数は*false*を返します。\n 数値*0*は*false*に変換され、それ以外は*true*に変換されます。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", - "languageDocumentation.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", - "languageDocumentation.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 入力値をcartesian_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", - "languageDocumentation.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 入力値をcartesian_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_datetime": "TO_DATETIME", - "languageDocumentation.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 入力値を日付値に変換します。\n 文字列は、yyyy-MM-dd'T'HH:mm:ss.SSS'Z'の書式に従っている場合のみ変換が成功します。\n 日付を他の形式に変換するには、DATE_PARSEを使用します。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", - "languageDocumentation.documentationESQL.to_degrees": "TO_DEGREES", - "languageDocumentation.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n ラジアンの数値を度数に変換します。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", - "languageDocumentation.documentationESQL.to_double": "TO_DOUBLE", - "languageDocumentation.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 入力値をdouble値に変換します。入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、doubleに変換されます。\n \n ブール値の*true*はdouble値の*1.0*に、*false*は*0.0*に変換されます。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", - "languageDocumentation.documentationESQL.to_geopoint": "TO_GEOPOINT", - "languageDocumentation.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 入力値をgeo_point値に変換します。\n 文字列は、WKT Point形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_geoshape": "TO_GEOSHAPE", - "languageDocumentation.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 入力値をgeo_shape値に変換します。\n 文字列は、WKT形式に従っている場合にのみ、正常に変換されます。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_integer": "TO_INTEGER", - "languageDocumentation.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 入力値を整数値に変換します。\n 入力パラメーターが日付型の場合、その値はUnixのエポックからのミリ秒として解釈され、整数に変換されます。\n \n ブール値*true*は整数*1*に、*false*は*0*に変換されます。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", - "languageDocumentation.documentationESQL.to_ip": "TO_IP", - "languageDocumentation.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 入力文字列をIP値に変換します。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", - "languageDocumentation.documentationESQL.to_long": "TO_LONG", - "languageDocumentation.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 入力値をlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、longに変換されます。\n ブール値の*true*は*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", - "languageDocumentation.documentationESQL.to_lower": "TO_LOWER", - "languageDocumentation.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 小文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", - "languageDocumentation.documentationESQL.to_radians": "TO_RADIANS", - "languageDocumentation.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 度数をラジアンに変換します。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", - "languageDocumentation.documentationESQL.to_string": "TO_STRING", - "languageDocumentation.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 入力値を文字列に変換します。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", - "languageDocumentation.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", - "languageDocumentation.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 入力値を符号なしlong値に変換します。入力パラメーターが日付型の場合、\n その値はUnixのエポックからのミリ秒として解釈され、符号なしlong値に変換されます。\n ブール値の*true*は符号なし*long*値の*1*に、*false*は*0*に変換されます。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", - "languageDocumentation.documentationESQL.to_upper": "TO_UPPER", - "languageDocumentation.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 大文字に変換された入力文字列を表す新しい文字列を返します。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", - "languageDocumentation.documentationESQL.to_version": "TO_VERSION", - "languageDocumentation.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 入力文字列をバージョン値に変換します。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", - "languageDocumentation.documentationESQL.trim": "TRIM", - "languageDocumentation.documentationESQL.trim.markdown": "\n\n ### TRIM\n 文字列から先頭と末尾の空白を削除します。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "languageDocumentation.documentationESQL.where": "WHERE", - "languageDocumentation.documentationESQL.where.markdown": "### WHERE\nWHEREを使用すると、入力テーブルから、指定した条件がtrueと評価されるすべての行を含むテーブルを作成します。\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 演算子\n\nサポートされている演算子の概要については、**演算子**を参照してください。\n\n#### 関数\nWHEREは値を計算するためのさまざまな関数をサポートしています。**関数**をクリックすると詳細が表示されます。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "パイプの改行を追加", - "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} {count, plural, other {# 件のエラー}}", - "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "エラー", - "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "拡張", - "textBasedEditor.query.textBasedLanguagesEditor.feedback": "フィードバック", - "languageDocumentation.documentationESQL.functions": "関数", - "languageDocumentation.documentationESQL.functionsDocumentationESQLDescription": "関数はROW、EVAL、WHEREでサポートされています。", - "languageDocumentation.documentationESQL.groupingFunctions": "グループ関数", - "languageDocumentation.documentationESQL.groupingFunctionsDocumentationESQLDescription": "これらのグループ関数はSTATS...BYで使用できます。", - "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "最近のクエリーを非表示", - "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, other {行}}", - "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "行{lineNumber}", - "languageDocumentation.documentationESQL.operators": "演算子", - "languageDocumentation.documentationESQL.operatorsDocumentationESQLDescription": "ES|QLは以下の演算子をサポートしています。", - "languageDocumentation.documentationESQL.processingCommands": "処理コマンド", - "languageDocumentation.documentationESQL.processingCommandsDescription": "処理コマンドは、行や列を追加、削除、変更することによって入力テーブルを変更します。ES|QLは以下の処理コマンドをサポートしています。", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "クエリ失敗", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "クエリは正常に実行されました", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "クエリをクリップボードにコピー", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryRun": "クエリーを実行", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryTable": "クエリ履歴テーブル", - "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "最近のクエリー", - "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "クエリーを実行", - "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "最近のクエリを表示", - "languageDocumentation.documentationESQL.sourceCommands": "ソースコマンド", - "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "フィードバックを送信", - "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "実行時間", - "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "@timestampが見つかりません", - "textBasedEditor.query.textBasedLanguagesEditor.warningCount": "{count} {count, plural, other {件の警告}}", - "textBasedEditor.query.textBasedLanguagesEditor.warningsTitle": "警告", + "esqlEditor.query.aborted": "リクエストが中断されました", + "esqlEditor.query.EnableWordWrapLabel": "パイプの改行を追加", + "esqlEditor.query.errorCount": "{count} {count, plural, other {# 件のエラー}}", + "esqlEditor.query.errorsTitle": "エラー", + "esqlEditor.query.expandLabel": "拡張", + "esqlEditor.query.feedback": "フィードバック", + "esqlEditor.query.hideQueriesLabel": "最近のクエリーを非表示", + "esqlEditor.query.lineCount": "{count} {count, plural, other {行}}", + "esqlEditor.query.lineNumber": "行{lineNumber}", + "esqlEditor.query.querieshistory.error": "クエリ失敗", + "esqlEditor.query.querieshistory.success": "クエリは正常に実行されました", + "esqlEditor.query.querieshistoryCopy": "クエリをクリップボードにコピー", + "esqlEditor.query.querieshistoryRun": "クエリーを実行", + "esqlEditor.query.querieshistoryTable": "クエリ履歴テーブル", + "esqlEditor.query.recentQueriesColumnLabel": "最近のクエリー", + "esqlEditor.query.runQuery": "クエリーを実行", + "esqlEditor.query.showQueriesLabel": "最近のクエリを表示", + "esqlEditor.query.submitFeedback": "フィードバックを送信", + "esqlEditor.query.timeRanColumnLabel": "実行時間", + "esqlEditor.query.timestampNotDetected": "@timestampが見つかりません", + "esqlEditor.query.warningCount": "{count} {count, plural, other {件の警告}}", + "esqlEditor.query.warningsTitle": "警告", "timelion.emptyExpressionErrorMessage": "Timelion エラー:式が入力されていません", "timelion.expressionSuggestions.argument.description.acceptsText": "受け入れ", "timelion.expressionSuggestions.func.description.chainableHelpText": "連鎖可能", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8f6e55d1d83695..358bd91cf2d022 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7089,268 +7089,31 @@ "telemetry.telemetryOptedInNoticeTitle": "帮助我们改进 Elastic Stack", "telemetry.usageCollectionConstant": "使用情况收集", "telemetry.usageDataTitle": "使用情况收集", - "textBasedEditor.query.textBasedLanguagesEditor.aborted": "请求已中止", - "languageDocumentation.documentationESQL.aggregationFunctions": "聚合函数", - "languageDocumentation.documentationESQL.aggregationFunctionsDocumentationESQLDescription": "这些函数可以与 STATS...BY 搭配使用:", - "textBasedEditor.query.textBasedLanguagesEditor.cancel": "取消", - "textBasedEditor.query.textBasedLanguagesEditor.collapseLabel": "折叠", - "languageDocumentation.documentationESQL.commandsDescription": "源命令会生成一个表,其中通常包含来自 Elasticsearch 的数据。ES|QL 支持以下源命令。", - "textBasedEditor.query.textBasedLanguagesEditor.disableWordWrapLabel": "移除管道符上的换行符", - "languageDocumentation.documentationESQL.abs": "ABS", - "languageDocumentation.documentationESQL.abs.markdown": "\n\n ### ABS\n 返回绝对值。\n\n ```\n ROW number = -1.0 \n | EVAL abs_number = ABS(number)\n ```\n ", - "languageDocumentation.documentationESQL.acos": "ACOS", - "languageDocumentation.documentationESQL.acos.markdown": "\n\n ### ACOS\n 返回 `n` 的反余弦作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL acos=ACOS(a)\n ```\n ", - "languageDocumentation.documentationESQL.asin": "ASIN", - "languageDocumentation.documentationESQL.asin.markdown": "\n\n ### ASIN\n 返回输入数字表达式的反正弦\n 作为角度,以弧度表示。\n\n ```\n ROW a=.9\n | EVAL asin=ASIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.atan": "ATAN", - "languageDocumentation.documentationESQL.atan.markdown": "\n\n ### ATAN\n 返回输入数字表达式的反正切\n 作为角度,以弧度表示。\n\n ```\n ROW a=12.9\n | EVAL atan=ATAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.atan2": "ATAN2", - "languageDocumentation.documentationESQL.atan2.markdown": "\n\n ### ATAN2\n 笛卡儿平面中正 x 轴\n 与从原点到点 (x , y) 构成的射线之间的角度,以弧度表示。\n\n ```\n ROW y=12.9, x=.6\n | EVAL atan2=ATAN2(y, x)\n ```\n ", - "languageDocumentation.documentationESQL.autoBucketFunction": "BUCKET", - "languageDocumentation.documentationESQL.autoBucketFunction.markdown": "### BUCKET\n用日期时间或数字输入创建值(存储桶)的分组。存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n`BUCKET` 以两种模式运行:\n\n1.在此模式下基于存储桶计数建议(四个参数)和范围计算存储桶的大小。\n2.在此模式下直接提供存储桶大小(两个参数)。\n\n使用存储桶的目标数量、起始范围和结束范围,`BUCKET` 将选取适当的存储桶大小以生成目标数量或更小数量的存储桶。\n\n例如,一年请求多达 20 个存储桶会按每月时间间隔组织数据:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT hire_date\n```\n\n**注意**:目标并不是提供存储桶的确切目标数量,而是选择一个范围,最多提供存储桶的目标数量。\n\n可以组合 `BUCKET` 与聚合以创建直方图:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT month\n```\n\n**注意**:`BUCKET` 不会创建未匹配任何文档的存储桶。因此,上一示例缺少 `1985-03-01` 和其他日期。\n\n如果需要更多存储桶,可能导致更小的范围。例如,如果一年内最多请求 100 个存储桶,会导致周期为周的存储桶:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT week\n```\n\n**注意**:`AUTO_BUCKET` 不筛选任何行。它只会使用提供的范围来选取适当的存储桶大小。对于值超出范围的行,它会返回与超出范围的存储桶对应的存储桶值。组合 `BUCKET` 与 `WHERE` 可筛选行。\n\n如果提前已知所需存储桶大小,则只需提供它作为第二个参数,而忽略范围:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为持续时间或日期期间。\n\n`BUCKET` 还可对数字字段执行操作。例如,要创建工资直方图:\n\n```\nFROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs\n```\n\n与前面的有意筛选日期范围示例不同,您极少想要筛选数值范围。您必须分别查找最小值和最大值。ES|QL 尚未提供简便方法来自动执行此操作。\n\n如果提前已知所需存储桶大小,则可以忽略该范围。只需提供它作为第二个参数即可:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b\n```\n\n**注意**:提供存储桶大小作为第二个参数时,它必须为 **浮点类型**。\n\n这里提供了一个示例,用于为过去 24 小时创建小时存储桶,并计算每小时的事件数:\n\n```\nFROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())\n```\n\n这里提供了一个示例,用于为 1985 年创建月度存储桶,并按聘用月份计算平均工资:\n\n```\nFROM employees\n| WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n| SORT bucket\n```\n\n`BUCKET` 可用在 `STATS …​ BY …`​ 命令的聚合和分组部分, 前提是在聚合部分中,该函数 **由在分组部分中定义的别名引用**,或使用完全相同的表达式调用。\n\n例如:\n\n```\nFROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2\n```\n ", - "languageDocumentation.documentationESQL.binaryOperators": "二进制运算符", - "languageDocumentation.documentationESQL.binaryOperators.markdown": "### 二进制运算符\n支持这些二进制比较运算符:\n\n* 等于:`==`\n* 不等于:`!=`\n* 小于:`<`\n* 小于或等于:`<=`\n* 大于:`>`\n* 大于或等于:`>=`\n* 加:`+`\n* 减:`-`\n* 乘:`*`\n* 除:`/`\n* 取模:`%`\n ", - "languageDocumentation.documentationESQL.booleanOperators": "布尔运算符", - "languageDocumentation.documentationESQL.booleanOperators.markdown": "### 布尔运算符\n支持以下布尔运算符:\n\n* `AND`\n* `OR`\n* `NOT`\n ", - "languageDocumentation.documentationESQL.bucket": "BUCKET", - "languageDocumentation.documentationESQL.bucket.markdown": "\n\n ### BUCKET\n 用日期时间或数字输入创建值(存储桶)的分组。\n 存储桶的大小可以直接提供,或基于建议的计数和值范围进行选择。\n\n ```\n FROM employees\n | WHERE hire_date >= \"1985-01-01T00:00:00Z\" AND hire_date < \"1986-01-01T00:00:00Z\"\n | STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, \"1985-01-01T00:00:00Z\", \"1986-01-01T00:00:00Z\")\n | SORT hire_date\n ```\n ", - "languageDocumentation.documentationESQL.case": "CASE", - "languageDocumentation.documentationESQL.case.markdown": "\n\n ### CASE\n 接受成对的条件和值。此函数返回属于第一个\n 评估为 `true` 的条件的值。\n\n 如果参数数量为奇数,则最后一个参数为\n 在无条件匹配时返回的默认值。如果参数数量为偶数,且\n 无任何条件匹配,则此函数返回 `null`。\n\n ```\n FROM employees\n | EVAL type = CASE(\n languages <= 1, \"monolingual\",\n languages <= 2, \"bilingual\",\n \"polyglot\")\n | KEEP emp_no, languages, type\n ```\n ", - "languageDocumentation.documentationESQL.castOperator": "Cast (::)", - "languageDocumentation.documentationESQL.castOperator.markdown": "### CAST (`::`)\n`::` 运算符为 `TO_` 类型转换函数提供了实用的替代语法。\n\n例如:\n```\nROW ver = CONCAT((\"0\"::INT + 1)::STRING, \".2.3\")::VERSION\n```\n ", - "languageDocumentation.documentationESQL.cbrt": "CBRT", - "languageDocumentation.documentationESQL.cbrt.markdown": "\n\n ### CBRT\n 返回数字的立方根。输入可以为任何数字值,返回值始终为双精度值。\n 无穷大的立方根为 null。\n\n ```\n ROW d = 1000.0\n | EVAL c = cbrt(d)\n ```\n ", - "languageDocumentation.documentationESQL.ceil": "CEIL", - "languageDocumentation.documentationESQL.ceil.markdown": "\n\n ### CEIL\n 将数字四舍五入为最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=CEIL(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。对于 `double`,这会提取最接近整数的 `double` 值,类似于 Math.ceil。\n ", - "languageDocumentation.documentationESQL.cidr_match": "CIDR_MATCH", - "languageDocumentation.documentationESQL.cidr_match.markdown": "\n\n ### CIDR_MATCH\n 如果提供的 IP 包含在所提供的其中一个 CIDR 块中,则返回 true。\n\n ```\n FROM hosts \n | WHERE CIDR_MATCH(ip1, \"127.0.0.2/32\", \"127.0.0.3/32\") \n | KEEP card, host, ip0, ip1\n ```\n ", - "languageDocumentation.documentationESQL.coalesce": "COALESCE", - "languageDocumentation.documentationESQL.coalesce.markdown": "\n\n ### COALESCE\n 返回它的第一个不为 null 的参数。如果所有参数均为 null,则返回 `null`。\n\n ```\n ROW a=null, b=\"b\"\n | EVAL COALESCE(a, b)\n ```\n ", - "languageDocumentation.documentationESQL.concat": "CONCAT", - "languageDocumentation.documentationESQL.concat.markdown": "\n\n ### CONCAT\n 串联两个或多个字符串。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fullname = CONCAT(first_name, \" \", last_name)\n ```\n ", - "languageDocumentation.documentationESQL.cos": "COS", - "languageDocumentation.documentationESQL.cos.markdown": "\n\n ### COS\n 返回角度的余弦。\n\n ```\n ROW a=1.8 \n | EVAL cos=COS(a)\n ```\n ", - "languageDocumentation.documentationESQL.cosh": "COSH", - "languageDocumentation.documentationESQL.cosh.markdown": "\n\n ### COSH\n 返回角度的双曲余弦。\n\n ```\n ROW a=1.8 \n | EVAL cosh=COSH(a)\n ```\n ", - "languageDocumentation.documentationESQL.date_diff": "DATE_DIFF", - "languageDocumentation.documentationESQL.date_diff.markdown": "\n\n ### DATE_DIFF\n 从 `endTimestamp` 中减去 `startTimestamp`,并以倍数 `unit` 返回差异。\n 如果 `startTimestamp` 晚于 `endTimestamp`,则返回负值。\n\n ```\n ROW date1 = TO_DATETIME(\"2023-12-02T11:00:00.000Z\"), date2 = TO_DATETIME(\"2023-12-02T11:00:00.001Z\")\n | EVAL dd_ms = DATE_DIFF(\"microseconds\", date1, date2)\n ```\n ", - "languageDocumentation.documentationESQL.date_extract": "DATE_EXTRACT", - "languageDocumentation.documentationESQL.date_extract.markdown": "\n\n ### DATE_EXTRACT\n 提取日期的某些部分,如年、月、日、小时。\n\n ```\n ROW date = DATE_PARSE(\"yyyy-MM-dd\", \"2022-05-06\")\n | EVAL year = DATE_EXTRACT(\"year\", date)\n ```\n ", - "languageDocumentation.documentationESQL.date_format": "DATE_FORMAT", - "languageDocumentation.documentationESQL.date_format.markdown": "\n\n ### DATE_FORMAT\n 以提供的格式返回日期的字符串表示形式。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL hired = DATE_FORMAT(\"YYYY-MM-dd\", hire_date)\n ```\n ", - "languageDocumentation.documentationESQL.date_parse": "DATE_PARSE", - "languageDocumentation.documentationESQL.date_parse.markdown": "\n\n ### DATE_PARSE\n 通过使用在第一个参数中指定的格式来解析第二个参数,从而返回日期。\n\n ```\n ROW date_string = \"2022-05-06\"\n | EVAL date = DATE_PARSE(\"yyyy-MM-dd\", date_string)\n ```\n ", - "languageDocumentation.documentationESQL.date_trunc": "DATE_TRUNC", - "languageDocumentation.documentationESQL.date_trunc.markdown": "\n\n ### DATE_TRUNC\n 将日期向下舍入到最近的时间间隔。\n\n ```\n FROM employees\n | KEEP first_name, last_name, hire_date\n | EVAL year_hired = DATE_TRUNC(1 year, hire_date)\n ```\n ", - "languageDocumentation.documentationESQL.dissect": "DISSECT", - "languageDocumentation.documentationESQL.dissect.markdown": "### DISSECT\n使用 `DISSECT`,您可以从字符串中提取结构化数据。`DISSECT` 将根据基于分隔符的模式来匹配字符串,并提取指定键作为列。\n\n请参阅[分解处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/dissect-processor.html)了解分解模式的语法。\n\n```\nROW a = \"1953-01-23T12:15:00Z - some text - 127.0.0.1\"\n| DISSECT a \"%'{Y}-%{M}-%{D}T%{h}:%{m}:%{s}Z - %{msg} - %{ip}'\"\n``` ", - "languageDocumentation.documentationESQL.drop": "DROP", - "languageDocumentation.documentationESQL.drop.markdown": "### DROP\n使用 `DROP` 可从表中移除列:\n \n```\nFROM employees\n| DROP height\n```\n\n您不必按名称指定每个列,而可以使用通配符丢弃名称匹配某种模式的所有列:\n\n```\nFROM employees\n| DROP height*\n```\n ", - "languageDocumentation.documentationESQL.e": "E", - "languageDocumentation.documentationESQL.e.markdown": "\n\n ### E\n 返回 Euler 函数的编号。\n\n ```\n ROW E()\n ```\n ", - "languageDocumentation.documentationESQL.ends_with": "ENDS_WITH", - "languageDocumentation.documentationESQL.ends_with.markdown": "\n\n ### ENDS_WITH\n 返回布尔值,指示关键字字符串是否以另一个字符串结尾。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_E = ENDS_WITH(last_name, \"d\")\n ```\n ", - "languageDocumentation.documentationESQL.enrich": "ENRICH", - "languageDocumentation.documentationESQL.enrich.markdown": "### ENRICH\n您可以使用 `ENRICH` 将来自现有索引的数据添加到传入记录中。它类似于[采集扩充](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html),但作用于查询时间。\n\n```\nROW language_code = \"1\"\n| ENRICH languages_policy\n```\n\n执行 `ENRICH` 需要[扩充策略](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-policy)。扩充策略定义一个匹配字段(键字段)和一组扩充字段。\n\n`ENRICH` 将根据匹配字段值在[扩充索引](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html#enrich-index)中查找记录。输入数据集中的匹配键可以使用 `ON ` 来定义;如果未指定,将对字段名称与在扩充策略中定义的匹配字段相同的字段执行匹配。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a\n```\n\n您可以使用 `WITH , ...` 语法指定必须将哪些属性(在那些在策略中定义为扩充字段的字段之间)添加到结果中。\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH language_name\n```\n\n还可以使用 `WITH new_name=` 重命名属性\n\n```\nROW a = \"1\"\n| ENRICH languages_policy ON a WITH name = language_name\n```\n\n默认情况下(如果未定义任何 `WITH`),`ENRICH` 会将在扩充策略中定义的所有扩充字段添加到结果中。\n\n如果出现名称冲突,新创建的字段将覆盖现有字段。\n ", - "languageDocumentation.documentationESQL.eval": "EVAL", - "languageDocumentation.documentationESQL.eval.markdown": "### EVAL\n`EVAL` 允许您添加新列:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height_feet = height * 3.281, height_cm = height * 100\n```\n\n如果指定列已存在,将丢弃现有列,并将新列追加到表后面:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| EVAL height = height * 3.281\n```\n\n#### 函数\n`EVAL` 支持各种用于计算值的函数。请参阅“函数”了解更多信息。\n ", - "languageDocumentation.documentationESQL.floor": "FLOOR", - "languageDocumentation.documentationESQL.floor.markdown": "\n\n ### FLOOR\n 将数字向下舍入到最近的整数。\n\n ```\n ROW a=1.8\n | EVAL a=FLOOR(a)\n ```\n 注意:对于 `long`(包括无符号值)和 `integer`,这相当于“无操作”。\n 对于 `double`,这会提取最接近整数的 `double` 值,\n 类似于 Math.floor。\n ", - "languageDocumentation.documentationESQL.from": "FROM", - "languageDocumentation.documentationESQL.from_base64": "FROM_BASE64", - "languageDocumentation.documentationESQL.from_base64.markdown": "\n\n ### FROM_BASE64\n 解码 base64 字符串。\n\n ```\n row a = \"ZWxhc3RpYw==\" \n | eval d = from_base64(a)\n ```\n ", - "languageDocumentation.documentationESQL.from.markdown": "### FROM\n`FROM` 源命令返回一个表,其中最多包含 10,000 个来自数据流、索引或别名的文档。生成的表中的每一行代表一个文档。每一列对应一个字段,并可以通过该字段的名称进行访问。\n\n```\nFROM employees\n```\n\n您可以使用[日期数学表达式](https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names)来引用索引、别名和数据流。这可能对时间序列数据非常有用。\n\n使用逗号分隔列表或通配符可查询多个数据流、索引或别名:\n\n```\nFROM employees-00001,employees-*\n```\n\n#### 元数据\n\nES|QL 可访问以下元数据字段:\n\n* `_index`:文档所属的索引。字段类型为 `keyword`.\n* `_id`:源文档的 ID。字段类型为 `keyword`.\n* `_version`:源文档的版本。字段类型为 `long`。\n\n使用 `METADATA` 指令可启用元数据字段:\n\n```\nFROM index [METADATA _index, _id]\n```\n\n元数据字段仅在数据源为索引时可用。因此,`FROM` 是唯一支持 `METADATA` 指令的源命令。\n\n启用后,这些字段将可用于后续处理命令,就像其他索引字段一样:\n\n```\nFROM ul_logs, apps [METADATA _index, _version]\n| WHERE id IN (13, 14) AND _version == 1\n| EVAL key = CONCAT(_index, \"_\", TO_STR(id))\n| SORT id, _index\n| KEEP id, _index, _version, key\n```\n\n此外,与索引字段类似,一旦执行了聚合,后续命令将无法再访问元数据字段,除非它用作分组字段:\n\n```\nFROM employees [METADATA _index, _id]\n| STATS max = MAX(emp_no) BY _index\n```\n ", - "languageDocumentation.documentationESQL.greatest": "GREATEST", - "languageDocumentation.documentationESQL.greatest.markdown": "\n\n ### GREATEST\n 返回多个列中的最大值。除了可一次对多个列运行以外,\n 此函数与 `MV_MAX` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL g = GREATEST(a, b)\n ```\n 注意:对 `keyword` 或 `text` 字段运行时,此函数将按字母顺序返回最后一个字符串。对 `boolean` 列运行时,如果任何值为 `true`,此函数将返回 `true`。\n ", - "languageDocumentation.documentationESQL.grok": "GROK", - "languageDocumentation.documentationESQL.grok.markdown": "### GROK\n使用 `GROK`,您可以从字符串中提取结构化数据。`GROK` 将基于正则表达式根据模式来匹配字符串,并提取指定模式作为列。\n\n请参阅 [grok 处理器文档](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)了解 grok 模式的语法。\n\n```\nROW a = \"12 15.5 15.6 true\"\n| GROK a \"%'{NUMBER:b:int}' %'{NUMBER:c:float}' %'{NUMBER:d:double}' %'{WORD:e:boolean}'\"\n```\n ", - "languageDocumentation.documentationESQL.inOperator": "IN", - "languageDocumentation.documentationESQL.inOperator.markdown": "### IN\n`IN` 运算符允许测试字段或表达式是否等于文本、字段或表达式列表中的元素:\n\n```\nROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)\n```\n ", - "languageDocumentation.documentationESQL.ip_prefix": "IP_PREFIX", - "languageDocumentation.documentationESQL.ip_prefix.markdown": "\n\n ### IP_PREFIX\n 截短 IP 至给定的前缀长度。\n\n ```\n row ip4 = to_ip(\"1.2.3.4\"), ip6 = to_ip(\"fe80::cae2:65ff:fece:feb9\")\n | eval ip4_prefix = ip_prefix(ip4, 24, 0), ip6_prefix = ip_prefix(ip6, 0, 112);\n ```\n ", - "languageDocumentation.documentationESQL.keep": "KEEP", - "languageDocumentation.documentationESQL.keep.markdown": "### KEEP\n使用 `KEEP` 命令,您可以指定将返回哪些列以及返回这些列的顺序。\n\n要限制返回的列数,请使用列名的逗号分隔列表。将按指定顺序返回这些列:\n \n```\nFROM employees\n| KEEP first_name, last_name, height\n```\n\n您不必按名称指定每个列,而可以使用通配符返回名称匹配某种模式的所有列:\n\n```\nFROM employees\n| KEEP h*\n```\n\n星号通配符 (`*`) 自身将转换为不与其他参数匹配的所有列。此查询将首先返回所有名称以 h 开头的所有列,随后返回所有其他列:\n\n```\nFROM employees\n| KEEP h*, *\n```\n ", - "languageDocumentation.documentationESQL.least": "LEAST", - "languageDocumentation.documentationESQL.least.markdown": "\n\n ### LEAST\n 返回多个列中的最小值。除了可一次对多个列运行以外,此函数与 `MV_MIN` 类似。\n\n ```\n ROW a = 10, b = 20\n | EVAL l = LEAST(a, b)\n ```\n ", - "languageDocumentation.documentationESQL.left": "LEFT", - "languageDocumentation.documentationESQL.left.markdown": "\n\n ### LEFT\n 返回从“字符串”中提取“长度”字符的子字符串,从左侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL left = LEFT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "languageDocumentation.documentationESQL.length": "LENGTH", - "languageDocumentation.documentationESQL.length.markdown": "\n\n ### LENGTH\n 返回字符串的字符长度。\n\n ```\n FROM employees\n | KEEP first_name, last_name\n | EVAL fn_length = LENGTH(first_name)\n ```\n ", - "languageDocumentation.documentationESQL.limit": "LIMIT", - "languageDocumentation.documentationESQL.limit.markdown": "### LIMIT\n`LIMIT` 处理命令允许您限制行数:\n \n```\nFROM employees\n| LIMIT 5\n```\n ", - "languageDocumentation.documentationESQL.locate": "LOCATE", - "languageDocumentation.documentationESQL.locate.markdown": "\n\n ### LOCATE\n 返回一个整数,指示关键字子字符串在另一字符串中的位置\n\n ```\n row a = \"hello\"\n | eval a_ll = locate(a, \"ll\")\n ```\n ", - "languageDocumentation.documentationESQL.log": "LOG", - "languageDocumentation.documentationESQL.log.markdown": "\n\n ### LOG\n 以某底数返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求零、负数的对数,以及底数为一时将返回 `null`,并显示警告。\n\n ```\n ROW base = 2.0, value = 8.0\n | EVAL s = LOG(base, value)\n ```\n ", - "languageDocumentation.documentationESQL.log10": "LOG10", - "languageDocumentation.documentationESQL.log10.markdown": "\n\n ### LOG10\n 以底数 10 返回值的对数。输入可以为任何数字值,返回值始终为双精度值。\n\n 求 0 和负数的对数时将返回 `null`,并显示警告。\n\n ```\n ROW d = 1000.0 \n | EVAL s = LOG10(d)\n ```\n ", - "languageDocumentation.documentationESQL.ltrim": "LTRIM", - "languageDocumentation.documentationESQL.ltrim.markdown": "\n\n ### LTRIM\n 从字符串中移除前导空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = LTRIM(message)\n | EVAL color = LTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "languageDocumentation.documentationESQL.markdown": "## ES|QL\n\nES|QL(Elasticsearch 查询语言)查询包含一系列命令,它们用管道字符分隔:`|`。每个查询以**源命令**开头,它会生成一个表,其中通常包含来自 Elasticsearch 的数据。\n\n源命令可后接一个或多个**处理命令**。处理命令可通过添加、移除以及更改行和列来更改前一个命令的输出表。\n\n```\nsource-command\n| processing-command1\n| processing-command2\n```\n\n查询的结果为由最后的处理命令生成的表。 \n ", - "languageDocumentation.documentationESQL.mv_append": "MV_APPEND", - "languageDocumentation.documentationESQL.mv_append.markdown": "\n\n ### MV_APPEND\n 串联两个多值字段的值。\n\n ", - "languageDocumentation.documentationESQL.mv_avg": "MV_AVG", - "languageDocumentation.documentationESQL.mv_avg.markdown": "\n\n ### MV_AVG\n 将多值字段转换为包含所有值的平均值的单值字段。\n\n ```\n ROW a=[3, 5, 1, 6]\n | EVAL avg_a = MV_AVG(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_concat": "MV_CONCAT", - "languageDocumentation.documentationESQL.mv_concat.markdown": "\n\n ### MV_CONCAT\n 将多值字符串表达式转换为单值列,其中包含由分隔符分隔的所有值的串联形式。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL j = MV_CONCAT(a, \", \")\n ```\n ", - "languageDocumentation.documentationESQL.mv_count": "MV_COUNT", - "languageDocumentation.documentationESQL.mv_count.markdown": "\n\n ### MV_COUNT\n 将多值表达式转换为包含值计数的单值列。\n\n ```\n ROW a=[\"foo\", \"zoo\", \"bar\"]\n | EVAL count_a = MV_COUNT(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_dedupe": "MV_DEDUPE", - "languageDocumentation.documentationESQL.mv_dedupe.markdown": "\n\n ### MV_DEDUPE\n 移除多值字段中的重复值。\n\n ```\n ROW a=[\"foo\", \"foo\", \"bar\", \"foo\"]\n | EVAL dedupe_a = MV_DEDUPE(a)\n ```\n 注意:`MV_DEDUPE` 可能但不会始终对列中的值进行排序。\n ", - "languageDocumentation.documentationESQL.mv_first": "MV_FIRST", - "languageDocumentation.documentationESQL.mv_first.markdown": "\n\n ### MV_FIRST\n 将多值表达式转换为包含第一个值的\n 单值列。这在从按已知顺序发出多值列的\n 函数(如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最小值,请使用 `MV_MIN` 而不是\n `MV_FIRST`。`MV_MIN` 针对排序值进行了优化,因此\n 对 `MV_FIRST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL first_a = MV_FIRST(SPLIT(a, \";\"))\n ```\n ", - "languageDocumentation.documentationESQL.mv_last": "MV_LAST", - "languageDocumentation.documentationESQL.mv_last.markdown": "\n\n ### MV_LAST\n 将多值表达式转换为包含最后一个值的单值\n 列。这在从按已知顺序发出多值列的函数\n (如 `SPLIT`)中读取数据时尤其有用。\n\n 无法保证从底层存储\n 读取多值字段的顺序。它 *通常* 为升序,但不应\n 依赖于此。如果需要最大值,请使用 `MV_MAX` 而不是\n `MV_LAST`。`MV_MAX` 针对排序值进行了优化,因此\n 对 `MV_LAST` 没有性能优势。\n\n ```\n ROW a=\"foo;bar;baz\"\n | EVAL last_a = MV_LAST(SPLIT(a, \";\"))\n ```\n ", - "languageDocumentation.documentationESQL.mv_max": "MV_MAX", - "languageDocumentation.documentationESQL.mv_max.markdown": "\n\n ### MV_MAX\n 将多值表达式转换为包含最大值的单值列。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL max_a = MV_MAX(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_median": "MV_MEDIAN", - "languageDocumentation.documentationESQL.mv_median.markdown": "\n\n ### MV_MEDIAN\n 将多值字段转换为包含中位数值的单值字段。\n\n ```\n ROW a=[3, 5, 1]\n | EVAL median_a = MV_MEDIAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_min": "MV_MIN", - "languageDocumentation.documentationESQL.mv_min.markdown": "\n\n ### MV_MIN\n 将多值表达式转换为包含最小值的单值列。\n\n ```\n ROW a=[2, 1]\n | EVAL min_a = MV_MIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_slice": "MV_SLICE", - "languageDocumentation.documentationESQL.mv_slice.markdown": "\n\n ### MV_SLICE\n 使用起始和结束索引值返回多值字段的子集。\n\n ```\n row a = [1, 2, 2, 3]\n | eval a1 = mv_slice(a, 1), a2 = mv_slice(a, 2, 3)\n ```\n ", - "languageDocumentation.documentationESQL.mv_sort": "MV_SORT", - "languageDocumentation.documentationESQL.mv_sort.markdown": "\n\n ### MV_SORT\n 按字典顺序对多值字段排序。\n\n ```\n ROW a = [4, 2, -3, 2]\n | EVAL sa = mv_sort(a), sd = mv_sort(a, \"DESC\")\n ```\n ", - "languageDocumentation.documentationESQL.mv_sum": "MV_SUM", - "languageDocumentation.documentationESQL.mv_sum.markdown": "\n\n ### MV_SUM\n 将多值字段转换为包含所有值的总和的单值字段。\n\n ```\n ROW a=[3, 5, 6]\n | EVAL sum_a = MV_SUM(a)\n ```\n ", - "languageDocumentation.documentationESQL.mv_zip": "MV_ZIP", - "languageDocumentation.documentationESQL.mv_zip.markdown": "\n\n ### MV_ZIP\n 组合两个使用分隔符联接在一起的多值字段中的值。\n\n ```\n ROW a = [\"x\", \"y\", \"z\"], b = [\"1\", \"2\"]\n | EVAL c = mv_zip(a, b, \"-\")\n | KEEP a, b, c\n ```\n ", - "languageDocumentation.documentationESQL.mvExpand": "MV_EXPAND", - "languageDocumentation.documentationESQL.mvExpand.markdown": "### MV_EXPAND\n`MV_EXPAND` 处理命令将多值字段扩展成每个值一行,从而复制其他字段: \n```\nROW a=[1,2,3], b=\"b\", j=[\"a\",\"b\"]\n| MV_EXPAND a\n```\n ", - "languageDocumentation.documentationESQL.now": "NOW", - "languageDocumentation.documentationESQL.now.markdown": "\n\n ### NOW\n 返回当前日期和时间。\n\n ```\n ROW current_date = NOW()\n ```\n ", - "languageDocumentation.documentationESQL.pi": "PI", - "languageDocumentation.documentationESQL.pi.markdown": "\n\n ### PI\n 返回 Pi,即圆的周长与其直径的比率。\n\n ```\n ROW PI()\n ```\n ", - "languageDocumentation.documentationESQL.pow": "POW", - "languageDocumentation.documentationESQL.pow.markdown": "\n\n ### POW\n 返回提升为 `exponent` 幂的 `base` 的值。\n\n ```\n ROW base = 2.0, exponent = 2\n | EVAL result = POW(base, exponent)\n ```\n 注意:此处仍可能使双精度结果溢出;在该情况下,将返回 null。\n ", - "languageDocumentation.documentationESQL.predicates": "Null 值", - "languageDocumentation.documentationESQL.predicates.markdown": "### NULL 值\n对于 NULL 比较,请使用 `IS NULL` 和 `IS NOT NULL` 谓词:\n\n```\nFROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3\n```\n\n```\nFROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS count(emp_no)\n```\n ", - "languageDocumentation.documentationESQL.rename": "RENAME", - "languageDocumentation.documentationESQL.rename.markdown": "### RENAME\n请使用 `RENAME` 通过以下语法对列重命名:\n\n```\nRENAME AS \n```\n\n例如:\n\n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| RENAME still_hired AS employed\n```\n\n如果使用新名称的列已存在,将用新列替换该列。\n\n可以使用单个 `RENAME` 命令对多个列重命名:\n\n```\nFROM employees\n| KEEP first_name, last_name\n| RENAME first_name AS fn, last_name AS ln\n```\n ", - "languageDocumentation.documentationESQL.repeat": "REPEAT", - "languageDocumentation.documentationESQL.repeat.markdown": "\n\n ### REPEAT\n 返回通过串联 `string` 自身与指定次数 `number` 构造而成的字符串。\n\n ```\n ROW a = \"Hello!\"\n | EVAL triple_a = REPEAT(a, 3);\n ```\n ", - "languageDocumentation.documentationESQL.replace": "REPLACE", - "languageDocumentation.documentationESQL.replace.markdown": "\n\n ### REPLACE\n 此函数将字符串 `str` 中正则表达式 `regex` 的任何匹配项\n 替换为替代字符串 `newStr`。\n\n ```\n ROW str = \"Hello World\"\n | EVAL str = REPLACE(str, \"World\", \"Universe\")\n | KEEP str\n ```\n ", - "languageDocumentation.documentationESQL.right": "RIGHT", - "languageDocumentation.documentationESQL.right.markdown": "\n\n ### RIGHT\n 返回从“字符串”中提取“长度”字符的子字符串,从右侧开始。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL right = RIGHT(last_name, 3)\n | SORT last_name ASC\n | LIMIT 5\n ```\n ", - "languageDocumentation.documentationESQL.round": "ROUND", - "languageDocumentation.documentationESQL.round.markdown": "\n\n ### ROUND\n 将数字舍入到指定小数位数。\n 默认值为 0,即返回最近的整数。如果\n 精确度为负数,则将数字舍入到\n 小数点左侧的位数。\n\n ```\n FROM employees\n | KEEP first_name, last_name, height\n | EVAL height_ft = ROUND(height * 3.281, 1)\n ```\n ", - "languageDocumentation.documentationESQL.row": "ROW", - "languageDocumentation.documentationESQL.row.markdown": "### ROW\n`ROW` 源命令会生成一个行,其中包含一个或多个含有您指定的值的列。这可以用于测试。\n \n```\nROW a = 1, b = \"two\", c = null\n```\n\n请使用方括号创建多值列:\n\n```\nROW a = [2, 1]\n```\n\nROW 支持使用函数:\n\n```\nROW a = ROUND(1.23, 0)\n```\n ", - "languageDocumentation.documentationESQL.rtrim": "RTRIM", - "languageDocumentation.documentationESQL.rtrim.markdown": "\n\n ### RTRIM\n 从字符串中移除尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = RTRIM(message)\n | EVAL color = RTRIM(color)\n | EVAL message = CONCAT(\"'\", message, \"'\")\n | EVAL color = CONCAT(\"'\", color, \"'\")\n ```\n ", - "languageDocumentation.documentationESQL.show": "SHOW", - "languageDocumentation.documentationESQL.show.markdown": "### SHOW\n`SHOW ` 源命令返回有关部署及其功能的信息:\n\n* 使用 `SHOW INFO` 可返回部署的版本、构建日期和哈希。\n* 使用 `SHOW FUNCTIONS` 可返回所有受支持函数的列表和每个函数的概要。\n ", - "languageDocumentation.documentationESQL.signum": "SIGNUM", - "languageDocumentation.documentationESQL.signum.markdown": "\n\n ### SIGNUM\n 返回给定数字的符号。\n 它对负数返回 `-1`,对 `0` 返回 `0`,对正数返回 `1`。\n\n ```\n ROW d = 100.0\n | EVAL s = SIGNUM(d)\n ```\n ", - "languageDocumentation.documentationESQL.sin": "SIN", - "languageDocumentation.documentationESQL.sin.markdown": "\n\n ### SIN\n 返回角度的正弦三角函数。\n\n ```\n ROW a=1.8 \n | EVAL sin=SIN(a)\n ```\n ", - "languageDocumentation.documentationESQL.sinh": "SINH", - "languageDocumentation.documentationESQL.sinh.markdown": "\n\n ### SINH\n 返回角度的双曲正弦。\n\n ```\n ROW a=1.8 \n | EVAL sinh=SINH(a)\n ```\n ", - "languageDocumentation.documentationESQL.sort": "SORT", - "languageDocumentation.documentationESQL.sort.markdown": "### SORT\n使用 `SORT` 命令可对一个或多个字段上的行排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height\n```\n\n默认排序顺序为升序。请使用 `ASC` 或 `DESC` 设置显式排序顺序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC\n```\n\n如果两个行具有相同的排序键,则保留原始顺序。您可以提供其他排序表达式充当连接断路器:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT height DESC, first_name ASC\n```\n\n#### `null` 值\n默认情况下,会将 `null` 值视为大于任何其他值。使用升序排序顺序时,会最后对 `null` 值排序,而使用降序排序顺序时,会首先对 `null` 值排序。您可以通过提供 `NULLS FIRST` 或 `NULLS LAST` 来更改该排序:\n\n```\nFROM employees\n| KEEP first_name, last_name, height\n| SORT first_name ASC NULLS FIRST\n```\n ", - "languageDocumentation.documentationESQL.split": "SPLIT", - "languageDocumentation.documentationESQL.split.markdown": "\n\n ### SPLIT\n 将单值字符串拆分成多个字符串。\n\n ```\n ROW words=\"foo;bar;baz;qux;quux;corge\"\n | EVAL word = SPLIT(words, \";\")\n ```\n ", - "languageDocumentation.documentationESQL.sqrt": "SQRT", - "languageDocumentation.documentationESQL.sqrt.markdown": "\n\n ### SQRT\n 返回数字的平方根。输入可以为任何数字值,返回值始终为双精度值。\n 负数和无穷大的平方根为 null。\n\n ```\n ROW d = 100.0\n | EVAL s = SQRT(d)\n ```\n ", - "languageDocumentation.documentationESQL.st_contains": "ST_CONTAINS", - "languageDocumentation.documentationESQL.st_contains.markdown": "\n\n ### ST_CONTAINS\n 返回第一个几何形状是否包含第二个几何形状。\n 这是 `ST_WITHIN` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_CONTAINS(city_boundary, TO_GEOSHAPE(\"POLYGON((109.35 18.3, 109.45 18.3, 109.45 18.4, 109.35 18.4, 109.35 18.3))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_disjoint": "ST_DISJOINT", - "languageDocumentation.documentationESQL.st_disjoint.markdown": "\n\n ### ST_DISJOINT\n 返回两个几何图形或几何图形列是否不相交。\n 这是 `ST_INTERSECTS` 函数的反向函数。\n 从数学上讲:ST_Disjoint(A, B) ⇔ A ⋂ B = ∅\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE(\"POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_distance": "ST_DISTANCE", - "languageDocumentation.documentationESQL.st_distance.markdown": "\n\n ### ST_DISTANCE\n 计算两点之间的距离。\n 对于笛卡尔几何形状,这是以相同单位作为原始坐标时的毕达哥拉斯距离。\n 对于地理几何形状而言,这是沿着地球大圆的圆周距离(以米为单位)。\n\n ```\n FROM airports\n | WHERE abbrev == \"CPH\"\n | EVAL distance = ST_DISTANCE(location, city_location)\n | KEEP abbrev, name, location, city_location, distance\n ```\n ", - "languageDocumentation.documentationESQL.st_intersects": "ST_INTERSECTS", - "languageDocumentation.documentationESQL.st_intersects.markdown": "\n\n ### ST_INTERSECTS\n 如果两个几何形状相交,则返回 true。\n 如果它们有任何共同点,包括其内点\n (沿线的点或多边形内的点),则表示它们相交。\n 这是 `ST_DISJOINT` 函数的反向函数。\n 从数学上讲:ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅\n\n ```\n FROM airports\n | WHERE ST_INTERSECTS(location, TO_GEOSHAPE(\"POLYGON((42 14, 43 14, 43 15, 42 15, 42 14))\"))\n ```\n ", - "languageDocumentation.documentationESQL.st_within": "ST_WITHIN", - "languageDocumentation.documentationESQL.st_within.markdown": "\n\n ### ST_WITHIN\n 返回第一个几何形状是否在第二个几何形状内。\n 这是 `ST_CONTAINS` 函数的反向函数。\n\n ```\n FROM airport_city_boundaries\n | WHERE ST_WITHIN(city_boundary, TO_GEOSHAPE(\"POLYGON((109.1 18.15, 109.6 18.15, 109.6 18.65, 109.1 18.65, 109.1 18.15))\"))\n | KEEP abbrev, airport, region, city, city_location\n ```\n ", - "languageDocumentation.documentationESQL.st_x": "ST_X", - "languageDocumentation.documentationESQL.st_x.markdown": "\n\n ### ST_X\n 从提供的点中提取 `x` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `longitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "languageDocumentation.documentationESQL.st_y": "ST_Y", - "languageDocumentation.documentationESQL.st_y.markdown": "\n\n ### ST_Y\n 从提供的点中提取 `y` 坐标。\n 如果点的类型为 `geo_point`,则这等同于提取 `latitude` 值。\n\n ```\n ROW point = TO_GEOPOINT(\"POINT(42.97109629958868 14.7552534006536)\")\n | EVAL x = ST_X(point), y = ST_Y(point)\n ```\n ", - "languageDocumentation.documentationESQL.starts_with": "STARTS_WITH", - "languageDocumentation.documentationESQL.starts_with.markdown": "\n\n ### STARTS_WITH\n 返回指示关键字字符串是否以另一个字符串开头的布尔值。\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_S = STARTS_WITH(last_name, \"B\")\n ```\n ", - "languageDocumentation.documentationESQL.statsby": "STATS ...BY", - "languageDocumentation.documentationESQL.statsby.markdown": "### STATS ...BY\n使用 `STATS ...BY` 可根据公共值对行分组,并计算已分组行中的一个或多个聚合值。\n\n**示例**:\n\n```\nFROM employees\n| STATS count = COUNT(emp_no) BY languages\n| SORT languages\n```\n\n如果省略 `BY`,输出表实际将包含一行,其中为应用于整个数据集的聚合:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages)\n```\n\n可以计算多个值:\n\n```\nFROM employees\n| STATS avg_lang = AVG(languages), max_lang = MAX(languages)\n```\n\n也可以按多个值分组(仅长整型和关键字家族字段支持):\n\n```\nFROM employees\n| EVAL hired = DATE_FORMAT(hire_date, \"YYYY\")\n| STATS avg_salary = AVG(salary) BY hired, languages.long\n| EVAL avg_salary = ROUND(avg_salary)\n| SORT hired, languages.long\n```\n\n请参阅**聚合函数**获取可与 `STATS ...BY` 搭配使用的函数列表。\n\n聚合函数和分组表达式均接受其他函数。这在对多值列使用 `STATS...BY` 时有用。例如,要计算平均工资变动,可以首先使用 `MV_AVG` 对每名员工的多个值求平均值,然后将结果用于 `AVG` 函数:\n\n```\nFROM employees\n| STATS avg_salary_change = AVG(MV_AVG(salary_change))\n```\n\n按表达式分组的示例为根据员工姓氏的第一个字母对其进行分组:\n\n```\nFROM employees\n| STATS my_count = COUNT() BY LEFT(last_name, 1)\n| SORT `LEFT(last_name, 1)`\n```\n\n指定输出列名称为可选操作。如果未指定,新列名称等于该表达式。以下查询将返回名为 `AVG(salary)` 的列:\n\n```\nFROM employees\n| STATS AVG(salary)\n```\n\n由于此名称包含特殊字符,在后续命令中使用该名称时,需要用反撇号 (`) 引用它:\n\n```\nFROM employees\n| STATS AVG(salary)\n| EVAL avg_salary_rounded = ROUND(`AVG(salary)`)\n```\n\n**注意**:不包含任何组的 `STATS` 比添加组更快。\n\n**注意**:当前,根据单一表达式进行分组比根据许多表达式进行分组更为优化。\n ", - "languageDocumentation.documentationESQL.stringOperators": "LIKE 和 RLIKE", - "languageDocumentation.documentationESQL.stringOperators.markdown": "### LIKE 和 RLIKE\n使用通配符或正则表达式比较字符串时,请使用 `LIKE` 或 `RLIKE`:\n\n使用 `LIKE` 时,可使用通配符来匹配字符串。支持以下通配符字符:\n\n* `*` 匹配零个或更多字符。\n* `?` 匹配一个字符。\n\n```\nFROM employees\n| WHERE first_name LIKE \"?b*\"\n| KEEP first_name, last_name\n```\n\n使用 `RLIKE` 时,可使用正则表达式来匹配字符串:\n\n```\nFROM employees\n| WHERE first_name RLIKE \".leja.*\"\n| KEEP first_name, last_name\n```\n ", - "languageDocumentation.documentationESQL.substring": "SUBSTRING", - "languageDocumentation.documentationESQL.substring.markdown": "\n\n ### SUBSTRING\n 返回字符串的子字符串,用起始位置和可选长度指定\n\n ```\n FROM employees\n | KEEP last_name\n | EVAL ln_sub = SUBSTRING(last_name, 1, 3)\n ```\n ", - "languageDocumentation.documentationESQL.tan": "TAN", - "languageDocumentation.documentationESQL.tan.markdown": "\n\n ### TAN\n 返回角度的正切三角函数。\n\n ```\n ROW a=1.8 \n | EVAL tan=TAN(a)\n ```\n ", - "languageDocumentation.documentationESQL.tanh": "TANH", - "languageDocumentation.documentationESQL.tanh.markdown": "\n\n ### TANH\n 返回角度的双曲正切函数。\n\n ```\n ROW a=1.8 \n | EVAL tanh=TANH(a)\n ```\n ", - "languageDocumentation.documentationESQL.tau": "TAU", - "languageDocumentation.documentationESQL.tau.markdown": "\n\n ### TAU\n 返回圆的圆周长与其半径的比率。\n\n ```\n ROW TAU()\n ```\n ", - "languageDocumentation.documentationESQL.to_base64": "TO_BASE64", - "languageDocumentation.documentationESQL.to_base64.markdown": "\n\n ### TO_BASE64\n 将字符串编码为 base64 字符串。\n\n ```\n row a = \"elastic\" \n | eval e = to_base64(a)\n ```\n ", - "languageDocumentation.documentationESQL.to_boolean": "TO_BOOLEAN", - "languageDocumentation.documentationESQL.to_boolean.markdown": "\n\n ### TO_BOOLEAN\n 将输入值转换为布尔值。\n 字符串值 *true* 将不区分大小写并被转换为布尔值 *true*。\n 对于任何其他值,包括空字符串,此函数将返回 *false*。\n 数字值 *0* 将转换为 *false*,任何其他值将转换为 *true*。\n\n ```\n ROW str = [\"true\", \"TRuE\", \"false\", \"\", \"yes\", \"1\"]\n | EVAL bool = TO_BOOLEAN(str)\n ```\n ", - "languageDocumentation.documentationESQL.to_cartesianpoint": "TO_CARTESIANPOINT", - "languageDocumentation.documentationESQL.to_cartesianpoint.markdown": "\n\n ### TO_CARTESIANPOINT\n 将输入值转换为 `cartesian_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POINT(7580.93 2272.77)\"]\n | MV_EXPAND wkt\n | EVAL pt = TO_CARTESIANPOINT(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_cartesianshape": "TO_CARTESIANSHAPE", - "languageDocumentation.documentationESQL.to_cartesianshape.markdown": "\n\n ### TO_CARTESIANSHAPE\n 将输入值转换为 `cartesian_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = [\"POINT(4297.11 -1475.53)\", \"POLYGON ((3339584.72 1118889.97, 4452779.63 4865942.27, 2226389.81 4865942.27, 1113194.90 2273030.92, 3339584.72 1118889.97))\"]\n | MV_EXPAND wkt\n | EVAL geom = TO_CARTESIANSHAPE(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_datetime": "TO_DATETIME", - "languageDocumentation.documentationESQL.to_datetime.markdown": "\n\n ### TO_DATETIME\n 将输入值转换为日期值。\n 仅当字符串采用 `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'` 格式时,才可进行成功转换。\n 要转换其他格式的日期,请使用 `DATE_PARSE`。\n\n ```\n ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n | EVAL datetime = TO_DATETIME(string)\n ```\n ", - "languageDocumentation.documentationESQL.to_degrees": "TO_DEGREES", - "languageDocumentation.documentationESQL.to_degrees.markdown": "\n\n ### TO_DEGREES\n 将弧度转换为度数。\n\n ```\n ROW rad = [1.57, 3.14, 4.71]\n | EVAL deg = TO_DEGREES(rad)\n ```\n ", - "languageDocumentation.documentationESQL.to_double": "TO_DOUBLE", - "languageDocumentation.documentationESQL.to_double.markdown": "\n\n ### TO_DOUBLE\n 将输入值转换为双精度值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,\n 并转换为双精度值。布尔值 *true* 将转换为双精度值 *1.0*,*false* 转换为 *0.0*。\n\n ```\n ROW str1 = \"5.20128E11\", str2 = \"foo\"\n | EVAL dbl = TO_DOUBLE(\"520128000000\"), dbl1 = TO_DOUBLE(str1), dbl2 = TO_DOUBLE(str2)\n ```\n ", - "languageDocumentation.documentationESQL.to_geopoint": "TO_GEOPOINT", - "languageDocumentation.documentationESQL.to_geopoint.markdown": "\n\n ### TO_GEOPOINT\n 将输入值转换为 `geo_point` 值。\n 字符串只有符合 WKT 点格式时,才能成功转换。\n\n ```\n ROW wkt = \"POINT(42.97109630194 14.7552534413725)\"\n | EVAL pt = TO_GEOPOINT(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_geoshape": "TO_GEOSHAPE", - "languageDocumentation.documentationESQL.to_geoshape.markdown": "\n\n ### TO_GEOSHAPE\n 将输入值转换为 `geo_shape` 值。\n 字符串只有符合 WKT 格式时,才能成功转换。\n\n ```\n ROW wkt = \"POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\"\n | EVAL geom = TO_GEOSHAPE(wkt)\n ```\n ", - "languageDocumentation.documentationESQL.to_integer": "TO_INTEGER", - "languageDocumentation.documentationESQL.to_integer.markdown": "\n\n ### TO_INTEGER\n 将输入值转换为整数值。\n 如果输入参数为日期类型,会将其值解析为自 Unix epoch 以来\n 的毫秒数,并转换为整数。\n 布尔值 *true* 将转换为整数 *1*,*false* 转换为 *0*。\n\n ```\n ROW long = [5013792, 2147483647, 501379200000]\n | EVAL int = TO_INTEGER(long)\n ```\n ", - "languageDocumentation.documentationESQL.to_ip": "TO_IP", - "languageDocumentation.documentationESQL.to_ip.markdown": "\n\n ### TO_IP\n 将输入字符串转换为 IP 值。\n\n ```\n ROW str1 = \"1.1.1.1\", str2 = \"foo\"\n | EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n | WHERE CIDR_MATCH(ip1, \"1.0.0.0/8\")\n ```\n ", - "languageDocumentation.documentationESQL.to_long": "TO_LONG", - "languageDocumentation.documentationESQL.to_long.markdown": "\n\n ### TO_LONG\n 将输入值转换为长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为长整型值。\n 布尔值 *true* 将转换为长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_LONG(str1), long2 = TO_LONG(str2), long3 = TO_LONG(str3)\n ```\n ", - "languageDocumentation.documentationESQL.to_lower": "TO_LOWER", - "languageDocumentation.documentationESQL.to_lower.markdown": "\n\n ### TO_LOWER\n 返回一个新字符串,表示已将输入字符串转为小写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_lower = TO_LOWER(message)\n ```\n ", - "languageDocumentation.documentationESQL.to_radians": "TO_RADIANS", - "languageDocumentation.documentationESQL.to_radians.markdown": "\n\n ### TO_RADIANS\n 将度数转换为弧度。\n\n ```\n ROW deg = [90.0, 180.0, 270.0]\n | EVAL rad = TO_RADIANS(deg)\n ```\n ", - "languageDocumentation.documentationESQL.to_string": "TO_STRING", - "languageDocumentation.documentationESQL.to_string.markdown": "\n\n ### TO_STRING\n 将输入值转换为字符串。\n\n ```\n ROW a=10\n | EVAL j = TO_STRING(a)\n ```\n ", - "languageDocumentation.documentationESQL.to_unsigned_long": "TO_UNSIGNED_LONG", - "languageDocumentation.documentationESQL.to_unsigned_long.markdown": "\n\n ### TO_UNSIGNED_LONG\n 将输入值转换为无符号长整型值。如果输入参数为日期类型,\n 会将其值解析为自 Unix epoch 以来的毫秒数,并转换为无符号长整型值。\n 布尔值 *true* 将转换为无符号长整型值 *1*,*false* 转换为 *0*。\n\n ```\n ROW str1 = \"2147483648\", str2 = \"2147483648.2\", str3 = \"foo\"\n | EVAL long1 = TO_UNSIGNED_LONG(str1), long2 = TO_ULONG(str2), long3 = TO_UL(str3)\n ```\n ", - "languageDocumentation.documentationESQL.to_upper": "TO_UPPER", - "languageDocumentation.documentationESQL.to_upper.markdown": "\n\n ### TO_UPPER\n 返回一个新字符串,表示已将输入字符串转为大写。\n\n ```\n ROW message = \"Some Text\"\n | EVAL message_upper = TO_UPPER(message)\n ```\n ", - "languageDocumentation.documentationESQL.to_version": "TO_VERSION", - "languageDocumentation.documentationESQL.to_version.markdown": "\n\n ### TO_VERSION\n 将输入字符串转换为版本值。\n\n ```\n ROW v = TO_VERSION(\"1.2.3\")\n ```\n ", - "languageDocumentation.documentationESQL.trim": "TRIM", - "languageDocumentation.documentationESQL.trim.markdown": "\n\n ### TRIM\n 从字符串中移除前导和尾随空格。\n\n ```\n ROW message = \" some text \", color = \" red \"\n | EVAL message = TRIM(message)\n | EVAL color = TRIM(color)\n ```\n ", - "languageDocumentation.documentationESQL.where": "WHERE", - "languageDocumentation.documentationESQL.where.markdown": "### WHERE\n使用 `WHERE` 可生成一个表,其中包含输入表中所提供的条件评估为 `true` 的所有行:\n \n```\nFROM employees\n| KEEP first_name, last_name, still_hired\n| WHERE still_hired == true\n```\n\n#### 运算符\n\n请参阅**运算符**了解所支持的运算符的概览。\n\n#### 函数\n`WHERE` 支持各种用于计算值的函数。请参阅**函数**了解更多信息。\n ", - "textBasedEditor.query.textBasedLanguagesEditor.EnableWordWrapLabel": "在管道符上添加换行符", - "textBasedEditor.query.textBasedLanguagesEditor.errorCount": "{count} 个{count, plural, other {错误}}", - "textBasedEditor.query.textBasedLanguagesEditor.errorsTitle": "错误", - "textBasedEditor.query.textBasedLanguagesEditor.expandLabel": "展开", - "textBasedEditor.query.textBasedLanguagesEditor.feedback": "反馈", - "languageDocumentation.documentationESQL.functions": "函数", - "languageDocumentation.documentationESQL.functionsDocumentationESQLDescription": "ROW、EVAL 和 WHERE 支持的函数。", - "languageDocumentation.documentationESQL.groupingFunctions": "分组函数", - "languageDocumentation.documentationESQL.groupingFunctionsDocumentationESQLDescription": "这些分组函数可以与 `STATS...BY` 搭配使用:", - "textBasedEditor.query.textBasedLanguagesEditor.hideQueriesLabel": "隐藏最近查询", - "textBasedEditor.query.textBasedLanguagesEditor.lineCount": "{count} {count, plural, other {行}}", - "textBasedEditor.query.textBasedLanguagesEditor.lineNumber": "第 {lineNumber} 行", - "languageDocumentation.documentationESQL.operators": "运算符", - "languageDocumentation.documentationESQL.operatorsDocumentationESQLDescription": "ES|QL 支持以下运算符:", - "languageDocumentation.documentationESQL.processingCommands": "处理命令", - "languageDocumentation.documentationESQL.processingCommandsDescription": "处理命令会通过添加、移除或更改行和列来更改输入表。ES|QL 支持以下处理命令。", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.error": "查询失败", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistory.success": "已成功运行查询", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryCopy": "复制查询到剪贴板", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryRun": "运行查询", - "textBasedEditor.query.textBasedLanguagesEditor.querieshistoryTable": "查询历史记录表", - "textBasedEditor.query.textBasedLanguagesEditor.recentQueriesColumnLabel": "最近查询", - "textBasedEditor.query.textBasedLanguagesEditor.runQuery": "运行查询", - "textBasedEditor.query.textBasedLanguagesEditor.showQueriesLabel": "显示最近查询", - "languageDocumentation.documentationESQL.sourceCommands": "源命令", - "textBasedEditor.query.textBasedLanguagesEditor.submitFeedback": "提交反馈", - "textBasedEditor.query.textBasedLanguagesEditor.timeRanColumnLabel": "运行时间", - "textBasedEditor.query.textBasedLanguagesEditor.timestampNotDetected": "未找到 @timestamp", - "textBasedEditor.query.textBasedLanguagesEditor.warningCount": "{count} 个{count, plural, other {警告}}", - "textBasedEditor.query.textBasedLanguagesEditor.warningsTitle": "警告", + "esqlEditor.query.aborted": "请求已中止", + "esqlEditor.query.cancel": "取消", + "esqlEditor.query.collapseLabel": "折叠", + "esqlEditor.query.disableWordWrapLabel": "移除管道符上的换行符", + "esqlEditor.query.EnableWordWrapLabel": "在管道符上添加换行符", + "esqlEditor.query.errorCount": "{count} 个{count, plural, other {错误}}", + "esqlEditor.query.errorsTitle": "错误", + "esqlEditor.query.expandLabel": "展开", + "esqlEditor.query.feedback": "反馈", + "esqlEditor.query.hideQueriesLabel": "隐藏最近查询", + "esqlEditor.query.lineCount": "{count} {count, plural, other {行}}", + "esqlEditor.query.lineNumber": "第 {lineNumber} 行", + "esqlEditor.query.querieshistory.error": "查询失败", + "esqlEditor.query.querieshistory.success": "已成功运行查询", + "esqlEditor.query.querieshistoryCopy": "复制查询到剪贴板", + "esqlEditor.query.querieshistoryRun": "运行查询", + "esqlEditor.query.querieshistoryTable": "查询历史记录表", + "esqlEditor.query.recentQueriesColumnLabel": "最近查询", + "esqlEditor.query.runQuery": "运行查询", + "esqlEditor.query.showQueriesLabel": "显示最近查询", + "esqlEditor.query.submitFeedback": "提交反馈", + "esqlEditor.query.timeRanColumnLabel": "运行时间", + "esqlEditor.query.timestampNotDetected": "未找到 @timestamp", + "esqlEditor.query.warningCount": "{count} 个{count, plural, other {警告}}", + "esqlEditor.query.warningsTitle": "警告", "timelion.emptyExpressionErrorMessage": "Timelion 错误:未提供表达式", "timelion.expressionSuggestions.argument.description.acceptsText": "接受", "timelion.expressionSuggestions.func.description.chainableHelpText": "可串接", diff --git a/x-pack/test/functional/apps/discover/visualize_field.ts b/x-pack/test/functional/apps/discover/visualize_field.ts index 1b7e3dd1eb566d..0ee6a996652bed 100644 --- a/x-pack/test/functional/apps/discover/visualize_field.ts +++ b/x-pack/test/functional/apps/discover/visualize_field.ts @@ -265,14 +265,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // change the query await monacoEditor.setCodeEditorValue('from logstash-* | stats maxB = max(bytes)'); - await testSubjects.click('TextBasedLangEditor-run-query-button'); + await testSubjects.click('ESQLEditor-run-query-button'); await header.waitUntilLoadingHasFinished(); expect((await lens.getMetricVisualizationData()).length).to.be.equal(1); // change the query to display a datatabler await monacoEditor.setCodeEditorValue('from logstash-* | limit 10'); - await testSubjects.click('TextBasedLangEditor-run-query-button'); + await testSubjects.click('ESQLEditor-run-query-button'); await lens.waitForVisualization(); expect(await testSubjects.exists('lnsDataTable')).to.be(true); diff --git a/x-pack/test_serverless/functional/test_suites/common/discover/esql/_esql_view.ts b/x-pack/test_serverless/functional/test_suites/common/discover/esql/_esql_view.ts index b0cc636dea578b..1bedd0acd0cc49 100644 --- a/x-pack/test_serverless/functional/test_suites/common/discover/esql/_esql_view.ts +++ b/x-pack/test_serverless/functional/test_suites/common/discover/esql/_esql_view.ts @@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded(); await testSubjects.existOrFail('fieldListFiltersFieldSearch'); - await testSubjects.existOrFail('TextBasedLangEditor'); + await testSubjects.existOrFail('ESQLEditor'); await testSubjects.existOrFail('superDatePickerToggleQuickMenuButton'); await testSubjects.missingOrFail('showQueryBarMenu'); @@ -113,7 +113,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); - expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true); + expect(await testSubjects.exists('ESQLEditor')).to.be(true); // I am not rendering the histogram for indices with no @timestamp field expect(await testSubjects.exists('unifiedHistogramChart')).to.be(false); }); @@ -133,7 +133,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const toTime = 'Nov 15, 2018 @ 00:00:00.000'; await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - expect(await testSubjects.exists('TextBasedLangEditor')).to.be(true); + expect(await testSubjects.exists('ESQLEditor')).to.be(true); expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true); }); @@ -352,7 +352,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); const historyItems = await esql.getHistoryItems(); log.debug(historyItems); const queryAdded = historyItems.some((item) => { @@ -374,7 +374,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); const historyItems = await esql.getHistoryItems(); log.debug(historyItems); const queryAdded = historyItems.some((item) => { @@ -390,7 +390,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); // click a history item await esql.clickHistoryItem(1); @@ -415,10 +415,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded(); - await testSubjects.click('TextBasedLangEditor-toggle-query-history-button'); - await testSubjects.click('TextBasedLangEditor-queryHistory-runQuery-button'); + await testSubjects.click('ESQLEditor-toggle-query-history-button'); + await testSubjects.click('ESQLEditor-queryHistory-runQuery-button'); const historyItem = await esql.getHistoryItem(0); - await historyItem.findByTestSubject('TextBasedLangEditor-queryHistory-error'); + await historyItem.findByTestSubject('ESQLEditor-queryHistory-error'); }); }); diff --git a/yarn.lock b/yarn.lock index efe12772a7fb46..11bae58bb6cfc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4971,6 +4971,10 @@ version "0.0.0" uid "" +"@kbn/esql-editor@link:packages/kbn-esql-editor": + version "0.0.0" + uid "" + "@kbn/esql-utils@link:packages/kbn-esql-utils": version "0.0.0" uid "" @@ -6935,10 +6939,6 @@ version "0.0.0" uid "" -"@kbn/text-based-editor@link:packages/kbn-text-based-editor": - version "0.0.0" - uid "" - "@kbn/third-party-lens-navigation-prompt-plugin@link:x-pack/examples/third_party_lens_navigation_prompt": version "0.0.0" uid ""