From 3bb08f383b07ac37d521f25de6275a7c17a26838 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Fri, 13 Dec 2019 13:20:53 +0100 Subject: [PATCH] Redo built in functions --- .../mode/elasticsearch_sql_highlight_rules.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts b/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts index 95caa8d5b8af7..398cf531612ef 100644 --- a/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts +++ b/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts @@ -25,22 +25,23 @@ export const ElasticsearchSqlHighlightRules = function(this: any) { // See https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-commands.html const keywords = 'describe|between|in|like|not|and|or|desc|select|from|where|having|group|by|order' + - 'asc|desc|pivot|for|in|as|show|columns|include|frozen|tables|escape|limit|rlike|all|distinct'; + 'asc|desc|pivot|for|in|as|show|columns|include|frozen|tables|escape|limit|rlike|all|distinct|is'; const builtinConstants = 'true|false'; // See https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-syntax-show-functions.html const builtinFunctions = - 'avg|count|first|first_value|last|last_value|max|min|sum|kurtosis|mad|percentile|percentile_rank|skewness|stddev_pop' + - '|sum_of_squares|var_pop|histogram|case|coalesce|greatest|ifnull|iif|isnull|least|nullif|nvl|curdate|current_date' + - '|curtime|dateadd|datediff|datepart|datetrunc|date_add|date_diff|date_part|date_trunc|day|dayname|dayofmonth|dayofweek' + - '|dayofyear|day_name|day_of_month|day_of_week|day_of_year|dom|dow|doy|hour|hour_of_day|idow|isodayofweek|isodow' + - '|isoweek|isoweekofyear|iso_day_of_week|iso_week_of_year|iw|iwoy|minute|minute_of_day|minute_of_hour|month|monthname' + - '|month_name|month_of_year|now|quarter|second|second_of_minute|timestampadd|timestampdiff|timestamp_add|timestamp_diff' + - '|today|week|week_of_year|year|abs|acos|asin|atan|atan2|cbrt|ceil|ceiling|cos|cosh|cot|degrees|e|exp|expm1|floor' + - '|log|log10|mod|pi|power|radians|rand|random|round|sign|signum|sin|sinh|sqrt|tan|truncate|ascii|bit_length|char' + - '|character_length|char_length|concat|insert|lcase|left|length|locate|ltrim|database|user|st_astext|st_aswkt|st_distance' + - '|st_geometrytype|st_geomfromtext|st_wkttosql|st_x|st_y|st_z|score'; + 'avg|count|first|first_value|last|last_value|max|min|sum|kurtosis|mad|percentile|percentile_rank|skewness' + + '|stddev_pop|sum_of_squares|var_pop|histogram|case|coalesce|greatest|ifnull|iif|isnull|least|nullif|nvl' + + '|curdate|current_date|current_time|current_timestamp|curtime|dateadd|datediff|datepart|datetrunc|date_add' + + '|date_diff|date_part|date_trunc|day|dayname|dayofmonth|dayofweek|dayofyear|day_name|day_of_month|day_of_week' + + '|day_of_year|dom|dow|doy|hour|hour_of_day|idow|isodayofweek|isodow|isoweek|isoweekofyear|iso_day_of_week|iso_week_of_year' + + '|iw|iwoy|minute|minute_of_day|minute_of_hour|month|monthname|month_name|month_of_year|now|quarter|second|second_of_minute' + + '|timestampadd|timestampdiff|timestamp_add|timestamp_diff|today|week|week_of_year|year|abs|acos|asin|atan|atan2|cbrt' + + '|ceil|ceiling|cos|cosh|cot|degrees|e|exp|expm1|floor|log|log10|mod|pi|power|radians|rand|random|round|sign|signum|sin' + + '|sinh|sqrt|tan|truncate|ascii|bit_length|char|character_length|char_length|concat|insert|lcase|left|length|locate' + + '|ltrim|octet_length|position|repeat|replace|right|rtrim|space|substring|ucase|cast|convert|database|user|st_astext|st_aswkt' + + '|st_distance|st_geometrytype|st_geomfromtext|st_wkttosql|st_x|st_y|st_z|score'; // See https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-data-types.html const dataTypes =