spark-sql-language-server 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +30 -0
  2. package/out/sparksql-server-worker.js +2 -0
  3. package/out/sparksql-server-worker.js.map +1 -0
  4. package/out-tsc/assets/built-in-functions.d.ts +9 -0
  5. package/out-tsc/assets/built-in-functions.js +3996 -0
  6. package/out-tsc/assets/built-in-functions.js.map +1 -0
  7. package/out-tsc/auto-completion.d.ts +4 -0
  8. package/out-tsc/auto-completion.js +74 -0
  9. package/out-tsc/auto-completion.js.map +1 -0
  10. package/out-tsc/constant.d.ts +2 -0
  11. package/out-tsc/constant.js +6 -0
  12. package/out-tsc/constant.js.map +1 -0
  13. package/out-tsc/index.d.ts +3 -0
  14. package/out-tsc/index.js +20 -0
  15. package/out-tsc/index.js.map +1 -0
  16. package/out-tsc/lib/SparkSqlLexer.d.ts +421 -0
  17. package/out-tsc/lib/SparkSqlLexer.js +2501 -0
  18. package/out-tsc/lib/SparkSqlLexer.js.map +1 -0
  19. package/out-tsc/lib/SparkSqlParser.d.ts +5888 -0
  20. package/out-tsc/lib/SparkSqlParser.js +32320 -0
  21. package/out-tsc/lib/SparkSqlParser.js.map +1 -0
  22. package/out-tsc/lib/SparkSqlParserListener.d.ts +1089 -0
  23. package/out-tsc/lib/SparkSqlParserListener.js +3 -0
  24. package/out-tsc/lib/SparkSqlParserListener.js.map +1 -0
  25. package/out-tsc/lib/SparkSqlParserVisitor.d.ts +727 -0
  26. package/out-tsc/lib/SparkSqlParserVisitor.js +3 -0
  27. package/out-tsc/lib/SparkSqlParserVisitor.js.map +1 -0
  28. package/out-tsc/listeners/parse-error.listener.d.ts +11 -0
  29. package/out-tsc/listeners/parse-error.listener.js +48 -0
  30. package/out-tsc/listeners/parse-error.listener.js.map +1 -0
  31. package/out-tsc/listeners/statement.listener.d.ts +11 -0
  32. package/out-tsc/listeners/statement.listener.js +44 -0
  33. package/out-tsc/listeners/statement.listener.js.map +1 -0
  34. package/out-tsc/lsp-server.d.ts +15 -0
  35. package/out-tsc/lsp-server.js +81 -0
  36. package/out-tsc/lsp-server.js.map +1 -0
  37. package/out-tsc/parsing-warehouse.d.ts +19 -0
  38. package/out-tsc/parsing-warehouse.js +63 -0
  39. package/out-tsc/parsing-warehouse.js.map +1 -0
  40. package/out-tsc/protocol-translation.d.ts +6 -0
  41. package/out-tsc/protocol-translation.js +128 -0
  42. package/out-tsc/protocol-translation.js.map +1 -0
  43. package/out-tsc/public-apis.d.ts +1 -0
  44. package/out-tsc/public-apis.js +6 -0
  45. package/out-tsc/public-apis.js.map +1 -0
  46. package/out-tsc/server-worker.d.ts +1 -0
  47. package/out-tsc/server-worker.js +126 -0
  48. package/out-tsc/server-worker.js.map +1 -0
  49. package/package.json +39 -0
@@ -0,0 +1,3996 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuiltInFunctions = void 0;
4
+ const vscode_languageserver_types_1 = require("vscode-languageserver-types");
5
+ const generateDescription = (v) => {
6
+ return [`#### ${v.name}`, `${v.funcDesc}`, `#### Examples`, '```sql', `${v.examples?.trim()}`, '```'].join('\n');
7
+ };
8
+ exports.BuiltInFunctions = [
9
+ {
10
+ name: 'any(expr)',
11
+ funcDesc: 'Returns true if at least one value of `expr` is true.',
12
+ examples: '> SELECT any(col) FROM VALUES (true), (false), (false) AS tab(col);\n true\n> SELECT any(col) FROM VALUES (NULL), (true), (false) AS tab(col);\n true\n> SELECT any(col) FROM VALUES (false), (false), (NULL) AS tab(col);\n false\n',
13
+ expr: 'any()',
14
+ description: {
15
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
16
+ value: ''
17
+ }
18
+ },
19
+ {
20
+ name: 'any_value(expr[, isIgnoreNull])',
21
+ funcDesc: 'Returns some value of `expr` for a group of rows. If `isIgnoreNull` is true, returns only non-null values.',
22
+ examples: '> SELECT any_value(col) FROM VALUES (10), (5), (20) AS tab(col);\n 10\n> SELECT any_value(col) FROM VALUES (NULL), (5), (20) AS tab(col);\n NULL\n> SELECT any_value(col, true) FROM VALUES (NULL), (5), (20) AS tab(col);\n 5\n',
23
+ expr: 'any_value()',
24
+ description: {
25
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
26
+ value: ''
27
+ }
28
+ },
29
+ {
30
+ name: 'approx_count_distinct(expr[, relativeSD])',
31
+ funcDesc: 'Returns the estimated cardinality by HyperLogLog++. `relativeSD` defines the maximum relative standard deviation allowed.',
32
+ examples: '> SELECT approx_count_distinct(col1) FROM VALUES (1), (1), (2), (2), (3) tab(col1);\n 3\n',
33
+ expr: 'approx_count_distinct()',
34
+ description: {
35
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
36
+ value: ''
37
+ }
38
+ },
39
+ {
40
+ name: 'approx_percentile(col, percentage [, accuracy])',
41
+ funcDesc: 'Returns the approximate `percentile` of the numeric or ansi interval column `col` which is the smallest value in the ordered `col` values (sorted from least to greatest) such that no more than `percentage` of `col` values is less than the value or equal to that value. The value of percentage must be between 0.0 and 1.0. The `accuracy` parameter (default: 10000) is a positive numeric literal which controls approximation accuracy at the cost of memory. Higher value of `accuracy` yields better accuracy, `1.0/accuracy` is the relative error of the approximation. When `percentage` is an array, each value of the percentage array must be between 0.0 and 1.0. In this case, returns the approximate percentile array of column `col` at the given percentage array.',
42
+ examples: "> SELECT approx_percentile(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col);\n [1,1,0]\n> SELECT approx_percentile(col, 0.5, 100) FROM VALUES (0), (6), (7), (9), (10) AS tab(col);\n 7\n> SELECT approx_percentile(col, 0.5, 100) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '1' MONTH), (INTERVAL '2' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-1\n> SELECT approx_percentile(col, array(0.5, 0.7), 100) FROM VALUES (INTERVAL '0' SECOND), (INTERVAL '1' SECOND), (INTERVAL '2' SECOND), (INTERVAL '10' SECOND) AS tab(col);\n [0 00:00:01.000000000,0 00:00:02.000000000]\n",
43
+ expr: 'approx_percentile()',
44
+ description: {
45
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
46
+ value: ''
47
+ }
48
+ },
49
+ {
50
+ name: 'array_agg(expr)',
51
+ funcDesc: 'Collects and returns a list of non-unique elements.',
52
+ examples: '> SELECT array_agg(col) FROM VALUES (1), (2), (1) AS tab(col);\n [1,2,1]\n',
53
+ expr: 'array_agg()',
54
+ description: {
55
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
56
+ value: ''
57
+ }
58
+ },
59
+ {
60
+ name: 'avg(expr)',
61
+ funcDesc: 'Returns the mean calculated from values of a group.',
62
+ examples: '> SELECT avg(col) FROM VALUES (1), (2), (3) AS tab(col);\n 2.0\n> SELECT avg(col) FROM VALUES (1), (2), (NULL) AS tab(col);\n 1.5\n',
63
+ expr: 'avg()',
64
+ description: {
65
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
66
+ value: ''
67
+ }
68
+ },
69
+ {
70
+ name: 'bit_and(expr)',
71
+ funcDesc: 'Returns the bitwise AND of all non-null input values, or null if none.',
72
+ examples: '> SELECT bit_and(col) FROM VALUES (3), (5) AS tab(col);\n 1\n',
73
+ expr: 'bit_and()',
74
+ description: {
75
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
76
+ value: ''
77
+ }
78
+ },
79
+ {
80
+ name: 'bit_or(expr)',
81
+ funcDesc: 'Returns the bitwise OR of all non-null input values, or null if none.',
82
+ examples: '> SELECT bit_or(col) FROM VALUES (3), (5) AS tab(col);\n 7\n',
83
+ expr: 'bit_or()',
84
+ description: {
85
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
86
+ value: ''
87
+ }
88
+ },
89
+ {
90
+ name: 'bit_xor(expr)',
91
+ funcDesc: 'Returns the bitwise XOR of all non-null input values, or null if none.',
92
+ examples: '> SELECT bit_xor(col) FROM VALUES (3), (5) AS tab(col);\n 6\n',
93
+ expr: 'bit_xor()',
94
+ description: {
95
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
96
+ value: ''
97
+ }
98
+ },
99
+ {
100
+ name: 'bool_and(expr)',
101
+ funcDesc: 'Returns true if all values of `expr` are true.',
102
+ examples: '> SELECT bool_and(col) FROM VALUES (true), (true), (true) AS tab(col);\n true\n> SELECT bool_and(col) FROM VALUES (NULL), (true), (true) AS tab(col);\n true\n> SELECT bool_and(col) FROM VALUES (true), (false), (true) AS tab(col);\n false\n',
103
+ expr: 'bool_and()',
104
+ description: {
105
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
106
+ value: ''
107
+ }
108
+ },
109
+ {
110
+ name: 'bool_or(expr)',
111
+ funcDesc: 'Returns true if at least one value of `expr` is true.',
112
+ examples: '> SELECT bool_or(col) FROM VALUES (true), (false), (false) AS tab(col);\n true\n> SELECT bool_or(col) FROM VALUES (NULL), (true), (false) AS tab(col);\n true\n> SELECT bool_or(col) FROM VALUES (false), (false), (NULL) AS tab(col);\n false\n',
113
+ expr: 'bool_or()',
114
+ description: {
115
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
116
+ value: ''
117
+ }
118
+ },
119
+ {
120
+ name: 'collect_list(expr)',
121
+ funcDesc: 'Collects and returns a list of non-unique elements.',
122
+ examples: '> SELECT collect_list(col) FROM VALUES (1), (2), (1) AS tab(col);\n [1,2,1]\n',
123
+ expr: 'collect_list()',
124
+ description: {
125
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
126
+ value: ''
127
+ }
128
+ },
129
+ {
130
+ name: 'collect_set(expr)',
131
+ funcDesc: 'Collects and returns a set of unique elements.',
132
+ examples: '> SELECT collect_set(col) FROM VALUES (1), (2), (1) AS tab(col);\n [1,2]\n',
133
+ expr: 'collect_set()',
134
+ description: {
135
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
136
+ value: ''
137
+ }
138
+ },
139
+ {
140
+ name: 'corr(expr1, expr2)',
141
+ funcDesc: 'Returns Pearson coefficient of correlation between a set of number pairs.',
142
+ examples: '> SELECT corr(c1, c2) FROM VALUES (3, 2), (3, 3), (6, 4) as tab(c1, c2);\n 0.8660254037844387\n',
143
+ expr: 'corr()',
144
+ description: {
145
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
146
+ value: ''
147
+ }
148
+ },
149
+ {
150
+ name: 'count(*)',
151
+ funcDesc: 'Returns the total number of retrieved rows, including rows containing null.',
152
+ examples: '> SELECT count(*) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 4\n> SELECT count(col) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 3\n> SELECT count(DISTINCT col) FROM VALUES (NULL), (5), (5), (10) AS tab(col);\n 2\n',
153
+ expr: 'count()',
154
+ description: {
155
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
156
+ value: ''
157
+ }
158
+ },
159
+ {
160
+ name: 'count(expr[, expr...])',
161
+ funcDesc: 'Returns the number of rows for which the supplied expression(s) are all non-null.',
162
+ examples: '> SELECT count(*) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 4\n> SELECT count(col) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 3\n> SELECT count(DISTINCT col) FROM VALUES (NULL), (5), (5), (10) AS tab(col);\n 2\n',
163
+ expr: 'count()',
164
+ description: {
165
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
166
+ value: ''
167
+ }
168
+ },
169
+ {
170
+ name: 'count(DISTINCT expr[, expr...])',
171
+ funcDesc: 'Returns the number of rows for which the supplied expression(s) are unique and non-null.',
172
+ examples: '> SELECT count(*) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 4\n> SELECT count(col) FROM VALUES (NULL), (5), (5), (20) AS tab(col);\n 3\n> SELECT count(DISTINCT col) FROM VALUES (NULL), (5), (5), (10) AS tab(col);\n 2\n',
173
+ expr: 'count()',
174
+ description: {
175
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
176
+ value: ''
177
+ }
178
+ },
179
+ {
180
+ name: 'count_if(expr)',
181
+ funcDesc: 'Returns the number of `TRUE` values for the expression.',
182
+ examples: '> SELECT count_if(col % 2 = 0) FROM VALUES (NULL), (0), (1), (2), (3) AS tab(col);\n 2\n> SELECT count_if(col IS NULL) FROM VALUES (NULL), (0), (1), (2), (3) AS tab(col);\n 1\n',
183
+ expr: 'count_if()',
184
+ description: {
185
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
186
+ value: ''
187
+ }
188
+ },
189
+ {
190
+ name: 'count_min_sketch(col, eps, confidence, seed)',
191
+ funcDesc: 'Returns a count-min sketch of a column with the given esp, confidence and seed. The result is an array of bytes, which can be deserialized to a `CountMinSketch` before usage. Count-min sketch is a probabilistic data structure used for cardinality estimation using sub-linear space.',
192
+ examples: '> SELECT hex(count_min_sketch(col, 0.5d, 0.5d, 1)) FROM VALUES (1), (2), (1) AS tab(col);\n 0000000100000000000000030000000100000004000000005D8D6AB90000000000000000000000000000000200000000000000010000000000000000\n',
193
+ expr: 'count_min_sketch()',
194
+ description: {
195
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
196
+ value: ''
197
+ }
198
+ },
199
+ {
200
+ name: 'covar_pop(expr1, expr2)',
201
+ funcDesc: 'Returns the population covariance of a set of number pairs.',
202
+ examples: '> SELECT covar_pop(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2);\n 0.6666666666666666\n',
203
+ expr: 'covar_pop()',
204
+ description: {
205
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
206
+ value: ''
207
+ }
208
+ },
209
+ {
210
+ name: 'covar_samp(expr1, expr2)',
211
+ funcDesc: 'Returns the sample covariance of a set of number pairs.',
212
+ examples: '> SELECT covar_samp(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2);\n 1.0\n',
213
+ expr: 'covar_samp()',
214
+ description: {
215
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
216
+ value: ''
217
+ }
218
+ },
219
+ {
220
+ name: 'every(expr)',
221
+ funcDesc: 'Returns true if all values of `expr` are true.',
222
+ examples: '> SELECT every(col) FROM VALUES (true), (true), (true) AS tab(col);\n true\n> SELECT every(col) FROM VALUES (NULL), (true), (true) AS tab(col);\n true\n> SELECT every(col) FROM VALUES (true), (false), (true) AS tab(col);\n false\n',
223
+ expr: 'every()',
224
+ description: {
225
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
226
+ value: ''
227
+ }
228
+ },
229
+ {
230
+ name: 'first(expr[, isIgnoreNull])',
231
+ funcDesc: 'Returns the first value of `expr` for a group of rows. If `isIgnoreNull` is true, returns only non-null values.',
232
+ examples: '> SELECT first(col) FROM VALUES (10), (5), (20) AS tab(col);\n 10\n> SELECT first(col) FROM VALUES (NULL), (5), (20) AS tab(col);\n NULL\n> SELECT first(col, true) FROM VALUES (NULL), (5), (20) AS tab(col);\n 5\n',
233
+ expr: 'first()',
234
+ description: {
235
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
236
+ value: ''
237
+ }
238
+ },
239
+ {
240
+ name: 'first_value(expr[, isIgnoreNull])',
241
+ funcDesc: 'Returns the first value of `expr` for a group of rows. If `isIgnoreNull` is true, returns only non-null values.',
242
+ examples: '> SELECT first_value(col) FROM VALUES (10), (5), (20) AS tab(col);\n 10\n> SELECT first_value(col) FROM VALUES (NULL), (5), (20) AS tab(col);\n NULL\n> SELECT first_value(col, true) FROM VALUES (NULL), (5), (20) AS tab(col);\n 5\n',
243
+ expr: 'first_value()',
244
+ description: {
245
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
246
+ value: ''
247
+ }
248
+ },
249
+ {
250
+ name: 'grouping(col)',
251
+ funcDesc: 'indicates whether a specified column in a GROUP BY is aggregated or not, returns 1 for aggregated or 0 for not aggregated in the result set.",',
252
+ examples: "> SELECT name, grouping(name), sum(age) FROM VALUES (2, 'Alice'), (5, 'Bob') people(age, name) GROUP BY cube(name);\n Alice 0 2\n Bob 0 5\n NULL 1 7\n",
253
+ expr: 'grouping()',
254
+ description: {
255
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
256
+ value: ''
257
+ }
258
+ },
259
+ {
260
+ name: 'grouping_id([col1[, col2 ..]])',
261
+ funcDesc: 'returns the level of grouping, equals to `(grouping(c1) << (n-1)) + (grouping(c2) << (n-2)) + ... + grouping(cn)`',
262
+ examples: "> SELECT name, grouping_id(), sum(age), avg(height) FROM VALUES (2, 'Alice', 165), (5, 'Bob', 180) people(age, name, height) GROUP BY cube(name, height);\n Alice 0 2 165.0\n Alice 1 2 165.0\n NULL 3 7 172.5\n Bob 0 5 180.0\n Bob 1 5 180.0\n NULL 2 2 165.0\n NULL 2 5 180.0\n",
263
+ expr: 'grouping_id()',
264
+ description: {
265
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
266
+ value: ''
267
+ }
268
+ },
269
+ {
270
+ name: 'histogram_numeric(expr, nb)',
271
+ funcDesc: "Computes a histogram on numeric 'expr' using nb bins. The return value is an array of (x,y) pairs representing the centers of the histogram's bins. As the value of 'nb' is increased, the histogram approximation gets finer-grained, but may yield artifacts around outliers. In practice, 20-40 histogram bins appear to work well, with more bins being required for skewed or smaller datasets. Note that this function creates a histogram with non-uniform bin widths. It offers no guarantees in terms of the mean-squared-error of the histogram, but in practice is comparable to the histograms produced by the R/S-Plus statistical computing packages. Note: the output type of the 'x' field in the return value is propagated from the input value consumed in the aggregate function.",
272
+ examples: '> SELECT histogram_numeric(col, 5) FROM VALUES (0), (1), (2), (10) AS tab(col);\n [{"x":0,"y":1.0},{"x":1,"y":1.0},{"x":2,"y":1.0},{"x":10,"y":1.0}]\n',
273
+ expr: 'histogram_numeric()',
274
+ description: {
275
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
276
+ value: ''
277
+ }
278
+ },
279
+ {
280
+ name: 'kurtosis(expr)',
281
+ funcDesc: 'Returns the kurtosis value calculated from values of a group.',
282
+ examples: '> SELECT kurtosis(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col);\n -0.7014368047529627\n> SELECT kurtosis(col) FROM VALUES (1), (10), (100), (10), (1) as tab(col);\n 0.19432323191699075\n',
283
+ expr: 'kurtosis()',
284
+ description: {
285
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
286
+ value: ''
287
+ }
288
+ },
289
+ {
290
+ name: 'last(expr[, isIgnoreNull])',
291
+ funcDesc: 'Returns the last value of `expr` for a group of rows. If `isIgnoreNull` is true, returns only non-null values',
292
+ examples: '> SELECT last(col) FROM VALUES (10), (5), (20) AS tab(col);\n 20\n> SELECT last(col) FROM VALUES (10), (5), (NULL) AS tab(col);\n NULL\n> SELECT last(col, true) FROM VALUES (10), (5), (NULL) AS tab(col);\n 5\n',
293
+ expr: 'last()',
294
+ description: {
295
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
296
+ value: ''
297
+ }
298
+ },
299
+ {
300
+ name: 'last_value(expr[, isIgnoreNull])',
301
+ funcDesc: 'Returns the last value of `expr` for a group of rows. If `isIgnoreNull` is true, returns only non-null values',
302
+ examples: '> SELECT last_value(col) FROM VALUES (10), (5), (20) AS tab(col);\n 20\n> SELECT last_value(col) FROM VALUES (10), (5), (NULL) AS tab(col);\n NULL\n> SELECT last_value(col, true) FROM VALUES (10), (5), (NULL) AS tab(col);\n 5\n',
303
+ expr: 'last_value()',
304
+ description: {
305
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
306
+ value: ''
307
+ }
308
+ },
309
+ {
310
+ name: 'max(expr)',
311
+ funcDesc: 'Returns the maximum value of `expr`.',
312
+ examples: '> SELECT max(col) FROM VALUES (10), (50), (20) AS tab(col);\n 50\n',
313
+ expr: 'max()',
314
+ description: {
315
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
316
+ value: ''
317
+ }
318
+ },
319
+ {
320
+ name: 'max_by(x, y)',
321
+ funcDesc: 'Returns the value of `x` associated with the maximum value of `y`.',
322
+ examples: "> SELECT max_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y);\n b\n",
323
+ expr: 'max_by()',
324
+ description: {
325
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
326
+ value: ''
327
+ }
328
+ },
329
+ {
330
+ name: 'mean(expr)',
331
+ funcDesc: 'Returns the mean calculated from values of a group.',
332
+ examples: '> SELECT mean(col) FROM VALUES (1), (2), (3) AS tab(col);\n 2.0\n> SELECT mean(col) FROM VALUES (1), (2), (NULL) AS tab(col);\n 1.5\n',
333
+ expr: 'mean()',
334
+ description: {
335
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
336
+ value: ''
337
+ }
338
+ },
339
+ {
340
+ name: 'median(col)',
341
+ funcDesc: 'Returns the median of numeric or ANSI interval column `col`.',
342
+ examples: "> SELECT median(col) FROM VALUES (0), (10) AS tab(col);\n 5.0\n> SELECT median(col) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-5\n",
343
+ expr: 'median()',
344
+ description: {
345
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
346
+ value: ''
347
+ }
348
+ },
349
+ {
350
+ name: 'min(expr)',
351
+ funcDesc: 'Returns the minimum value of `expr`.',
352
+ examples: '> SELECT min(col) FROM VALUES (10), (-1), (20) AS tab(col);\n -1\n',
353
+ expr: 'min()',
354
+ description: {
355
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
356
+ value: ''
357
+ }
358
+ },
359
+ {
360
+ name: 'min_by(x, y)',
361
+ funcDesc: 'Returns the value of `x` associated with the minimum value of `y`.',
362
+ examples: "> SELECT min_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y);\n a\n",
363
+ expr: 'min_by()',
364
+ description: {
365
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
366
+ value: ''
367
+ }
368
+ },
369
+ {
370
+ name: 'mode(col)',
371
+ funcDesc: 'Returns the most frequent value for the values within `col`. NULL values are ignored. If all the values are NULL, or there are 0 rows, returns NULL.',
372
+ examples: "> SELECT mode(col) FROM VALUES (0), (10), (10) AS tab(col);\n 10\n> SELECT mode(col) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '10' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-10\n> SELECT mode(col) FROM VALUES (0), (10), (10), (null), (null), (null) AS tab(col);\n 10\n",
373
+ expr: 'mode()',
374
+ description: {
375
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
376
+ value: ''
377
+ }
378
+ },
379
+ {
380
+ name: 'percentile(col, percentage [, frequency])',
381
+ funcDesc: 'Returns the exact percentile value of numeric or ANSI interval column `col` at the given percentage. The value of percentage must be between 0.0 and 1.0. The value of frequency should be positive integral',
382
+ examples: "> SELECT percentile(col, 0.3) FROM VALUES (0), (10) AS tab(col);\n 3.0\n> SELECT percentile(col, array(0.25, 0.75)) FROM VALUES (0), (10) AS tab(col);\n [2.5,7.5]\n> SELECT percentile(col, 0.5) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-5\n> SELECT percentile(col, array(0.2, 0.5)) FROM VALUES (INTERVAL '0' SECOND), (INTERVAL '10' SECOND) AS tab(col);\n [0 00:00:02.000000000,0 00:00:05.000000000]\n",
383
+ expr: 'percentile()',
384
+ description: {
385
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
386
+ value: ''
387
+ }
388
+ },
389
+ {
390
+ name: 'percentile(col, array(percentage1 [, percentage2]...) [, frequency])',
391
+ funcDesc: 'Returns the exact percentile value array of numeric column `col` at the given percentage(s). Each value of the percentage array must be between 0.0 and 1.0. The value of frequency should be positive integral',
392
+ examples: "> SELECT percentile(col, 0.3) FROM VALUES (0), (10) AS tab(col);\n 3.0\n> SELECT percentile(col, array(0.25, 0.75)) FROM VALUES (0), (10) AS tab(col);\n [2.5,7.5]\n> SELECT percentile(col, 0.5) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-5\n> SELECT percentile(col, array(0.2, 0.5)) FROM VALUES (INTERVAL '0' SECOND), (INTERVAL '10' SECOND) AS tab(col);\n [0 00:00:02.000000000,0 00:00:05.000000000]\n",
393
+ expr: 'percentile()',
394
+ description: {
395
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
396
+ value: ''
397
+ }
398
+ },
399
+ {
400
+ name: 'percentile_approx(col, percentage [, accuracy])',
401
+ funcDesc: 'Returns the approximate `percentile` of the numeric or ansi interval column `col` which is the smallest value in the ordered `col` values (sorted from least to greatest) such that no more than `percentage` of `col` values is less than the value or equal to that value. The value of percentage must be between 0.0 and 1.0. The `accuracy` parameter (default: 10000) is a positive numeric literal which controls approximation accuracy at the cost of memory. Higher value of `accuracy` yields better accuracy, `1.0/accuracy` is the relative error of the approximation. When `percentage` is an array, each value of the percentage array must be between 0.0 and 1.0. In this case, returns the approximate percentile array of column `col` at the given percentage array.',
402
+ examples: "> SELECT percentile_approx(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col);\n [1,1,0]\n> SELECT percentile_approx(col, 0.5, 100) FROM VALUES (0), (6), (7), (9), (10) AS tab(col);\n 7\n> SELECT percentile_approx(col, 0.5, 100) FROM VALUES (INTERVAL '0' MONTH), (INTERVAL '1' MONTH), (INTERVAL '2' MONTH), (INTERVAL '10' MONTH) AS tab(col);\n 0-1\n> SELECT percentile_approx(col, array(0.5, 0.7), 100) FROM VALUES (INTERVAL '0' SECOND), (INTERVAL '1' SECOND), (INTERVAL '2' SECOND), (INTERVAL '10' SECOND) AS tab(col);\n [0 00:00:01.000000000,0 00:00:02.000000000]\n",
403
+ expr: 'percentile_approx()',
404
+ description: {
405
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
406
+ value: ''
407
+ }
408
+ },
409
+ {
410
+ name: 'regr_avgx(y, x)',
411
+ funcDesc: 'Returns the average of the independent variable for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
412
+ examples: '> SELECT regr_avgx(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 2.75\n> SELECT regr_avgx(y, x) FROM VALUES (1, null) AS tab(y, x);\n NULL\n> SELECT regr_avgx(y, x) FROM VALUES (null, 1) AS tab(y, x);\n NULL\n> SELECT regr_avgx(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 3.0\n> SELECT regr_avgx(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 3.0\n',
413
+ expr: 'regr_avgx()',
414
+ description: {
415
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
416
+ value: ''
417
+ }
418
+ },
419
+ {
420
+ name: 'regr_avgy(y, x)',
421
+ funcDesc: 'Returns the average of the dependent variable for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
422
+ examples: '> SELECT regr_avgy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 1.75\n> SELECT regr_avgy(y, x) FROM VALUES (1, null) AS tab(y, x);\n NULL\n> SELECT regr_avgy(y, x) FROM VALUES (null, 1) AS tab(y, x);\n NULL\n> SELECT regr_avgy(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 1.6666666666666667\n> SELECT regr_avgy(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 1.5\n',
423
+ expr: 'regr_avgy()',
424
+ description: {
425
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
426
+ value: ''
427
+ }
428
+ },
429
+ {
430
+ name: 'regr_count(y, x)',
431
+ funcDesc: 'Returns the number of non-null number pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
432
+ examples: '> SELECT regr_count(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 4\n> SELECT regr_count(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 3\n> SELECT regr_count(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 2\n',
433
+ expr: 'regr_count()',
434
+ description: {
435
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
436
+ value: ''
437
+ }
438
+ },
439
+ {
440
+ name: 'regr_intercept(y, x)',
441
+ funcDesc: 'Returns the intercept of the univariate linear regression line for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
442
+ examples: '> SELECT regr_intercept(y, x) FROM VALUES (1,1), (2,2), (3,3) AS tab(y, x);\n 0.0\n> SELECT regr_intercept(y, x) FROM VALUES (1, null) AS tab(y, x);\n NULL\n> SELECT regr_intercept(y, x) FROM VALUES (null, 1) AS tab(y, x);\n NULL\n',
443
+ expr: 'regr_intercept()',
444
+ description: {
445
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
446
+ value: ''
447
+ }
448
+ },
449
+ {
450
+ name: 'regr_r2(y, x)',
451
+ funcDesc: 'Returns the coefficient of determination for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
452
+ examples: '> SELECT regr_r2(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 0.2727272727272727\n> SELECT regr_r2(y, x) FROM VALUES (1, null) AS tab(y, x);\n NULL\n> SELECT regr_r2(y, x) FROM VALUES (null, 1) AS tab(y, x);\n NULL\n> SELECT regr_r2(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 0.7500000000000001\n> SELECT regr_r2(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 1.0\n',
453
+ expr: 'regr_r2()',
454
+ description: {
455
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
456
+ value: ''
457
+ }
458
+ },
459
+ {
460
+ name: 'regr_slope(y, x)',
461
+ funcDesc: 'Returns the slope of the linear regression line for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
462
+ examples: '> SELECT regr_slope(y, x) FROM VALUES (1,1), (2,2), (3,3) AS tab(y, x);\n 1.0\n> SELECT regr_slope(y, x) FROM VALUES (1, null) AS tab(y, x);\n NULL\n> SELECT regr_slope(y, x) FROM VALUES (null, 1) AS tab(y, x);\n NULL\n',
463
+ expr: 'regr_slope()',
464
+ description: {
465
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
466
+ value: ''
467
+ }
468
+ },
469
+ {
470
+ name: 'regr_sxx(y, x)',
471
+ funcDesc: 'Returns REGR_COUNT(y, x) * VAR_POP(x) for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
472
+ examples: '> SELECT regr_sxx(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 2.75\n> SELECT regr_sxx(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 2.0\n> SELECT regr_sxx(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 2.0\n',
473
+ expr: 'regr_sxx()',
474
+ description: {
475
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
476
+ value: ''
477
+ }
478
+ },
479
+ {
480
+ name: 'regr_sxy(y, x)',
481
+ funcDesc: 'Returns REGR_COUNT(y, x) * COVAR_POP(y, x) for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
482
+ examples: '> SELECT regr_sxy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 0.75\n> SELECT regr_sxy(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 1.0\n> SELECT regr_sxy(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 1.0\n',
483
+ expr: 'regr_sxy()',
484
+ description: {
485
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
486
+ value: ''
487
+ }
488
+ },
489
+ {
490
+ name: 'regr_syy(y, x)',
491
+ funcDesc: 'Returns REGR_COUNT(y, x) * VAR_POP(y) for non-null pairs in a group, where `y` is the dependent variable and `x` is the independent variable.',
492
+ examples: '> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);\n 0.75\n> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);\n 0.6666666666666666\n> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);\n 0.5\n',
493
+ expr: 'regr_syy()',
494
+ description: {
495
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
496
+ value: ''
497
+ }
498
+ },
499
+ {
500
+ name: 'skewness(expr)',
501
+ funcDesc: 'Returns the skewness value calculated from values of a group.',
502
+ examples: '> SELECT skewness(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col);\n 1.1135657469022011\n> SELECT skewness(col) FROM VALUES (-1000), (-100), (10), (20) AS tab(col);\n -1.1135657469022011\n',
503
+ expr: 'skewness()',
504
+ description: {
505
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
506
+ value: ''
507
+ }
508
+ },
509
+ {
510
+ name: 'some(expr)',
511
+ funcDesc: 'Returns true if at least one value of `expr` is true.',
512
+ examples: '> SELECT some(col) FROM VALUES (true), (false), (false) AS tab(col);\n true\n> SELECT some(col) FROM VALUES (NULL), (true), (false) AS tab(col);\n true\n> SELECT some(col) FROM VALUES (false), (false), (NULL) AS tab(col);\n false\n',
513
+ expr: 'some()',
514
+ description: {
515
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
516
+ value: ''
517
+ }
518
+ },
519
+ {
520
+ name: 'std(expr)',
521
+ funcDesc: 'Returns the sample standard deviation calculated from values of a group.',
522
+ examples: '> SELECT std(col) FROM VALUES (1), (2), (3) AS tab(col);\n 1.0\n',
523
+ expr: 'std()',
524
+ description: {
525
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
526
+ value: ''
527
+ }
528
+ },
529
+ {
530
+ name: 'stddev(expr)',
531
+ funcDesc: 'Returns the sample standard deviation calculated from values of a group.',
532
+ examples: '> SELECT stddev(col) FROM VALUES (1), (2), (3) AS tab(col);\n 1.0\n',
533
+ expr: 'stddev()',
534
+ description: {
535
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
536
+ value: ''
537
+ }
538
+ },
539
+ {
540
+ name: 'stddev_pop(expr)',
541
+ funcDesc: 'Returns the population standard deviation calculated from values of a group.',
542
+ examples: '> SELECT stddev_pop(col) FROM VALUES (1), (2), (3) AS tab(col);\n 0.816496580927726\n',
543
+ expr: 'stddev_pop()',
544
+ description: {
545
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
546
+ value: ''
547
+ }
548
+ },
549
+ {
550
+ name: 'stddev_samp(expr)',
551
+ funcDesc: 'Returns the sample standard deviation calculated from values of a group.',
552
+ examples: '> SELECT stddev_samp(col) FROM VALUES (1), (2), (3) AS tab(col);\n 1.0\n',
553
+ expr: 'stddev_samp()',
554
+ description: {
555
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
556
+ value: ''
557
+ }
558
+ },
559
+ {
560
+ name: 'sum(expr)',
561
+ funcDesc: 'Returns the sum calculated from values of a group.',
562
+ examples: '> SELECT sum(col) FROM VALUES (5), (10), (15) AS tab(col);\n 30\n> SELECT sum(col) FROM VALUES (NULL), (10), (15) AS tab(col);\n 25\n> SELECT sum(col) FROM VALUES (NULL), (NULL) AS tab(col);\n NULL\n',
563
+ expr: 'sum()',
564
+ description: {
565
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
566
+ value: ''
567
+ }
568
+ },
569
+ {
570
+ name: 'try_avg(expr)',
571
+ funcDesc: 'Returns the mean calculated from values of a group and the result is null on overflow.',
572
+ examples: "> SELECT try_avg(col) FROM VALUES (1), (2), (3) AS tab(col);\n 2.0\n> SELECT try_avg(col) FROM VALUES (1), (2), (NULL) AS tab(col);\n 1.5\n> SELECT try_avg(col) FROM VALUES (interval '2147483647 months'), (interval '1 months') AS tab(col);\n NULL\n",
573
+ expr: 'try_avg()',
574
+ description: {
575
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
576
+ value: ''
577
+ }
578
+ },
579
+ {
580
+ name: 'try_sum(expr)',
581
+ funcDesc: 'Returns the sum calculated from values of a group and the result is null on overflow.',
582
+ examples: '> SELECT try_sum(col) FROM VALUES (5), (10), (15) AS tab(col);\n 30\n> SELECT try_sum(col) FROM VALUES (NULL), (10), (15) AS tab(col);\n 25\n> SELECT try_sum(col) FROM VALUES (NULL), (NULL) AS tab(col);\n NULL\n> SELECT try_sum(col) FROM VALUES (9223372036854775807L), (1L) AS tab(col);\n NULL\n',
583
+ expr: 'try_sum()',
584
+ description: {
585
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
586
+ value: ''
587
+ }
588
+ },
589
+ {
590
+ name: 'var_pop(expr)',
591
+ funcDesc: 'Returns the population variance calculated from values of a group.',
592
+ examples: '> SELECT var_pop(col) FROM VALUES (1), (2), (3) AS tab(col);\n 0.6666666666666666\n',
593
+ expr: 'var_pop()',
594
+ description: {
595
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
596
+ value: ''
597
+ }
598
+ },
599
+ {
600
+ name: 'var_samp(expr)',
601
+ funcDesc: 'Returns the sample variance calculated from values of a group.',
602
+ examples: '> SELECT var_samp(col) FROM VALUES (1), (2), (3) AS tab(col);\n 1.0\n',
603
+ expr: 'var_samp()',
604
+ description: {
605
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
606
+ value: ''
607
+ }
608
+ },
609
+ {
610
+ name: 'variance(expr)',
611
+ funcDesc: 'Returns the sample variance calculated from values of a group.',
612
+ examples: '> SELECT variance(col) FROM VALUES (1), (2), (3) AS tab(col);\n 1.0\n',
613
+ expr: 'variance()',
614
+ description: {
615
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
616
+ value: ''
617
+ }
618
+ },
619
+ {
620
+ name: 'cume_dist()',
621
+ funcDesc: 'Computes the position of a value relative to all values in the partition.',
622
+ examples: "> SELECT a, b, cume_dist() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 0.6666666666666666\n A1 1 0.6666666666666666\n A1 2 1.0\n A2 3 1.0\n",
623
+ expr: 'cume_dist()',
624
+ description: {
625
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
626
+ value: ''
627
+ }
628
+ },
629
+ {
630
+ name: 'dense_rank()',
631
+ funcDesc: 'Computes the rank of a value in a group of values. The result is one plus the previously assigned rank value. Unlike the function rank, dense_rank will not produce gaps in the ranking sequence.',
632
+ examples: "> SELECT a, b, dense_rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 1\n A1 2 2\n A2 3 1\n",
633
+ expr: 'dense_rank()',
634
+ description: {
635
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
636
+ value: ''
637
+ }
638
+ },
639
+ {
640
+ name: 'lag(input[, offset[, default]])',
641
+ funcDesc: 'Returns the value of `input` at the `offset`th row before the current row in the window. The default value of `offset` is 1 and the default value of `default` is null. If the value of `input` at the `offset`th row is null, null is returned. If there is no such offset row (e.g., when the offset is 1, the first row of the window does not have any previous row), `default` is returned.',
642
+ examples: "> SELECT a, b, lag(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 NULL\n A1 1 1\n A1 2 1\n A2 3 NULL\n",
643
+ expr: 'lag()',
644
+ description: {
645
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
646
+ value: ''
647
+ }
648
+ },
649
+ {
650
+ name: 'lead(input[, offset[, default]])',
651
+ funcDesc: 'Returns the value of `input` at the `offset`th row after the current row in the window. The default value of `offset` is 1 and the default value of `default` is null. If the value of `input` at the `offset`th row is null, null is returned. If there is no such an offset row (e.g., when the offset is 1, the last row of the window does not have any subsequent row), `default` is returned.',
652
+ examples: "> SELECT a, b, lead(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 2\n A1 2 NULL\n A2 3 NULL\n",
653
+ expr: 'lead()',
654
+ description: {
655
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
656
+ value: ''
657
+ }
658
+ },
659
+ {
660
+ name: 'nth_value(input[, offset])',
661
+ funcDesc: 'Returns the value of `input` at the row that is the `offset`th row from beginning of the window frame. Offset starts at 1. If ignoreNulls=true, we will skip nulls when finding the `offset`th row. Otherwise, every row counts for the `offset`. If there is no such an `offset`th row (e.g., when the offset is 10, size of the window frame is less than 10), null is returned.',
662
+ examples: "> SELECT a, b, nth_value(b, 2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 1\n A1 2 1\n A2 3 NULL\n",
663
+ expr: 'nth_value()',
664
+ description: {
665
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
666
+ value: ''
667
+ }
668
+ },
669
+ {
670
+ name: 'ntile(n)',
671
+ funcDesc: 'Divides the rows for each window partition into `n` buckets ranging from 1 to at most `n`.',
672
+ examples: "> SELECT a, b, ntile(2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 1\n A1 2 2\n A2 3 1\n",
673
+ expr: 'ntile()',
674
+ description: {
675
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
676
+ value: ''
677
+ }
678
+ },
679
+ {
680
+ name: 'percent_rank()',
681
+ funcDesc: 'Computes the percentage ranking of a value in a group of values.',
682
+ examples: "> SELECT a, b, percent_rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 0.0\n A1 1 0.0\n A1 2 1.0\n A2 3 0.0\n",
683
+ expr: 'percent_rank()',
684
+ description: {
685
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
686
+ value: ''
687
+ }
688
+ },
689
+ {
690
+ name: 'rank()',
691
+ funcDesc: 'Computes the rank of a value in a group of values. The result is one plus the number of rows preceding or equal to the current row in the ordering of the partition. The values will produce gaps in the sequence.',
692
+ examples: "> SELECT a, b, rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 1\n A1 2 3\n A2 3 1\n",
693
+ expr: 'rank()',
694
+ description: {
695
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
696
+ value: ''
697
+ }
698
+ },
699
+ {
700
+ name: 'row_number()',
701
+ funcDesc: 'Assigns a unique, sequential number to each row, starting with one, according to the ordering of rows within the window partition.',
702
+ examples: "> SELECT a, b, row_number() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b);\n A1 1 1\n A1 1 2\n A1 2 3\n A2 3 1\n",
703
+ expr: 'row_number()',
704
+ description: {
705
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
706
+ value: ''
707
+ }
708
+ },
709
+ {
710
+ name: 'array(expr, ...)',
711
+ funcDesc: 'Returns an array with the given elements.',
712
+ examples: '> SELECT array(1, 2, 3);\n [1,2,3]\n',
713
+ expr: 'array()',
714
+ description: {
715
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
716
+ value: ''
717
+ }
718
+ },
719
+ {
720
+ name: 'array_append(array, element)',
721
+ funcDesc: 'Add the element at the end of the array passed as first argument. Type of element should be similar to type of the elements of the array. Null element is also appended into the array. But if the array passed, is NULL output is NULL',
722
+ examples: '> SELECT array_append(array(\'b\', \'d\', \'c\', \'a\'), \'d\');\n ["b","d","c","a","d"]\n> SELECT array_append(array(1, 2, 3, null), null);\n [1,2,3,null,null]\n> SELECT array_append(CAST(null as Array<Int>), 2);\n NULL\n',
723
+ expr: 'array_append()',
724
+ description: {
725
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
726
+ value: ''
727
+ }
728
+ },
729
+ {
730
+ name: 'array_compact(array)',
731
+ funcDesc: 'Removes null values from the array.',
732
+ examples: '> SELECT array_compact(array(1, 2, 3, null));\n [1,2,3]\n> SELECT array_compact(array("a", "b", "c"));\n ["a","b","c"]\n',
733
+ expr: 'array_compact()',
734
+ description: {
735
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
736
+ value: ''
737
+ }
738
+ },
739
+ {
740
+ name: 'array_contains(array, value)',
741
+ funcDesc: 'Returns true if the array contains the value.',
742
+ examples: '> SELECT array_contains(array(1, 2, 3), 2);\n true\n',
743
+ expr: 'array_contains()',
744
+ description: {
745
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
746
+ value: ''
747
+ }
748
+ },
749
+ {
750
+ name: 'array_distinct(array)',
751
+ funcDesc: 'Removes duplicate values from the array.',
752
+ examples: '> SELECT array_distinct(array(1, 2, 3, null, 3));\n [1,2,3,null]\n',
753
+ expr: 'array_distinct()',
754
+ description: {
755
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
756
+ value: ''
757
+ }
758
+ },
759
+ {
760
+ name: 'array_except(array1, array2)',
761
+ funcDesc: 'Returns an array of the elements in array1 but not in array2, without duplicates.',
762
+ examples: '> SELECT array_except(array(1, 2, 3), array(1, 3, 5));\n [2]\n',
763
+ expr: 'array_except()',
764
+ description: {
765
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
766
+ value: ''
767
+ }
768
+ },
769
+ {
770
+ name: 'array_insert(x, pos, val)',
771
+ funcDesc: "Places val into index pos of array x. Array indices start at 1, or start from the end if index is negative. Index above array size appends the array, or prepends the array if index is negative, with 'null' elements.",
772
+ examples: '> SELECT array_insert(array(1, 2, 3, 4), 5, 5);\n [1,2,3,4,5]\n> SELECT array_insert(array(5, 3, 2, 1), -3, 4);\n [5,4,3,2,1]\n',
773
+ expr: 'array_insert()',
774
+ description: {
775
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
776
+ value: ''
777
+ }
778
+ },
779
+ {
780
+ name: 'array_intersect(array1, array2)',
781
+ funcDesc: 'Returns an array of the elements in the intersection of array1 and array2, without duplicates.',
782
+ examples: '> SELECT array_intersect(array(1, 2, 3), array(1, 3, 5));\n [1,3]\n',
783
+ expr: 'array_intersect()',
784
+ description: {
785
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
786
+ value: ''
787
+ }
788
+ },
789
+ {
790
+ name: 'array_join(array, delimiter[, nullReplacement])',
791
+ funcDesc: 'Concatenates the elements of the given array using the delimiter and an optional string to replace nulls. If no value is set for nullReplacement, any null value is filtered.',
792
+ examples: "> SELECT array_join(array('hello', 'world'), ' ');\n hello world\n> SELECT array_join(array('hello', null ,'world'), ' ');\n hello world\n> SELECT array_join(array('hello', null ,'world'), ' ', ',');\n hello , world\n",
793
+ expr: 'array_join()',
794
+ description: {
795
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
796
+ value: ''
797
+ }
798
+ },
799
+ {
800
+ name: 'array_max(array)',
801
+ funcDesc: 'Returns the maximum value in the array. NaN is greater than any non-NaN elements for double/float type. NULL elements are skipped.',
802
+ examples: '> SELECT array_max(array(1, 20, null, 3));\n 20\n',
803
+ expr: 'array_max()',
804
+ description: {
805
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
806
+ value: ''
807
+ }
808
+ },
809
+ {
810
+ name: 'array_min(array)',
811
+ funcDesc: 'Returns the minimum value in the array. NaN is greater than any non-NaN elements for double/float type. NULL elements are skipped.',
812
+ examples: '> SELECT array_min(array(1, 20, null, 3));\n 1\n',
813
+ expr: 'array_min()',
814
+ description: {
815
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
816
+ value: ''
817
+ }
818
+ },
819
+ {
820
+ name: 'array_position(array, element)',
821
+ funcDesc: 'Returns the (1-based) index of the first element of the array as long.',
822
+ examples: '> SELECT array_position(array(3, 2, 1), 1);\n 3\n',
823
+ expr: 'array_position()',
824
+ description: {
825
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
826
+ value: ''
827
+ }
828
+ },
829
+ {
830
+ name: 'array_remove(array, element)',
831
+ funcDesc: 'Remove all elements that equal to element from array.',
832
+ examples: '> SELECT array_remove(array(1, 2, 3, null, 3), 3);\n [1,2,null]\n',
833
+ expr: 'array_remove()',
834
+ description: {
835
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
836
+ value: ''
837
+ }
838
+ },
839
+ {
840
+ name: 'array_repeat(element, count)',
841
+ funcDesc: 'Returns the array containing element count times.',
842
+ examples: '> SELECT array_repeat(\'123\', 2);\n ["123","123"]\n',
843
+ expr: 'array_repeat()',
844
+ description: {
845
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
846
+ value: ''
847
+ }
848
+ },
849
+ {
850
+ name: 'array_union(array1, array2)',
851
+ funcDesc: 'Returns an array of the elements in the union of array1 and array2, without duplicates.',
852
+ examples: '> SELECT array_union(array(1, 2, 3), array(1, 3, 5));\n [1,2,3,5]\n',
853
+ expr: 'array_union()',
854
+ description: {
855
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
856
+ value: ''
857
+ }
858
+ },
859
+ {
860
+ name: 'arrays_overlap(a1, a2)',
861
+ funcDesc: 'Returns true if a1 contains at least a non-null element present also in a2. If the arrays have no common element and they are both non-empty and either of them contains a null element null is returned, false otherwise.',
862
+ examples: '> SELECT arrays_overlap(array(1, 2, 3), array(3, 4, 5));\n true\n',
863
+ expr: 'arrays_overlap()',
864
+ description: {
865
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
866
+ value: ''
867
+ }
868
+ },
869
+ {
870
+ name: 'arrays_zip(a1, a2, ...)',
871
+ funcDesc: 'Returns a merged array of structs in which the N-th struct contains all N-th values of input arrays.',
872
+ examples: '> SELECT arrays_zip(array(1, 2, 3), array(2, 3, 4));\n [{"0":1,"1":2},{"0":2,"1":3},{"0":3,"1":4}]\n> SELECT arrays_zip(array(1, 2), array(2, 3), array(3, 4));\n [{"0":1,"1":2,"2":3},{"0":2,"1":3,"2":4}]\n',
873
+ expr: 'arrays_zip()',
874
+ description: {
875
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
876
+ value: ''
877
+ }
878
+ },
879
+ {
880
+ name: 'flatten(arrayOfArrays)',
881
+ funcDesc: 'Transforms an array of arrays into a single array.',
882
+ examples: '> SELECT flatten(array(array(1, 2), array(3, 4)));\n [1,2,3,4]\n',
883
+ expr: 'flatten()',
884
+ description: {
885
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
886
+ value: ''
887
+ }
888
+ },
889
+ {
890
+ name: 'get(array, index)',
891
+ funcDesc: 'Returns element of array at given (0-based) index. If the index points outside of the array boundaries, then this function returns NULL.',
892
+ examples: '> SELECT get(array(1, 2, 3), 0);\n 1\n> SELECT get(array(1, 2, 3), 3);\n NULL\n> SELECT get(array(1, 2, 3), -1);\n NULL\n',
893
+ expr: 'get()',
894
+ description: {
895
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
896
+ value: ''
897
+ }
898
+ },
899
+ {
900
+ name: 'sequence(start, stop, step)',
901
+ funcDesc: "Generates an array of elements from start to stop (inclusive), incrementing by step. The type of the returned elements is the same as the type of argument expressions. Supported types are: byte, short, integer, long, date, timestamp. The start and stop expressions must resolve to the same type. If start and stop expressions resolve to the 'date' or 'timestamp' type then the step expression must resolve to the 'interval' or 'year-month interval' or 'day-time interval' type, otherwise to the same type as the start and stop expressions.",
902
+ examples: "> SELECT sequence(1, 5);\n [1,2,3,4,5]\n> SELECT sequence(5, 1);\n [5,4,3,2,1]\n> SELECT sequence(to_date('2018-01-01'), to_date('2018-03-01'), interval 1 month);\n [2018-01-01,2018-02-01,2018-03-01]\n> SELECT sequence(to_date('2018-01-01'), to_date('2018-03-01'), interval '0-1' year to month);\n [2018-01-01,2018-02-01,2018-03-01]\n",
903
+ expr: 'sequence()',
904
+ description: {
905
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
906
+ value: ''
907
+ }
908
+ },
909
+ {
910
+ name: 'shuffle(array)',
911
+ funcDesc: 'Returns a random permutation of the given array.',
912
+ examples: '> SELECT shuffle(array(1, 20, 3, 5));\n [3,1,5,20]\n> SELECT shuffle(array(1, 20, null, 3));\n [20,null,3,1]\n',
913
+ expr: 'shuffle()',
914
+ description: {
915
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
916
+ value: ''
917
+ }
918
+ },
919
+ {
920
+ name: 'slice(x, start, length)',
921
+ funcDesc: 'Subsets array x starting from index start (array indices start at 1, or starting from the end if start is negative) with the specified length.',
922
+ examples: '> SELECT slice(array(1, 2, 3, 4), 2, 2);\n [2,3]\n> SELECT slice(array(1, 2, 3, 4), -2, 2);\n [3,4]\n',
923
+ expr: 'slice()',
924
+ description: {
925
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
926
+ value: ''
927
+ }
928
+ },
929
+ {
930
+ name: 'sort_array(array[, ascendingOrder])',
931
+ funcDesc: 'Sorts the input array in ascending or descending order according to the natural ordering of the array elements. NaN is greater than any non-NaN elements for double/float type. Null elements will be placed at the beginning of the returned array in ascending order or at the end of the returned array in descending order.',
932
+ examples: '> SELECT sort_array(array(\'b\', \'d\', null, \'c\', \'a\'), true);\n [null,"a","b","c","d"]\n',
933
+ expr: 'sort_array()',
934
+ description: {
935
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
936
+ value: ''
937
+ }
938
+ },
939
+ {
940
+ name: 'element_at(array, index)',
941
+ funcDesc: 'Returns element of array at given (1-based) index. If Index is 0, Spark will throw an error. If index < 0, accesses elements from the last to the first. The function returns NULL if the index exceeds the length of the array and `spark.sql.ansi.enabled` is set to false. If `spark.sql.ansi.enabled` is set to true, it throws ArrayIndexOutOfBoundsException for invalid indices.',
942
+ examples: "> SELECT element_at(array(1, 2, 3), 2);\n 2\n> SELECT element_at(map(1, 'a', 2, 'b'), 2);\n b\n",
943
+ expr: 'element_at()',
944
+ description: {
945
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
946
+ value: ''
947
+ }
948
+ },
949
+ {
950
+ name: 'element_at(map, key)',
951
+ funcDesc: 'Returns value for given key. The function returns NULL if the key is not contained in the map.',
952
+ examples: "> SELECT element_at(array(1, 2, 3), 2);\n 2\n> SELECT element_at(map(1, 'a', 2, 'b'), 2);\n b\n",
953
+ expr: 'element_at()',
954
+ description: {
955
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
956
+ value: ''
957
+ }
958
+ },
959
+ {
960
+ name: 'map(key0, value0, key1, value1, ...)',
961
+ funcDesc: 'Creates a map with the given key/value pairs.',
962
+ examples: '> SELECT map(1.0, \'2\', 3.0, \'4\');\n {1.0:"2",3.0:"4"}\n',
963
+ expr: 'map()',
964
+ description: {
965
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
966
+ value: ''
967
+ }
968
+ },
969
+ {
970
+ name: 'map_concat(map, ...)',
971
+ funcDesc: 'Returns the union of all the given maps',
972
+ examples: '> SELECT map_concat(map(1, \'a\', 2, \'b\'), map(3, \'c\'));\n {1:"a",2:"b",3:"c"}\n',
973
+ expr: 'map_concat()',
974
+ description: {
975
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
976
+ value: ''
977
+ }
978
+ },
979
+ {
980
+ name: 'map_contains_key(map, key)',
981
+ funcDesc: 'Returns true if the map contains the key.',
982
+ examples: "> SELECT map_contains_key(map(1, 'a', 2, 'b'), 1);\n true\n> SELECT map_contains_key(map(1, 'a', 2, 'b'), 3);\n false\n",
983
+ expr: 'map_contains_key()',
984
+ description: {
985
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
986
+ value: ''
987
+ }
988
+ },
989
+ {
990
+ name: 'map_entries(map)',
991
+ funcDesc: 'Returns an unordered array of all entries in the given map.',
992
+ examples: '> SELECT map_entries(map(1, \'a\', 2, \'b\'));\n [{"key":1,"value":"a"},{"key":2,"value":"b"}]\n',
993
+ expr: 'map_entries()',
994
+ description: {
995
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
996
+ value: ''
997
+ }
998
+ },
999
+ {
1000
+ name: 'map_from_arrays(keys, values)',
1001
+ funcDesc: 'Creates a map with a pair of the given key/value arrays. All elements in keys should not be null',
1002
+ examples: '> SELECT map_from_arrays(array(1.0, 3.0), array(\'2\', \'4\'));\n {1.0:"2",3.0:"4"}\n',
1003
+ expr: 'map_from_arrays()',
1004
+ description: {
1005
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1006
+ value: ''
1007
+ }
1008
+ },
1009
+ {
1010
+ name: 'map_from_entries(arrayOfEntries)',
1011
+ funcDesc: 'Returns a map created from the given array of entries.',
1012
+ examples: '> SELECT map_from_entries(array(struct(1, \'a\'), struct(2, \'b\')));\n {1:"a",2:"b"}\n',
1013
+ expr: 'map_from_entries()',
1014
+ description: {
1015
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1016
+ value: ''
1017
+ }
1018
+ },
1019
+ {
1020
+ name: 'map_keys(map)',
1021
+ funcDesc: 'Returns an unordered array containing the keys of the map.',
1022
+ examples: "> SELECT map_keys(map(1, 'a', 2, 'b'));\n [1,2]\n",
1023
+ expr: 'map_keys()',
1024
+ description: {
1025
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1026
+ value: ''
1027
+ }
1028
+ },
1029
+ {
1030
+ name: 'map_values(map)',
1031
+ funcDesc: 'Returns an unordered array containing the values of the map.',
1032
+ examples: '> SELECT map_values(map(1, \'a\', 2, \'b\'));\n ["a","b"]\n',
1033
+ expr: 'map_values()',
1034
+ description: {
1035
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1036
+ value: ''
1037
+ }
1038
+ },
1039
+ {
1040
+ name: 'str_to_map(text[, pairDelim[, keyValueDelim]])',
1041
+ funcDesc: "Creates a map after splitting the text into key/value pairs using delimiters. Default delimiters are ',' for `pairDelim` and ':' for `keyValueDelim`. Both `pairDelim` and `keyValueDelim` are treated as regular expressions.",
1042
+ examples: '> SELECT str_to_map(\'a:1,b:2,c:3\', \',\', \':\');\n {"a":"1","b":"2","c":"3"}\n> SELECT str_to_map(\'a\');\n {"a":null}\n',
1043
+ expr: 'str_to_map()',
1044
+ description: {
1045
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1046
+ value: ''
1047
+ }
1048
+ },
1049
+ {
1050
+ name: 'try_element_at(array, index)',
1051
+ funcDesc: 'Returns element of array at given (1-based) index. If Index is 0, Spark will throw an error. If index < 0, accesses elements from the last to the first. The function always returns NULL if the index exceeds the length of the array.',
1052
+ examples: "> SELECT try_element_at(array(1, 2, 3), 2);\n 2\n> SELECT try_element_at(map(1, 'a', 2, 'b'), 2);\n b\n",
1053
+ expr: 'try_element_at()',
1054
+ description: {
1055
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1056
+ value: ''
1057
+ }
1058
+ },
1059
+ {
1060
+ name: 'try_element_at(map, key)',
1061
+ funcDesc: 'Returns value for given key. The function always returns NULL if the key is not contained in the map.',
1062
+ examples: "> SELECT try_element_at(array(1, 2, 3), 2);\n 2\n> SELECT try_element_at(map(1, 'a', 2, 'b'), 2);\n b\n",
1063
+ expr: 'try_element_at()',
1064
+ description: {
1065
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1066
+ value: ''
1067
+ }
1068
+ },
1069
+ {
1070
+ name: 'add_months(start_date, num_months)',
1071
+ funcDesc: 'Returns the date that is `num_months` after `start_date`.',
1072
+ examples: "> SELECT add_months('2016-08-31', 1);\n 2016-09-30\n",
1073
+ expr: 'add_months()',
1074
+ description: {
1075
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1076
+ value: ''
1077
+ }
1078
+ },
1079
+ {
1080
+ name: 'convert_timezone([sourceTz, ]targetTz, sourceTs)',
1081
+ funcDesc: 'Converts the timestamp without time zone `sourceTs` from the `sourceTz` time zone to `targetTz`.',
1082
+ examples: "> SELECT convert_timezone('Europe/Brussels', 'America/Los_Angeles', timestamp_ntz'2021-12-06 00:00:00');\n 2021-12-05 15:00:00\n> SELECT convert_timezone('Europe/Brussels', timestamp_ntz'2021-12-05 15:00:00');\n 2021-12-06 00:00:00\n",
1083
+ expr: 'convert_timezone()',
1084
+ description: {
1085
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1086
+ value: ''
1087
+ }
1088
+ },
1089
+ {
1090
+ name: 'curdate()',
1091
+ funcDesc: 'Returns the current date at the start of query evaluation. All calls of curdate within the same query return the same value.',
1092
+ examples: '> SELECT curdate();\n 2022-09-06\n',
1093
+ expr: 'curdate()',
1094
+ description: {
1095
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1096
+ value: ''
1097
+ }
1098
+ },
1099
+ {
1100
+ name: 'current_date()',
1101
+ funcDesc: 'Returns the current date at the start of query evaluation. All calls of current_date within the same query return the same value.',
1102
+ examples: '> SELECT current_date();\n 2020-04-25\n> SELECT current_date;\n 2020-04-25\n',
1103
+ expr: 'current_date()',
1104
+ description: {
1105
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1106
+ value: ''
1107
+ }
1108
+ },
1109
+ {
1110
+ name: 'current_date',
1111
+ funcDesc: 'Returns the current date at the start of query evaluation.',
1112
+ examples: '> SELECT current_date();\n 2020-04-25\n> SELECT current_date;\n 2020-04-25\n',
1113
+ expr: 'current_date',
1114
+ description: {
1115
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1116
+ value: ''
1117
+ }
1118
+ },
1119
+ {
1120
+ name: 'current_timestamp()',
1121
+ funcDesc: 'Returns the current timestamp at the start of query evaluation. All calls of current_timestamp within the same query return the same value.',
1122
+ examples: '> SELECT current_timestamp();\n 2020-04-25 15:49:11.914\n> SELECT current_timestamp;\n 2020-04-25 15:49:11.914\n',
1123
+ expr: 'current_timestamp()',
1124
+ description: {
1125
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1126
+ value: ''
1127
+ }
1128
+ },
1129
+ {
1130
+ name: 'current_timestamp',
1131
+ funcDesc: 'Returns the current timestamp at the start of query evaluation.',
1132
+ examples: '> SELECT current_timestamp();\n 2020-04-25 15:49:11.914\n> SELECT current_timestamp;\n 2020-04-25 15:49:11.914\n',
1133
+ expr: 'current_timestamp',
1134
+ description: {
1135
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1136
+ value: ''
1137
+ }
1138
+ },
1139
+ {
1140
+ name: 'current_timezone()',
1141
+ funcDesc: 'Returns the current session local timezone.',
1142
+ examples: '> SELECT current_timezone();\n Asia/Shanghai\n',
1143
+ expr: 'current_timezone()',
1144
+ description: {
1145
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1146
+ value: ''
1147
+ }
1148
+ },
1149
+ {
1150
+ name: 'date_add(start_date, num_days)',
1151
+ funcDesc: 'Returns the date that is `num_days` after `start_date`.',
1152
+ examples: "> SELECT date_add('2016-07-30', 1);\n 2016-07-31\n",
1153
+ expr: 'date_add()',
1154
+ description: {
1155
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1156
+ value: ''
1157
+ }
1158
+ },
1159
+ {
1160
+ name: 'date_diff(endDate, startDate)',
1161
+ funcDesc: 'Returns the number of days from `startDate` to `endDate`.',
1162
+ examples: "> SELECT date_diff('2009-07-31', '2009-07-30');\n 1\n\n> SELECT date_diff('2009-07-30', '2009-07-31');\n -1\n",
1163
+ expr: 'date_diff()',
1164
+ description: {
1165
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1166
+ value: ''
1167
+ }
1168
+ },
1169
+ {
1170
+ name: 'date_format(timestamp, fmt)',
1171
+ funcDesc: 'Converts `timestamp` to a value of string in the format specified by the date format `fmt`.',
1172
+ examples: "> SELECT date_format('2016-04-08', 'y');\n 2016\n",
1173
+ expr: 'date_format()',
1174
+ description: {
1175
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1176
+ value: ''
1177
+ }
1178
+ },
1179
+ {
1180
+ name: 'date_from_unix_date(days)',
1181
+ funcDesc: 'Create date from the number of days since 1970-01-01.',
1182
+ examples: '> SELECT date_from_unix_date(1);\n 1970-01-02\n',
1183
+ expr: 'date_from_unix_date()',
1184
+ description: {
1185
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1186
+ value: ''
1187
+ }
1188
+ },
1189
+ {
1190
+ name: 'date_part(field, source)',
1191
+ funcDesc: 'Extracts a part of the date/timestamp or interval source.',
1192
+ examples: "> SELECT date_part('YEAR', TIMESTAMP '2019-08-12 01:00:00.123456');\n 2019\n> SELECT date_part('week', timestamp'2019-08-12 01:00:00.123456');\n 33\n> SELECT date_part('doy', DATE'2019-08-12');\n 224\n> SELECT date_part('SECONDS', timestamp'2019-10-01 00:00:01.000001');\n 1.000001\n> SELECT date_part('days', interval 5 days 3 hours 7 minutes);\n 5\n> SELECT date_part('seconds', interval 5 hours 30 seconds 1 milliseconds 1 microseconds);\n 30.001001\n> SELECT date_part('MONTH', INTERVAL '2021-11' YEAR TO MONTH);\n 11\n> SELECT date_part('MINUTE', INTERVAL '123 23:55:59.002001' DAY TO SECOND);\n 55\n",
1193
+ expr: 'date_part()',
1194
+ description: {
1195
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1196
+ value: ''
1197
+ }
1198
+ },
1199
+ {
1200
+ name: 'date_sub(start_date, num_days)',
1201
+ funcDesc: 'Returns the date that is `num_days` before `start_date`.',
1202
+ examples: "> SELECT date_sub('2016-07-30', 1);\n 2016-07-29\n",
1203
+ expr: 'date_sub()',
1204
+ description: {
1205
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1206
+ value: ''
1207
+ }
1208
+ },
1209
+ {
1210
+ name: 'date_trunc(fmt, ts)',
1211
+ funcDesc: 'Returns timestamp `ts` truncated to the unit specified by the format model `fmt`.',
1212
+ examples: "> SELECT date_trunc('YEAR', '2015-03-05T09:32:05.359');\n 2015-01-01 00:00:00\n> SELECT date_trunc('MM', '2015-03-05T09:32:05.359');\n 2015-03-01 00:00:00\n> SELECT date_trunc('DD', '2015-03-05T09:32:05.359');\n 2015-03-05 00:00:00\n> SELECT date_trunc('HOUR', '2015-03-05T09:32:05.359');\n 2015-03-05 09:00:00\n> SELECT date_trunc('MILLISECOND', '2015-03-05T09:32:05.123456');\n 2015-03-05 09:32:05.123\n",
1213
+ expr: 'date_trunc()',
1214
+ description: {
1215
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1216
+ value: ''
1217
+ }
1218
+ },
1219
+ {
1220
+ name: 'dateadd(start_date, num_days)',
1221
+ funcDesc: 'Returns the date that is `num_days` after `start_date`.',
1222
+ examples: "> SELECT dateadd('2016-07-30', 1);\n 2016-07-31\n",
1223
+ expr: 'dateadd()',
1224
+ description: {
1225
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1226
+ value: ''
1227
+ }
1228
+ },
1229
+ {
1230
+ name: 'datediff(endDate, startDate)',
1231
+ funcDesc: 'Returns the number of days from `startDate` to `endDate`.',
1232
+ examples: "> SELECT datediff('2009-07-31', '2009-07-30');\n 1\n\n> SELECT datediff('2009-07-30', '2009-07-31');\n -1\n",
1233
+ expr: 'datediff()',
1234
+ description: {
1235
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1236
+ value: ''
1237
+ }
1238
+ },
1239
+ {
1240
+ name: 'datepart(field, source)',
1241
+ funcDesc: 'Extracts a part of the date/timestamp or interval source.',
1242
+ examples: "> SELECT datepart('YEAR', TIMESTAMP '2019-08-12 01:00:00.123456');\n 2019\n> SELECT datepart('week', timestamp'2019-08-12 01:00:00.123456');\n 33\n> SELECT datepart('doy', DATE'2019-08-12');\n 224\n> SELECT datepart('SECONDS', timestamp'2019-10-01 00:00:01.000001');\n 1.000001\n> SELECT datepart('days', interval 5 days 3 hours 7 minutes);\n 5\n> SELECT datepart('seconds', interval 5 hours 30 seconds 1 milliseconds 1 microseconds);\n 30.001001\n> SELECT datepart('MONTH', INTERVAL '2021-11' YEAR TO MONTH);\n 11\n> SELECT datepart('MINUTE', INTERVAL '123 23:55:59.002001' DAY TO SECOND);\n 55\n",
1243
+ expr: 'datepart()',
1244
+ description: {
1245
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1246
+ value: ''
1247
+ }
1248
+ },
1249
+ {
1250
+ name: 'day(date)',
1251
+ funcDesc: 'Returns the day of month of the date/timestamp.',
1252
+ examples: "> SELECT day('2009-07-30');\n 30\n",
1253
+ expr: 'day()',
1254
+ description: {
1255
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1256
+ value: ''
1257
+ }
1258
+ },
1259
+ {
1260
+ name: 'dayofmonth(date)',
1261
+ funcDesc: 'Returns the day of month of the date/timestamp.',
1262
+ examples: "> SELECT dayofmonth('2009-07-30');\n 30\n",
1263
+ expr: 'dayofmonth()',
1264
+ description: {
1265
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1266
+ value: ''
1267
+ }
1268
+ },
1269
+ {
1270
+ name: 'dayofweek(date)',
1271
+ funcDesc: 'Returns the day of the week for date/timestamp (1 = Sunday, 2 = Monday, ..., 7 = Saturday).',
1272
+ examples: "> SELECT dayofweek('2009-07-30');\n 5\n",
1273
+ expr: 'dayofweek()',
1274
+ description: {
1275
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1276
+ value: ''
1277
+ }
1278
+ },
1279
+ {
1280
+ name: 'dayofyear(date)',
1281
+ funcDesc: 'Returns the day of year of the date/timestamp.',
1282
+ examples: "> SELECT dayofyear('2016-04-09');\n 100\n",
1283
+ expr: 'dayofyear()',
1284
+ description: {
1285
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1286
+ value: ''
1287
+ }
1288
+ },
1289
+ {
1290
+ name: 'extract(field FROM source)',
1291
+ funcDesc: 'Extracts a part of the date/timestamp or interval source.',
1292
+ examples: "> SELECT extract(YEAR FROM TIMESTAMP '2019-08-12 01:00:00.123456');\n 2019\n> SELECT extract(week FROM timestamp'2019-08-12 01:00:00.123456');\n 33\n> SELECT extract(doy FROM DATE'2019-08-12');\n 224\n> SELECT extract(SECONDS FROM timestamp'2019-10-01 00:00:01.000001');\n 1.000001\n> SELECT extract(days FROM interval 5 days 3 hours 7 minutes);\n 5\n> SELECT extract(seconds FROM interval 5 hours 30 seconds 1 milliseconds 1 microseconds);\n 30.001001\n> SELECT extract(MONTH FROM INTERVAL '2021-11' YEAR TO MONTH);\n 11\n> SELECT extract(MINUTE FROM INTERVAL '123 23:55:59.002001' DAY TO SECOND);\n 55\n",
1293
+ expr: 'extract()',
1294
+ description: {
1295
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1296
+ value: ''
1297
+ }
1298
+ },
1299
+ {
1300
+ name: 'from_unixtime(unix_time[, fmt])',
1301
+ funcDesc: 'Returns `unix_time` in the specified `fmt`.',
1302
+ examples: "> SELECT from_unixtime(0, 'yyyy-MM-dd HH:mm:ss');\n 1969-12-31 16:00:00\n\n> SELECT from_unixtime(0);\n 1969-12-31 16:00:00\n",
1303
+ expr: 'from_unixtime()',
1304
+ description: {
1305
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1306
+ value: ''
1307
+ }
1308
+ },
1309
+ {
1310
+ name: 'from_utc_timestamp(timestamp, timezone)',
1311
+ funcDesc: "Given a timestamp like '2017-07-14 02:40:00.0', interprets it as a time in UTC, and renders that time as a timestamp in the given time zone. For example, 'GMT+1' would yield '2017-07-14 03:40:00.0'.",
1312
+ examples: "> SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul');\n 2016-08-31 09:00:00\n",
1313
+ expr: 'from_utc_timestamp()',
1314
+ description: {
1315
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1316
+ value: ''
1317
+ }
1318
+ },
1319
+ {
1320
+ name: 'hour(timestamp)',
1321
+ funcDesc: 'Returns the hour component of the string/timestamp.',
1322
+ examples: "> SELECT hour('2009-07-30 12:58:59');\n 12\n",
1323
+ expr: 'hour()',
1324
+ description: {
1325
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1326
+ value: ''
1327
+ }
1328
+ },
1329
+ {
1330
+ name: 'last_day(date)',
1331
+ funcDesc: 'Returns the last day of the month which the date belongs to.',
1332
+ examples: "> SELECT last_day('2009-01-12');\n 2009-01-31\n",
1333
+ expr: 'last_day()',
1334
+ description: {
1335
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1336
+ value: ''
1337
+ }
1338
+ },
1339
+ {
1340
+ name: 'localtimestamp()',
1341
+ funcDesc: 'Returns the current timestamp without time zone at the start of query evaluation. All calls of localtimestamp within the same query return the same value.',
1342
+ examples: '> SELECT localtimestamp();\n 2020-04-25 15:49:11.914\n> SELECT localtimestamp;\n 2020-04-25 15:49:11.914\n',
1343
+ expr: 'localtimestamp()',
1344
+ description: {
1345
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1346
+ value: ''
1347
+ }
1348
+ },
1349
+ {
1350
+ name: 'localtimestamp',
1351
+ funcDesc: 'Returns the current local date-time at the session time zone at the start of query evaluation.',
1352
+ examples: '> SELECT localtimestamp();\n 2020-04-25 15:49:11.914\n> SELECT localtimestamp;\n 2020-04-25 15:49:11.914\n',
1353
+ expr: 'localtimestamp',
1354
+ description: {
1355
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1356
+ value: ''
1357
+ }
1358
+ },
1359
+ {
1360
+ name: 'make_date(year, month, day)',
1361
+ funcDesc: 'Create date from year, month and day fields. If the configuration `spark.sql.ansi.enabled` is false, the function returns NULL on invalid inputs. Otherwise, it will throw an error instead.',
1362
+ examples: '> SELECT make_date(2013, 7, 15);\n 2013-07-15\n> SELECT make_date(2019, 7, NULL);\n NULL\n',
1363
+ expr: 'make_date()',
1364
+ description: {
1365
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1366
+ value: ''
1367
+ }
1368
+ },
1369
+ {
1370
+ name: 'make_dt_interval([days[, hours[, mins[, secs]]]])',
1371
+ funcDesc: 'Make DayTimeIntervalType duration from days, hours, mins and secs.',
1372
+ examples: '> SELECT make_dt_interval(1, 12, 30, 01.001001);\n 1 12:30:01.001001000\n> SELECT make_dt_interval(2);\n 2 00:00:00.000000000\n> SELECT make_dt_interval(100, null, 3);\n NULL\n',
1373
+ expr: 'make_dt_interval()',
1374
+ description: {
1375
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1376
+ value: ''
1377
+ }
1378
+ },
1379
+ {
1380
+ name: 'make_interval([years[, months[, weeks[, days[, hours[, mins[, secs]]]]]]])',
1381
+ funcDesc: 'Make interval from years, months, weeks, days, hours, mins and secs.',
1382
+ examples: '> SELECT make_interval(100, 11, 1, 1, 12, 30, 01.001001);\n 100 years 11 months 8 days 12 hours 30 minutes 1.001001 seconds\n> SELECT make_interval(100, null, 3);\n NULL\n> SELECT make_interval(0, 1, 0, 1, 0, 0, 100.000001);\n 1 months 1 days 1 minutes 40.000001 seconds\n',
1383
+ expr: 'make_interval()',
1384
+ description: {
1385
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1386
+ value: ''
1387
+ }
1388
+ },
1389
+ {
1390
+ name: 'make_timestamp(year, month, day, hour, min, sec[, timezone])',
1391
+ funcDesc: 'Create timestamp from year, month, day, hour, min, sec and timezone fields. The result data type is consistent with the value of configuration `spark.sql.timestampType`. If the configuration `spark.sql.ansi.enabled` is false, the function returns NULL on invalid inputs. Otherwise, it will throw an error instead.',
1392
+ examples: "> SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887);\n 2014-12-28 06:30:45.887\n> SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887, 'CET');\n 2014-12-27 21:30:45.887\n> SELECT make_timestamp(2019, 6, 30, 23, 59, 60);\n 2019-07-01 00:00:00\n> SELECT make_timestamp(2019, 6, 30, 23, 59, 1);\n 2019-06-30 23:59:01\n> SELECT make_timestamp(null, 7, 22, 15, 30, 0);\n NULL\n",
1393
+ expr: 'make_timestamp()',
1394
+ description: {
1395
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1396
+ value: ''
1397
+ }
1398
+ },
1399
+ {
1400
+ name: 'make_timestamp_ltz(year, month, day, hour, min, sec[, timezone])',
1401
+ funcDesc: 'Create the current timestamp with local time zone from year, month, day, hour, min, sec and timezone fields. If the configuration `spark.sql.ansi.enabled` is false, the function returns NULL on invalid inputs. Otherwise, it will throw an error instead.',
1402
+ examples: "> SELECT make_timestamp_ltz(2014, 12, 28, 6, 30, 45.887);\n 2014-12-28 06:30:45.887\n> SELECT make_timestamp_ltz(2014, 12, 28, 6, 30, 45.887, 'CET');\n 2014-12-27 21:30:45.887\n> SELECT make_timestamp_ltz(2019, 6, 30, 23, 59, 60);\n 2019-07-01 00:00:00\n> SELECT make_timestamp_ltz(null, 7, 22, 15, 30, 0);\n NULL\n",
1403
+ expr: 'make_timestamp_ltz()',
1404
+ description: {
1405
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1406
+ value: ''
1407
+ }
1408
+ },
1409
+ {
1410
+ name: 'make_timestamp_ntz(year, month, day, hour, min, sec)',
1411
+ funcDesc: 'Create local date-time from year, month, day, hour, min, sec fields. If the configuration `spark.sql.ansi.enabled` is false, the function returns NULL on invalid inputs. Otherwise, it will throw an error instead.',
1412
+ examples: '> SELECT make_timestamp_ntz(2014, 12, 28, 6, 30, 45.887);\n 2014-12-28 06:30:45.887\n> SELECT make_timestamp_ntz(2019, 6, 30, 23, 59, 60);\n 2019-07-01 00:00:00\n> SELECT make_timestamp_ntz(null, 7, 22, 15, 30, 0);\n NULL\n',
1413
+ expr: 'make_timestamp_ntz()',
1414
+ description: {
1415
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1416
+ value: ''
1417
+ }
1418
+ },
1419
+ {
1420
+ name: 'make_ym_interval([years[, months]])',
1421
+ funcDesc: 'Make year-month interval from years, months.',
1422
+ examples: '> SELECT make_ym_interval(1, 2);\n 1-2\n> SELECT make_ym_interval(1, 0);\n 1-0\n> SELECT make_ym_interval(-1, 1);\n -0-11\n> SELECT make_ym_interval(2);\n 2-0\n',
1423
+ expr: 'make_ym_interval()',
1424
+ description: {
1425
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1426
+ value: ''
1427
+ }
1428
+ },
1429
+ {
1430
+ name: 'minute(timestamp)',
1431
+ funcDesc: 'Returns the minute component of the string/timestamp.',
1432
+ examples: "> SELECT minute('2009-07-30 12:58:59');\n 58\n",
1433
+ expr: 'minute()',
1434
+ description: {
1435
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1436
+ value: ''
1437
+ }
1438
+ },
1439
+ {
1440
+ name: 'month(date)',
1441
+ funcDesc: 'Returns the month component of the date/timestamp.',
1442
+ examples: "> SELECT month('2016-07-30');\n 7\n",
1443
+ expr: 'month()',
1444
+ description: {
1445
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1446
+ value: ''
1447
+ }
1448
+ },
1449
+ {
1450
+ name: 'months_between(timestamp1, timestamp2[, roundOff])',
1451
+ funcDesc: 'If `timestamp1` is later than `timestamp2`, then the result is positive. If `timestamp1` and `timestamp2` are on the same day of month, or both are the last day of month, time of day will be ignored. Otherwise, the difference is calculated based on 31 days per month, and rounded to 8 digits unless roundOff=false.',
1452
+ examples: "> SELECT months_between('1997-02-28 10:30:00', '1996-10-30');\n 3.94959677\n> SELECT months_between('1997-02-28 10:30:00', '1996-10-30', false);\n 3.9495967741935485\n",
1453
+ expr: 'months_between()',
1454
+ description: {
1455
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1456
+ value: ''
1457
+ }
1458
+ },
1459
+ {
1460
+ name: 'next_day(start_date, day_of_week)',
1461
+ funcDesc: 'Returns the first date which is later than `start_date` and named as indicated. The function returns NULL if at least one of the input parameters is NULL. When both of the input parameters are not NULL and day_of_week is an invalid input, the function throws IllegalArgumentException if `spark.sql.ansi.enabled` is set to true, otherwise NULL.',
1462
+ examples: "> SELECT next_day('2015-01-14', 'TU');\n 2015-01-20\n",
1463
+ expr: 'next_day()',
1464
+ description: {
1465
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1466
+ value: ''
1467
+ }
1468
+ },
1469
+ {
1470
+ name: 'now()',
1471
+ funcDesc: 'Returns the current timestamp at the start of query evaluation.',
1472
+ examples: '> SELECT now();\n 2020-04-25 15:49:11.914\n',
1473
+ expr: 'now()',
1474
+ description: {
1475
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1476
+ value: ''
1477
+ }
1478
+ },
1479
+ {
1480
+ name: 'quarter(date)',
1481
+ funcDesc: 'Returns the quarter of the year for date, in the range 1 to 4.',
1482
+ examples: "> SELECT quarter('2016-08-31');\n 3\n",
1483
+ expr: 'quarter()',
1484
+ description: {
1485
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1486
+ value: ''
1487
+ }
1488
+ },
1489
+ {
1490
+ name: 'second(timestamp)',
1491
+ funcDesc: 'Returns the second component of the string/timestamp.',
1492
+ examples: "> SELECT second('2009-07-30 12:58:59');\n 59\n",
1493
+ expr: 'second()',
1494
+ description: {
1495
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1496
+ value: ''
1497
+ }
1498
+ },
1499
+ {
1500
+ name: 'session_window(time_column, gap_duration)',
1501
+ funcDesc: "Generates session window given a timestamp specifying column and gap duration. See 'Types of time windows' in Structured Streaming guide doc for detailed explanation and examples.",
1502
+ examples: "> SELECT a, session_window.start, session_window.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:10:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, session_window(b, '5 minutes') ORDER BY a, start;\n A1 2021-01-01 00:00:00 2021-01-01 00:09:30 2\n A1 2021-01-01 00:10:00 2021-01-01 00:15:00 1\n A2 2021-01-01 00:01:00 2021-01-01 00:06:00 1\n> SELECT a, session_window.start, session_window.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:10:00'), ('A2', '2021-01-01 00:01:00'), ('A2', '2021-01-01 00:04:30') AS tab(a, b) GROUP by a, session_window(b, CASE WHEN a = 'A1' THEN '5 minutes' WHEN a = 'A2' THEN '1 minute' ELSE '10 minutes' END) ORDER BY a, start;\n A1 2021-01-01 00:00:00 2021-01-01 00:09:30 2\n A1 2021-01-01 00:10:00 2021-01-01 00:15:00 1\n A2 2021-01-01 00:01:00 2021-01-01 00:02:00 1\n A2 2021-01-01 00:04:30 2021-01-01 00:05:30 1\n",
1503
+ expr: 'session_window()',
1504
+ description: {
1505
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1506
+ value: ''
1507
+ }
1508
+ },
1509
+ {
1510
+ name: 'timestamp_micros(microseconds)',
1511
+ funcDesc: 'Creates timestamp from the number of microseconds since UTC epoch.',
1512
+ examples: '> SELECT timestamp_micros(1230219000123123);\n 2008-12-25 07:30:00.123123\n',
1513
+ expr: 'timestamp_micros()',
1514
+ description: {
1515
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1516
+ value: ''
1517
+ }
1518
+ },
1519
+ {
1520
+ name: 'timestamp_millis(milliseconds)',
1521
+ funcDesc: 'Creates timestamp from the number of milliseconds since UTC epoch.',
1522
+ examples: '> SELECT timestamp_millis(1230219000123);\n 2008-12-25 07:30:00.123\n',
1523
+ expr: 'timestamp_millis()',
1524
+ description: {
1525
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1526
+ value: ''
1527
+ }
1528
+ },
1529
+ {
1530
+ name: 'timestamp_seconds(seconds)',
1531
+ funcDesc: 'Creates timestamp from the number of seconds (can be fractional) since UTC epoch.',
1532
+ examples: '> SELECT timestamp_seconds(1230219000);\n 2008-12-25 07:30:00\n> SELECT timestamp_seconds(1230219000.123);\n 2008-12-25 07:30:00.123\n',
1533
+ expr: 'timestamp_seconds()',
1534
+ description: {
1535
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1536
+ value: ''
1537
+ }
1538
+ },
1539
+ {
1540
+ name: 'to_date(date_str[, fmt])',
1541
+ funcDesc: 'Parses the `date_str` expression with the `fmt` expression to a date. Returns null with invalid input. By default, it follows casting rules to a date if the `fmt` is omitted.',
1542
+ examples: "> SELECT to_date('2009-07-30 04:17:52');\n 2009-07-30\n> SELECT to_date('2016-12-31', 'yyyy-MM-dd');\n 2016-12-31\n",
1543
+ expr: 'to_date()',
1544
+ description: {
1545
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1546
+ value: ''
1547
+ }
1548
+ },
1549
+ {
1550
+ name: 'to_timestamp(timestamp_str[, fmt])',
1551
+ funcDesc: 'Parses the `timestamp_str` expression with the `fmt` expression to a timestamp. Returns null with invalid input. By default, it follows casting rules to a timestamp if the `fmt` is omitted. The result data type is consistent with the value of configuration `spark.sql.timestampType`.',
1552
+ examples: "> SELECT to_timestamp('2016-12-31 00:12:00');\n 2016-12-31 00:12:00\n> SELECT to_timestamp('2016-12-31', 'yyyy-MM-dd');\n 2016-12-31 00:00:00\n",
1553
+ expr: 'to_timestamp()',
1554
+ description: {
1555
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1556
+ value: ''
1557
+ }
1558
+ },
1559
+ {
1560
+ name: 'to_timestamp_ltz(timestamp_str[, fmt])',
1561
+ funcDesc: 'Parses the `timestamp_str` expression with the `fmt` expression to a timestamp with local time zone. Returns null with invalid input. By default, it follows casting rules to a timestamp if the `fmt` is omitted.',
1562
+ examples: "> SELECT to_timestamp_ltz('2016-12-31 00:12:00');\n 2016-12-31 00:12:00\n> SELECT to_timestamp_ltz('2016-12-31', 'yyyy-MM-dd');\n 2016-12-31 00:00:00\n",
1563
+ expr: 'to_timestamp_ltz()',
1564
+ description: {
1565
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1566
+ value: ''
1567
+ }
1568
+ },
1569
+ {
1570
+ name: 'to_timestamp_ntz(timestamp_str[, fmt])',
1571
+ funcDesc: 'Parses the `timestamp_str` expression with the `fmt` expression to a timestamp without time zone. Returns null with invalid input. By default, it follows casting rules to a timestamp if the `fmt` is omitted.',
1572
+ examples: "> SELECT to_timestamp_ntz('2016-12-31 00:12:00');\n 2016-12-31 00:12:00\n> SELECT to_timestamp_ntz('2016-12-31', 'yyyy-MM-dd');\n 2016-12-31 00:00:00\n",
1573
+ expr: 'to_timestamp_ntz()',
1574
+ description: {
1575
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1576
+ value: ''
1577
+ }
1578
+ },
1579
+ {
1580
+ name: 'to_unix_timestamp(timeExp[, fmt])',
1581
+ funcDesc: 'Returns the UNIX timestamp of the given time.',
1582
+ examples: "> SELECT to_unix_timestamp('2016-04-08', 'yyyy-MM-dd');\n 1460098800\n",
1583
+ expr: 'to_unix_timestamp()',
1584
+ description: {
1585
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1586
+ value: ''
1587
+ }
1588
+ },
1589
+ {
1590
+ name: 'to_utc_timestamp(timestamp, timezone)',
1591
+ funcDesc: "Given a timestamp like '2017-07-14 02:40:00.0', interprets it as a time in the given time zone, and renders that time as a timestamp in UTC. For example, 'GMT+1' would yield '2017-07-14 01:40:00.0'.",
1592
+ examples: "> SELECT to_utc_timestamp('2016-08-31', 'Asia/Seoul');\n 2016-08-30 15:00:00\n",
1593
+ expr: 'to_utc_timestamp()',
1594
+ description: {
1595
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1596
+ value: ''
1597
+ }
1598
+ },
1599
+ {
1600
+ name: 'trunc(date, fmt)',
1601
+ funcDesc: 'Returns `date` with the time portion of the day truncated to the unit specified by the format model `fmt`.',
1602
+ examples: "> SELECT trunc('2019-08-04', 'week');\n 2019-07-29\n> SELECT trunc('2019-08-04', 'quarter');\n 2019-07-01\n> SELECT trunc('2009-02-12', 'MM');\n 2009-02-01\n> SELECT trunc('2015-10-27', 'YEAR');\n 2015-01-01\n",
1603
+ expr: 'trunc()',
1604
+ description: {
1605
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1606
+ value: ''
1607
+ }
1608
+ },
1609
+ {
1610
+ name: 'try_to_timestamp(timestamp_str[, fmt])',
1611
+ funcDesc: 'Parses the `timestamp_str` expression with the `fmt` expression to a timestamp. The function always returns null on an invalid input with/without ANSI SQL mode enabled. By default, it follows casting rules to a timestamp if the `fmt` is omitted. The result data type is consistent with the value of configuration `spark.sql.timestampType`.',
1612
+ examples: "> SELECT try_to_timestamp('2016-12-31 00:12:00');\n 2016-12-31 00:12:00\n> SELECT try_to_timestamp('2016-12-31', 'yyyy-MM-dd');\n 2016-12-31 00:00:00\n> SELECT try_to_timestamp('foo', 'yyyy-MM-dd');\n NULL\n",
1613
+ expr: 'try_to_timestamp()',
1614
+ description: {
1615
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1616
+ value: ''
1617
+ }
1618
+ },
1619
+ {
1620
+ name: 'unix_date(date)',
1621
+ funcDesc: 'Returns the number of days since 1970-01-01.',
1622
+ examples: '> SELECT unix_date(DATE("1970-01-02"));\n 1\n',
1623
+ expr: 'unix_date()',
1624
+ description: {
1625
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1626
+ value: ''
1627
+ }
1628
+ },
1629
+ {
1630
+ name: 'unix_micros(timestamp)',
1631
+ funcDesc: 'Returns the number of microseconds since 1970-01-01 00:00:00 UTC.',
1632
+ examples: "> SELECT unix_micros(TIMESTAMP('1970-01-01 00:00:01Z'));\n 1000000\n",
1633
+ expr: 'unix_micros()',
1634
+ description: {
1635
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1636
+ value: ''
1637
+ }
1638
+ },
1639
+ {
1640
+ name: 'unix_millis(timestamp)',
1641
+ funcDesc: 'Returns the number of milliseconds since 1970-01-01 00:00:00 UTC. Truncates higher levels of precision.',
1642
+ examples: "> SELECT unix_millis(TIMESTAMP('1970-01-01 00:00:01Z'));\n 1000\n",
1643
+ expr: 'unix_millis()',
1644
+ description: {
1645
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1646
+ value: ''
1647
+ }
1648
+ },
1649
+ {
1650
+ name: 'unix_seconds(timestamp)',
1651
+ funcDesc: 'Returns the number of seconds since 1970-01-01 00:00:00 UTC. Truncates higher levels of precision.',
1652
+ examples: "> SELECT unix_seconds(TIMESTAMP('1970-01-01 00:00:01Z'));\n 1\n",
1653
+ expr: 'unix_seconds()',
1654
+ description: {
1655
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1656
+ value: ''
1657
+ }
1658
+ },
1659
+ {
1660
+ name: 'unix_timestamp([timeExp[, fmt]])',
1661
+ funcDesc: 'Returns the UNIX timestamp of current or specified time.',
1662
+ examples: "> SELECT unix_timestamp();\n 1476884637\n> SELECT unix_timestamp('2016-04-08', 'yyyy-MM-dd');\n 1460041200\n",
1663
+ expr: 'unix_timestamp()',
1664
+ description: {
1665
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1666
+ value: ''
1667
+ }
1668
+ },
1669
+ {
1670
+ name: 'weekday(date)',
1671
+ funcDesc: 'Returns the day of the week for date/timestamp (0 = Monday, 1 = Tuesday, ..., 6 = Sunday).',
1672
+ examples: "> SELECT weekday('2009-07-30');\n 3\n",
1673
+ expr: 'weekday()',
1674
+ description: {
1675
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1676
+ value: ''
1677
+ }
1678
+ },
1679
+ {
1680
+ name: 'weekofyear(date)',
1681
+ funcDesc: 'Returns the week of the year of the given date. A week is considered to start on a Monday and week 1 is the first week with >3 days.',
1682
+ examples: "> SELECT weekofyear('2008-02-20');\n 8\n",
1683
+ expr: 'weekofyear()',
1684
+ description: {
1685
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1686
+ value: ''
1687
+ }
1688
+ },
1689
+ {
1690
+ name: 'window(time_column, window_duration[, slide_duration[, start_time]])',
1691
+ funcDesc: "Bucketize rows into one or more time windows given a timestamp specifying column. Window starts are inclusive but the window ends are exclusive, e.g. 12:05 will be in the window [12:05,12:10) but not in [12:00,12:05). Windows can support microsecond precision. Windows in the order of months are not supported. See 'Window Operations on Event Time' in Structured Streaming guide doc for detailed explanation and examples.",
1692
+ examples: "> SELECT a, window.start, window.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:06:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, window(b, '5 minutes') ORDER BY a, start;\n A1 2021-01-01 00:00:00 2021-01-01 00:05:00 2\n A1 2021-01-01 00:05:00 2021-01-01 00:10:00 1\n A2 2021-01-01 00:00:00 2021-01-01 00:05:00 1\n> SELECT a, window.start, window.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:06:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, window(b, '10 minutes', '5 minutes') ORDER BY a, start;\n A1 2020-12-31 23:55:00 2021-01-01 00:05:00 2\n A1 2021-01-01 00:00:00 2021-01-01 00:10:00 3\n A1 2021-01-01 00:05:00 2021-01-01 00:15:00 1\n A2 2020-12-31 23:55:00 2021-01-01 00:05:00 1\n A2 2021-01-01 00:00:00 2021-01-01 00:10:00 1\n",
1693
+ expr: 'window()',
1694
+ description: {
1695
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1696
+ value: ''
1697
+ }
1698
+ },
1699
+ {
1700
+ name: 'window_time(window_column)',
1701
+ funcDesc: "Extract the time value from time/session window column which can be used for event time value of window. The extracted time is (window.end - 1) which reflects the fact that the the aggregating windows have exclusive upper bound - [start, end) See 'Window Operations on Event Time' in Structured Streaming guide doc for detailed explanation and examples.",
1702
+ examples: "> SELECT a, window.start as start, window.end as end, window_time(window), cnt FROM (SELECT a, window, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:06:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, window(b, '5 minutes') ORDER BY a, window.start);\n A1 2021-01-01 00:00:00 2021-01-01 00:05:00 2021-01-01 00:04:59.999999 2\n A1 2021-01-01 00:05:00 2021-01-01 00:10:00 2021-01-01 00:09:59.999999 1\n A2 2021-01-01 00:00:00 2021-01-01 00:05:00 2021-01-01 00:04:59.999999 1\n",
1703
+ expr: 'window_time()',
1704
+ description: {
1705
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1706
+ value: ''
1707
+ }
1708
+ },
1709
+ {
1710
+ name: 'year(date)',
1711
+ funcDesc: 'Returns the year component of the date/timestamp.',
1712
+ examples: "> SELECT year('2016-07-30');\n 2016\n",
1713
+ expr: 'year()',
1714
+ description: {
1715
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1716
+ value: ''
1717
+ }
1718
+ },
1719
+ {
1720
+ name: 'from_json(jsonStr, schema[, options])',
1721
+ funcDesc: 'Returns a struct value with the given `jsonStr` and `schema`.',
1722
+ examples: '> SELECT from_json(\'{"a":1, "b":0.8}\', \'a INT, b DOUBLE\');\n {"a":1,"b":0.8}\n> SELECT from_json(\'{"time":"26/08/2015"}\', \'time Timestamp\', map(\'timestampFormat\', \'dd/MM/yyyy\'));\n {"time":2015-08-26 00:00:00}\n> SELECT from_json(\'{"teacher": "Alice", "student": [{"name": "Bob", "rank": 1}, {"name": "Charlie", "rank": 2}]}\', \'STRUCT<teacher: STRING, student: ARRAY<STRUCT<name: STRING, rank: INT>>>\');\n {"teacher":"Alice","student":[{"name":"Bob","rank":1},{"name":"Charlie","rank":2}]}\n',
1723
+ expr: 'from_json()',
1724
+ description: {
1725
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1726
+ value: ''
1727
+ }
1728
+ },
1729
+ {
1730
+ name: 'get_json_object(json_txt, path)',
1731
+ funcDesc: 'Extracts a json object from `path`.',
1732
+ examples: '> SELECT get_json_object(\'{"a":"b"}\', \'$.a\');\n b\n',
1733
+ expr: 'get_json_object()',
1734
+ description: {
1735
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1736
+ value: ''
1737
+ }
1738
+ },
1739
+ {
1740
+ name: 'json_array_length(jsonArray)',
1741
+ funcDesc: 'Returns the number of elements in the outermost JSON array.',
1742
+ examples: "> SELECT json_array_length('[1,2,3,4]');\n 4\n> SELECT json_array_length('[1,2,3,{\"f1\":1,\"f2\":[5,6]},4]');\n 5\n> SELECT json_array_length('[1,2');\n NULL\n",
1743
+ expr: 'json_array_length()',
1744
+ description: {
1745
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1746
+ value: ''
1747
+ }
1748
+ },
1749
+ {
1750
+ name: 'json_object_keys(json_object)',
1751
+ funcDesc: 'Returns all the keys of the outermost JSON object as an array.',
1752
+ examples: '> SELECT json_object_keys(\'{}\');\n []\n> SELECT json_object_keys(\'{"key": "value"}\');\n ["key"]\n> SELECT json_object_keys(\'{"f1":"abc","f2":{"f3":"a", "f4":"b"}}\');\n ["f1","f2"]\n',
1753
+ expr: 'json_object_keys()',
1754
+ description: {
1755
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1756
+ value: ''
1757
+ }
1758
+ },
1759
+ {
1760
+ name: 'json_tuple(jsonStr, p1, p2, ..., pn)',
1761
+ funcDesc: 'Returns a tuple like the function get_json_object, but it takes multiple names. All the input parameters and output column types are string.',
1762
+ examples: "> SELECT json_tuple('{\"a\":1, \"b\":2}', 'a', 'b');\n 1 2\n",
1763
+ expr: 'json_tuple()',
1764
+ description: {
1765
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1766
+ value: ''
1767
+ }
1768
+ },
1769
+ {
1770
+ name: 'schema_of_json(json[, options])',
1771
+ funcDesc: 'Returns schema in the DDL format of JSON string.',
1772
+ examples: "> SELECT schema_of_json('[{\"col\":0}]');\n ARRAY<STRUCT<col: BIGINT>>\n> SELECT schema_of_json('[{\"col\":01}]', map('allowNumericLeadingZeros', 'true'));\n ARRAY<STRUCT<col: BIGINT>>\n",
1773
+ expr: 'schema_of_json()',
1774
+ description: {
1775
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1776
+ value: ''
1777
+ }
1778
+ },
1779
+ {
1780
+ name: 'to_json(expr[, options])',
1781
+ funcDesc: 'Returns a JSON string with a given struct value',
1782
+ examples: "> SELECT to_json(named_struct('a', 1, 'b', 2));\n {\"a\":1,\"b\":2}\n> SELECT to_json(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));\n {\"time\":\"26/08/2015\"}\n> SELECT to_json(array(named_struct('a', 1, 'b', 2)));\n [{\"a\":1,\"b\":2}]\n> SELECT to_json(map('a', named_struct('b', 1)));\n {\"a\":{\"b\":1}}\n> SELECT to_json(map(named_struct('a', 1),named_struct('b', 2)));\n {\"[1]\":{\"b\":2}}\n> SELECT to_json(map('a', 1));\n {\"a\":1}\n> SELECT to_json(array((map('a', 1))));\n [{\"a\":1}]\n",
1783
+ expr: 'to_json()',
1784
+ description: {
1785
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1786
+ value: ''
1787
+ }
1788
+ },
1789
+ {
1790
+ name: 'expr1 % expr2',
1791
+ funcDesc: 'Returns the remainder after `expr1`/`expr2`.',
1792
+ examples: '> SELECT 2 % 1.8;\n 0.2\n> SELECT 2 % 0;\n Error: DIVIDE_BY_ZERO\n',
1793
+ expr: 'expr1 % expr2',
1794
+ description: {
1795
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1796
+ value: ''
1797
+ }
1798
+ },
1799
+ {
1800
+ name: 'expr1 * expr2',
1801
+ funcDesc: 'Returns `expr1`*`expr2`.',
1802
+ examples: '> SELECT 2 * 3;\n 6\n',
1803
+ expr: 'expr1 * expr2',
1804
+ description: {
1805
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1806
+ value: ''
1807
+ }
1808
+ },
1809
+ {
1810
+ name: 'expr1 + expr2',
1811
+ funcDesc: 'Returns `expr1`+`expr2`.',
1812
+ examples: '> SELECT 1 + 2;\n 3\n',
1813
+ expr: 'expr1 + expr2',
1814
+ description: {
1815
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1816
+ value: ''
1817
+ }
1818
+ },
1819
+ {
1820
+ name: 'expr1 - expr2',
1821
+ funcDesc: 'Returns `expr1`-`expr2`.',
1822
+ examples: '> SELECT 2 - 1;\n 1\n',
1823
+ expr: 'expr1 - expr2',
1824
+ description: {
1825
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1826
+ value: ''
1827
+ }
1828
+ },
1829
+ {
1830
+ name: 'expr1 / expr2',
1831
+ funcDesc: 'Returns `expr1`/`expr2`. It always performs floating point division.',
1832
+ examples: '> SELECT 3 / 2;\n 1.5\n> SELECT 2L / 2L;\n 1.0\n',
1833
+ expr: 'expr1 / expr2',
1834
+ description: {
1835
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1836
+ value: ''
1837
+ }
1838
+ },
1839
+ {
1840
+ name: 'abs(expr)',
1841
+ funcDesc: 'Returns the absolute value of the numeric or interval value.',
1842
+ examples: "> SELECT abs(-1);\n 1\n> SELECT abs(INTERVAL -'1-1' YEAR TO MONTH);\n 1-1\n",
1843
+ expr: 'abs()',
1844
+ description: {
1845
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1846
+ value: ''
1847
+ }
1848
+ },
1849
+ {
1850
+ name: 'acos(expr)',
1851
+ funcDesc: 'Returns the inverse cosine (a.k.a. arc cosine) of `expr`, as if computed by `java.lang.Math.acos`.',
1852
+ examples: '> SELECT acos(1);\n 0.0\n> SELECT acos(2);\n NaN\n',
1853
+ expr: 'acos()',
1854
+ description: {
1855
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1856
+ value: ''
1857
+ }
1858
+ },
1859
+ {
1860
+ name: 'acosh(expr)',
1861
+ funcDesc: 'Returns inverse hyperbolic cosine of `expr`.',
1862
+ examples: '> SELECT acosh(1);\n 0.0\n> SELECT acosh(0);\n NaN\n',
1863
+ expr: 'acosh()',
1864
+ description: {
1865
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1866
+ value: ''
1867
+ }
1868
+ },
1869
+ {
1870
+ name: 'asin(expr)',
1871
+ funcDesc: 'Returns the inverse sine (a.k.a. arc sine) the arc sin of `expr`, as if computed by `java.lang.Math.asin`.',
1872
+ examples: '> SELECT asin(0);\n 0.0\n> SELECT asin(2);\n NaN\n',
1873
+ expr: 'asin()',
1874
+ description: {
1875
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1876
+ value: ''
1877
+ }
1878
+ },
1879
+ {
1880
+ name: 'asinh(expr)',
1881
+ funcDesc: 'Returns inverse hyperbolic sine of `expr`.',
1882
+ examples: '> SELECT asinh(0);\n 0.0\n',
1883
+ expr: 'asinh()',
1884
+ description: {
1885
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1886
+ value: ''
1887
+ }
1888
+ },
1889
+ {
1890
+ name: 'atan(expr)',
1891
+ funcDesc: 'Returns the inverse tangent (a.k.a. arc tangent) of `expr`, as if computed by `java.lang.Math.atan`',
1892
+ examples: '> SELECT atan(0);\n 0.0\n',
1893
+ expr: 'atan()',
1894
+ description: {
1895
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1896
+ value: ''
1897
+ }
1898
+ },
1899
+ {
1900
+ name: 'atan2(exprY, exprX)',
1901
+ funcDesc: 'Returns the angle in radians between the positive x-axis of a plane and the point given by the coordinates (`exprX`, `exprY`), as if computed by `java.lang.Math.atan2`.',
1902
+ examples: '> SELECT atan2(0, 0);\n 0.0\n',
1903
+ expr: 'atan2()',
1904
+ description: {
1905
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1906
+ value: ''
1907
+ }
1908
+ },
1909
+ {
1910
+ name: 'atanh(expr)',
1911
+ funcDesc: 'Returns inverse hyperbolic tangent of `expr`.',
1912
+ examples: '> SELECT atanh(0);\n 0.0\n> SELECT atanh(2);\n NaN\n',
1913
+ expr: 'atanh()',
1914
+ description: {
1915
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1916
+ value: ''
1917
+ }
1918
+ },
1919
+ {
1920
+ name: 'bin(expr)',
1921
+ funcDesc: 'Returns the string representation of the long value `expr` represented in binary.',
1922
+ examples: '> SELECT bin(13);\n 1101\n> SELECT bin(-13);\n 1111111111111111111111111111111111111111111111111111111111110011\n> SELECT bin(13.3);\n 1101\n',
1923
+ expr: 'bin()',
1924
+ description: {
1925
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1926
+ value: ''
1927
+ }
1928
+ },
1929
+ {
1930
+ name: 'bround(expr, d)',
1931
+ funcDesc: 'Returns `expr` rounded to `d` decimal places using HALF_EVEN rounding mode.',
1932
+ examples: '> SELECT bround(2.5, 0);\n 2\n> SELECT bround(25, -1);\n 20\n',
1933
+ expr: 'bround()',
1934
+ description: {
1935
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1936
+ value: ''
1937
+ }
1938
+ },
1939
+ {
1940
+ name: 'cbrt(expr)',
1941
+ funcDesc: 'Returns the cube root of `expr`.',
1942
+ examples: '> SELECT cbrt(27.0);\n 3.0\n',
1943
+ expr: 'cbrt()',
1944
+ description: {
1945
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1946
+ value: ''
1947
+ }
1948
+ },
1949
+ {
1950
+ name: 'ceil(expr[, scale])',
1951
+ funcDesc: 'Returns the smallest number after rounding up that is not smaller than `expr`. An optional `scale` parameter can be specified to control the rounding behavior.',
1952
+ examples: '> SELECT ceil(-0.1);\n 0\n> SELECT ceil(5);\n 5\n> SELECT ceil(3.1411, 3);\n 3.142\n> SELECT ceil(3.1411, -3);\n 1000\n',
1953
+ expr: 'ceil()',
1954
+ description: {
1955
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1956
+ value: ''
1957
+ }
1958
+ },
1959
+ {
1960
+ name: 'ceiling(expr[, scale])',
1961
+ funcDesc: 'Returns the smallest number after rounding up that is not smaller than `expr`. An optional `scale` parameter can be specified to control the rounding behavior.',
1962
+ examples: '> SELECT ceiling(-0.1);\n 0\n> SELECT ceiling(5);\n 5\n> SELECT ceiling(3.1411, 3);\n 3.142\n> SELECT ceiling(3.1411, -3);\n 1000\n',
1963
+ expr: 'ceiling()',
1964
+ description: {
1965
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1966
+ value: ''
1967
+ }
1968
+ },
1969
+ {
1970
+ name: 'conv(num, from_base, to_base)',
1971
+ funcDesc: 'Convert `num` from `from_base` to `to_base`.',
1972
+ examples: "> SELECT conv('100', 2, 10);\n 4\n> SELECT conv(-10, 16, -10);\n -16\n",
1973
+ expr: 'conv()',
1974
+ description: {
1975
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1976
+ value: ''
1977
+ }
1978
+ },
1979
+ {
1980
+ name: 'cos(expr)',
1981
+ funcDesc: 'Returns the cosine of `expr`, as if computed by `java.lang.Math.cos`.',
1982
+ examples: '> SELECT cos(0);\n 1.0\n',
1983
+ expr: 'cos()',
1984
+ description: {
1985
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1986
+ value: ''
1987
+ }
1988
+ },
1989
+ {
1990
+ name: 'cosh(expr)',
1991
+ funcDesc: 'Returns the hyperbolic cosine of `expr`, as if computed by `java.lang.Math.cosh`.',
1992
+ examples: '> SELECT cosh(0);\n 1.0\n',
1993
+ expr: 'cosh()',
1994
+ description: {
1995
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
1996
+ value: ''
1997
+ }
1998
+ },
1999
+ {
2000
+ name: 'cot(expr)',
2001
+ funcDesc: 'Returns the cotangent of `expr`, as if computed by `1/java.lang.Math.tan`.',
2002
+ examples: '> SELECT cot(1);\n 0.6420926159343306\n',
2003
+ expr: 'cot()',
2004
+ description: {
2005
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2006
+ value: ''
2007
+ }
2008
+ },
2009
+ {
2010
+ name: 'csc(expr)',
2011
+ funcDesc: 'Returns the cosecant of `expr`, as if computed by `1/java.lang.Math.sin`.',
2012
+ examples: '> SELECT csc(1);\n 1.1883951057781212\n',
2013
+ expr: 'csc()',
2014
+ description: {
2015
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2016
+ value: ''
2017
+ }
2018
+ },
2019
+ {
2020
+ name: 'degrees(expr)',
2021
+ funcDesc: 'Converts radians to degrees.',
2022
+ examples: '> SELECT degrees(3.141592653589793);\n 180.0\n',
2023
+ expr: 'degrees()',
2024
+ description: {
2025
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2026
+ value: ''
2027
+ }
2028
+ },
2029
+ {
2030
+ name: 'expr1 div expr2',
2031
+ funcDesc: 'Divide `expr1` by `expr2`. It returns NULL if an operand is NULL or `expr2` is 0. The result is casted to long.',
2032
+ examples: "> SELECT 3 div 2;\n 1\n> SELECT INTERVAL '1-1' YEAR TO MONTH div INTERVAL '-1' MONTH;\n -13\n",
2033
+ expr: 'expr1 div expr2',
2034
+ description: {
2035
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2036
+ value: ''
2037
+ }
2038
+ },
2039
+ {
2040
+ name: 'e()',
2041
+ funcDesc: "Returns Euler's number, e.",
2042
+ examples: '> SELECT e();\n 2.718281828459045\n',
2043
+ expr: 'e()',
2044
+ description: {
2045
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2046
+ value: ''
2047
+ }
2048
+ },
2049
+ {
2050
+ name: 'exp(expr)',
2051
+ funcDesc: 'Returns e to the power of `expr`.',
2052
+ examples: '> SELECT exp(0);\n 1.0\n',
2053
+ expr: 'exp()',
2054
+ description: {
2055
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2056
+ value: ''
2057
+ }
2058
+ },
2059
+ {
2060
+ name: 'expm1(expr) - Returns exp(`expr`)',
2061
+ funcDesc: '1.',
2062
+ examples: '> SELECT expm1(0);\n 0.0\n',
2063
+ expr: 'expm1()',
2064
+ description: {
2065
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2066
+ value: ''
2067
+ }
2068
+ },
2069
+ {
2070
+ name: 'factorial(expr)',
2071
+ funcDesc: 'Returns the factorial of `expr`. `expr` is [0..20]. Otherwise, null.',
2072
+ examples: '> SELECT factorial(5);\n 120\n',
2073
+ expr: 'factorial()',
2074
+ description: {
2075
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2076
+ value: ''
2077
+ }
2078
+ },
2079
+ {
2080
+ name: 'floor(expr[, scale])',
2081
+ funcDesc: 'Returns the largest number after rounding down that is not greater than `expr`. An optional `scale` parameter can be specified to control the rounding behavior.',
2082
+ examples: '> SELECT floor(-0.1);\n -1\n> SELECT floor(5);\n 5\n> SELECT floor(3.1411, 3);\n 3.141\n> SELECT floor(3.1411, -3);\n 0\n',
2083
+ expr: 'floor()',
2084
+ description: {
2085
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2086
+ value: ''
2087
+ }
2088
+ },
2089
+ {
2090
+ name: 'greatest(expr, ...)',
2091
+ funcDesc: 'Returns the greatest value of all parameters, skipping null values.',
2092
+ examples: '> SELECT greatest(10, 9, 2, 4, 3);\n 10\n',
2093
+ expr: 'greatest()',
2094
+ description: {
2095
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2096
+ value: ''
2097
+ }
2098
+ },
2099
+ {
2100
+ name: 'hex(expr)',
2101
+ funcDesc: 'Converts `expr` to hexadecimal.',
2102
+ examples: "> SELECT hex(17);\n 11\n> SELECT hex('Spark SQL');\n 537061726B2053514C\n",
2103
+ expr: 'hex()',
2104
+ description: {
2105
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2106
+ value: ''
2107
+ }
2108
+ },
2109
+ {
2110
+ name: 'hypot(expr1, expr2)',
2111
+ funcDesc: 'Returns sqrt(`expr1`**2 + `expr2`**2).',
2112
+ examples: '> SELECT hypot(3, 4);\n 5.0\n',
2113
+ expr: 'hypot()',
2114
+ description: {
2115
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2116
+ value: ''
2117
+ }
2118
+ },
2119
+ {
2120
+ name: 'least(expr, ...)',
2121
+ funcDesc: 'Returns the least value of all parameters, skipping null values.',
2122
+ examples: '> SELECT least(10, 9, 2, 4, 3);\n 2\n',
2123
+ expr: 'least()',
2124
+ description: {
2125
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2126
+ value: ''
2127
+ }
2128
+ },
2129
+ {
2130
+ name: 'ln(expr)',
2131
+ funcDesc: 'Returns the natural logarithm (base e) of `expr`.',
2132
+ examples: '> SELECT ln(1);\n 0.0\n',
2133
+ expr: 'ln()',
2134
+ description: {
2135
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2136
+ value: ''
2137
+ }
2138
+ },
2139
+ {
2140
+ name: 'log(base, expr)',
2141
+ funcDesc: 'Returns the logarithm of `expr` with `base`.',
2142
+ examples: '> SELECT log(10, 100);\n 2.0\n',
2143
+ expr: 'log()',
2144
+ description: {
2145
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2146
+ value: ''
2147
+ }
2148
+ },
2149
+ {
2150
+ name: 'log10(expr)',
2151
+ funcDesc: 'Returns the logarithm of `expr` with base 10.',
2152
+ examples: '> SELECT log10(10);\n 1.0\n',
2153
+ expr: 'log10()',
2154
+ description: {
2155
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2156
+ value: ''
2157
+ }
2158
+ },
2159
+ {
2160
+ name: 'log1p(expr)',
2161
+ funcDesc: 'Returns log(1 + `expr`).',
2162
+ examples: '> SELECT log1p(0);\n 0.0\n',
2163
+ expr: 'log1p()',
2164
+ description: {
2165
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2166
+ value: ''
2167
+ }
2168
+ },
2169
+ {
2170
+ name: 'log2(expr)',
2171
+ funcDesc: 'Returns the logarithm of `expr` with base 2.',
2172
+ examples: '> SELECT log2(2);\n 1.0\n',
2173
+ expr: 'log2()',
2174
+ description: {
2175
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2176
+ value: ''
2177
+ }
2178
+ },
2179
+ {
2180
+ name: 'expr1 mod expr2',
2181
+ funcDesc: 'Returns the remainder after `expr1`/`expr2`.',
2182
+ examples: '> SELECT 2 % 1.8;\n 0.2\n> SELECT MOD(2, 1.8);\n 0.2\n',
2183
+ expr: 'expr1 mod expr2',
2184
+ description: {
2185
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2186
+ value: ''
2187
+ }
2188
+ },
2189
+ {
2190
+ name: 'negative(expr)',
2191
+ funcDesc: 'Returns the negated value of `expr`.',
2192
+ examples: '> SELECT negative(1);\n -1\n',
2193
+ expr: 'negative()',
2194
+ description: {
2195
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2196
+ value: ''
2197
+ }
2198
+ },
2199
+ {
2200
+ name: 'pi()',
2201
+ funcDesc: 'Returns pi.',
2202
+ examples: '> SELECT pi();\n 3.141592653589793\n',
2203
+ expr: 'pi()',
2204
+ description: {
2205
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2206
+ value: ''
2207
+ }
2208
+ },
2209
+ {
2210
+ name: 'pmod(expr1, expr2)',
2211
+ funcDesc: 'Returns the positive value of `expr1` mod `expr2`.',
2212
+ examples: '> SELECT pmod(10, 3);\n 1\n> SELECT pmod(-10, 3);\n 2\n',
2213
+ expr: 'pmod()',
2214
+ description: {
2215
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2216
+ value: ''
2217
+ }
2218
+ },
2219
+ {
2220
+ name: 'positive(expr)',
2221
+ funcDesc: 'Returns the value of `expr`.',
2222
+ examples: '> SELECT positive(1);\n 1\n',
2223
+ expr: 'positive()',
2224
+ description: {
2225
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2226
+ value: ''
2227
+ }
2228
+ },
2229
+ {
2230
+ name: 'pow(expr1, expr2)',
2231
+ funcDesc: 'Raises `expr1` to the power of `expr2`.',
2232
+ examples: '> SELECT pow(2, 3);\n 8.0\n',
2233
+ expr: 'pow()',
2234
+ description: {
2235
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2236
+ value: ''
2237
+ }
2238
+ },
2239
+ {
2240
+ name: 'power(expr1, expr2)',
2241
+ funcDesc: 'Raises `expr1` to the power of `expr2`.',
2242
+ examples: '> SELECT power(2, 3);\n 8.0\n',
2243
+ expr: 'power()',
2244
+ description: {
2245
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2246
+ value: ''
2247
+ }
2248
+ },
2249
+ {
2250
+ name: 'radians(expr)',
2251
+ funcDesc: 'Converts degrees to radians.',
2252
+ examples: '> SELECT radians(180);\n 3.141592653589793\n',
2253
+ expr: 'radians()',
2254
+ description: {
2255
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2256
+ value: ''
2257
+ }
2258
+ },
2259
+ {
2260
+ name: 'rand([seed])',
2261
+ funcDesc: 'Returns a random value with independent and identically distributed (i.i.d.) uniformly distributed values in [0, 1).',
2262
+ examples: '> SELECT rand();\n 0.9629742951434543\n> SELECT rand(0);\n 0.7604953758285915\n> SELECT rand(null);\n 0.7604953758285915\n',
2263
+ expr: 'rand()',
2264
+ description: {
2265
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2266
+ value: ''
2267
+ }
2268
+ },
2269
+ {
2270
+ name: 'randn([seed])',
2271
+ funcDesc: 'Returns a random value with independent and identically distributed (i.i.d.) values drawn from the standard normal distribution.',
2272
+ examples: '> SELECT randn();\n -0.3254147983080288\n> SELECT randn(0);\n 1.6034991609278433\n> SELECT randn(null);\n 1.6034991609278433\n',
2273
+ expr: 'randn()',
2274
+ description: {
2275
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2276
+ value: ''
2277
+ }
2278
+ },
2279
+ {
2280
+ name: 'random([seed])',
2281
+ funcDesc: 'Returns a random value with independent and identically distributed (i.i.d.) uniformly distributed values in [0, 1).',
2282
+ examples: '> SELECT random();\n 0.9629742951434543\n> SELECT random(0);\n 0.7604953758285915\n> SELECT random(null);\n 0.7604953758285915\n',
2283
+ expr: 'random()',
2284
+ description: {
2285
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2286
+ value: ''
2287
+ }
2288
+ },
2289
+ {
2290
+ name: 'rint(expr)',
2291
+ funcDesc: 'Returns the double value that is closest in value to the argument and is equal to a mathematical integer.',
2292
+ examples: '> SELECT rint(12.3456);\n 12.0\n',
2293
+ expr: 'rint()',
2294
+ description: {
2295
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2296
+ value: ''
2297
+ }
2298
+ },
2299
+ {
2300
+ name: 'round(expr, d)',
2301
+ funcDesc: 'Returns `expr` rounded to `d` decimal places using HALF_UP rounding mode.',
2302
+ examples: '> SELECT round(2.5, 0);\n 3\n',
2303
+ expr: 'round()',
2304
+ description: {
2305
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2306
+ value: ''
2307
+ }
2308
+ },
2309
+ {
2310
+ name: 'sec(expr)',
2311
+ funcDesc: 'Returns the secant of `expr`, as if computed by `1/java.lang.Math.cos`.',
2312
+ examples: '> SELECT sec(0);\n 1.0\n',
2313
+ expr: 'sec()',
2314
+ description: {
2315
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2316
+ value: ''
2317
+ }
2318
+ },
2319
+ {
2320
+ name: 'shiftleft(base, expr)',
2321
+ funcDesc: 'Bitwise left shift.',
2322
+ examples: '> SELECT shiftleft(2, 1);\n 4\n',
2323
+ expr: 'shiftleft()',
2324
+ description: {
2325
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2326
+ value: ''
2327
+ }
2328
+ },
2329
+ {
2330
+ name: 'sign(expr)',
2331
+ funcDesc: 'Returns -1.0, 0.0 or 1.0 as `expr` is negative, 0 or positive.',
2332
+ examples: "> SELECT sign(40);\n 1.0\n> SELECT sign(INTERVAL -'100' YEAR);\n -1.0\n",
2333
+ expr: 'sign()',
2334
+ description: {
2335
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2336
+ value: ''
2337
+ }
2338
+ },
2339
+ {
2340
+ name: 'signum(expr)',
2341
+ funcDesc: 'Returns -1.0, 0.0 or 1.0 as `expr` is negative, 0 or positive.',
2342
+ examples: "> SELECT signum(40);\n 1.0\n> SELECT signum(INTERVAL -'100' YEAR);\n -1.0\n",
2343
+ expr: 'signum()',
2344
+ description: {
2345
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2346
+ value: ''
2347
+ }
2348
+ },
2349
+ {
2350
+ name: 'sin(expr)',
2351
+ funcDesc: 'Returns the sine of `expr`, as if computed by `java.lang.Math.sin`.',
2352
+ examples: '> SELECT sin(0);\n 0.0\n',
2353
+ expr: 'sin()',
2354
+ description: {
2355
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2356
+ value: ''
2357
+ }
2358
+ },
2359
+ {
2360
+ name: 'sinh(expr)',
2361
+ funcDesc: 'Returns hyperbolic sine of `expr`, as if computed by `java.lang.Math.sinh`.',
2362
+ examples: '> SELECT sinh(0);\n 0.0\n',
2363
+ expr: 'sinh()',
2364
+ description: {
2365
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2366
+ value: ''
2367
+ }
2368
+ },
2369
+ {
2370
+ name: 'sqrt(expr)',
2371
+ funcDesc: 'Returns the square root of `expr`.',
2372
+ examples: '> SELECT sqrt(4);\n 2.0\n',
2373
+ expr: 'sqrt()',
2374
+ description: {
2375
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2376
+ value: ''
2377
+ }
2378
+ },
2379
+ {
2380
+ name: 'tan(expr)',
2381
+ funcDesc: 'Returns the tangent of `expr`, as if computed by `java.lang.Math.tan`.',
2382
+ examples: '> SELECT tan(0);\n 0.0\n',
2383
+ expr: 'tan()',
2384
+ description: {
2385
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2386
+ value: ''
2387
+ }
2388
+ },
2389
+ {
2390
+ name: 'tanh(expr)',
2391
+ funcDesc: 'Returns the hyperbolic tangent of `expr`, as if computed by `java.lang.Math.tanh`.',
2392
+ examples: '> SELECT tanh(0);\n 0.0\n',
2393
+ expr: 'tanh()',
2394
+ description: {
2395
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2396
+ value: ''
2397
+ }
2398
+ },
2399
+ {
2400
+ name: 'try_add(expr1, expr2)',
2401
+ funcDesc: 'Returns the sum of `expr1`and `expr2` and the result is null on overflow. The acceptable input types are the same with the `+` operator.',
2402
+ examples: "> SELECT try_add(1, 2);\n 3\n> SELECT try_add(2147483647, 1);\n NULL\n> SELECT try_add(date'2021-01-01', 1);\n 2021-01-02\n> SELECT try_add(date'2021-01-01', interval 1 year);\n 2022-01-01\n> SELECT try_add(timestamp'2021-01-01 00:00:00', interval 1 day);\n 2021-01-02 00:00:00\n> SELECT try_add(interval 1 year, interval 2 year);\n 3-0\n",
2403
+ expr: 'try_add()',
2404
+ description: {
2405
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2406
+ value: ''
2407
+ }
2408
+ },
2409
+ {
2410
+ name: 'try_divide(dividend, divisor)',
2411
+ funcDesc: 'Returns `dividend`/`divisor`. It always performs floating point division. Its result is always null if `expr2` is 0. `dividend` must be a numeric or an interval. `divisor` must be a numeric.',
2412
+ examples: '> SELECT try_divide(3, 2);\n 1.5\n> SELECT try_divide(2L, 2L);\n 1.0\n> SELECT try_divide(1, 0);\n NULL\n> SELECT try_divide(interval 2 month, 2);\n 0-1\n> SELECT try_divide(interval 2 month, 0);\n NULL\n',
2413
+ expr: 'try_divide()',
2414
+ description: {
2415
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2416
+ value: ''
2417
+ }
2418
+ },
2419
+ {
2420
+ name: 'try_multiply(expr1, expr2)',
2421
+ funcDesc: 'Returns `expr1`*`expr2` and the result is null on overflow. The acceptable input types are the same with the `*` operator.',
2422
+ examples: '> SELECT try_multiply(2, 3);\n 6\n> SELECT try_multiply(-2147483648, 10);\n NULL\n> SELECT try_multiply(interval 2 year, 3);\n 6-0\n',
2423
+ expr: 'try_multiply()',
2424
+ description: {
2425
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2426
+ value: ''
2427
+ }
2428
+ },
2429
+ {
2430
+ name: 'try_subtract(expr1, expr2)',
2431
+ funcDesc: 'Returns `expr1`-`expr2` and the result is null on overflow. The acceptable input types are the same with the `-` operator.',
2432
+ examples: "> SELECT try_subtract(2, 1);\n 1\n> SELECT try_subtract(-2147483648, 1);\n NULL\n> SELECT try_subtract(date'2021-01-02', 1);\n 2021-01-01\n> SELECT try_subtract(date'2021-01-01', interval 1 year);\n 2020-01-01\n> SELECT try_subtract(timestamp'2021-01-02 00:00:00', interval 1 day);\n 2021-01-01 00:00:00\n> SELECT try_subtract(interval 2 year, interval 1 year);\n 1-0\n",
2433
+ expr: 'try_subtract()',
2434
+ description: {
2435
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2436
+ value: ''
2437
+ }
2438
+ },
2439
+ {
2440
+ name: 'unhex(expr)',
2441
+ funcDesc: 'Converts hexadecimal `expr` to binary.',
2442
+ examples: "> SELECT decode(unhex('537061726B2053514C'), 'UTF-8');\n Spark SQL\n",
2443
+ expr: 'unhex()',
2444
+ description: {
2445
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2446
+ value: ''
2447
+ }
2448
+ },
2449
+ {
2450
+ name: 'width_bucket(value, min_value, max_value, num_bucket)',
2451
+ funcDesc: 'Returns the bucket number to which `value` would be assigned in an equiwidth histogram with `num_bucket` buckets, in the range `min_value` to `max_value`."',
2452
+ examples: "> SELECT width_bucket(5.3, 0.2, 10.6, 5);\n 3\n> SELECT width_bucket(-2.1, 1.3, 3.4, 3);\n 0\n> SELECT width_bucket(8.1, 0.0, 5.7, 4);\n 5\n> SELECT width_bucket(-0.9, 5.2, 0.5, 2);\n 3\n> SELECT width_bucket(INTERVAL '0' YEAR, INTERVAL '0' YEAR, INTERVAL '10' YEAR, 10);\n 1\n> SELECT width_bucket(INTERVAL '1' YEAR, INTERVAL '0' YEAR, INTERVAL '10' YEAR, 10);\n 2\n> SELECT width_bucket(INTERVAL '0' DAY, INTERVAL '0' DAY, INTERVAL '10' DAY, 10);\n 1\n> SELECT width_bucket(INTERVAL '1' DAY, INTERVAL '0' DAY, INTERVAL '10' DAY, 10);\n 2\n",
2453
+ expr: 'width_bucket()',
2454
+ description: {
2455
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2456
+ value: ''
2457
+ }
2458
+ },
2459
+ {
2460
+ name: 'ascii(str)',
2461
+ funcDesc: 'Returns the numeric value of the first character of `str`.',
2462
+ examples: "> SELECT ascii('222');\n 50\n> SELECT ascii(2);\n 50\n",
2463
+ expr: 'ascii()',
2464
+ description: {
2465
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2466
+ value: ''
2467
+ }
2468
+ },
2469
+ {
2470
+ name: 'base64(bin)',
2471
+ funcDesc: 'Converts the argument from a binary `bin` to a base 64 string.',
2472
+ examples: "> SELECT base64('Spark SQL');\n U3BhcmsgU1FM\n> SELECT base64(x'537061726b2053514c');\n U3BhcmsgU1FM\n",
2473
+ expr: 'base64()',
2474
+ description: {
2475
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2476
+ value: ''
2477
+ }
2478
+ },
2479
+ {
2480
+ name: 'bit_length(expr)',
2481
+ funcDesc: 'Returns the bit length of string data or number of bits of binary data.',
2482
+ examples: "> SELECT bit_length('Spark SQL');\n 72\n> SELECT bit_length(x'537061726b2053514c');\n 72\n",
2483
+ expr: 'bit_length()',
2484
+ description: {
2485
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2486
+ value: ''
2487
+ }
2488
+ },
2489
+ {
2490
+ name: 'btrim(str)',
2491
+ funcDesc: 'Removes the leading and trailing space characters from `str`.',
2492
+ examples: "> SELECT btrim(' SparkSQL ');\n SparkSQL\n> SELECT btrim(encode(' SparkSQL ', 'utf-8'));\n SparkSQL\n> SELECT btrim('SSparkSQLS', 'SL');\n parkSQ\n> SELECT btrim(encode('SSparkSQLS', 'utf-8'), encode('SL', 'utf-8'));\n parkSQ\n",
2493
+ expr: 'btrim()',
2494
+ description: {
2495
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2496
+ value: ''
2497
+ }
2498
+ },
2499
+ {
2500
+ name: 'btrim(str, trimStr)',
2501
+ funcDesc: 'Remove the leading and trailing `trimStr` characters from `str`.',
2502
+ examples: "> SELECT btrim('SSparkSQLS', 'SL');\n parkSQ\n> SELECT btrim(encode('SSparkSQLS', 'utf-8'), encode('SL', 'utf-8'));\n parkSQ\n",
2503
+ expr: 'btrim()',
2504
+ description: {
2505
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2506
+ value: ''
2507
+ }
2508
+ },
2509
+ {
2510
+ name: 'char(expr)',
2511
+ funcDesc: 'Returns the ASCII character having the binary equivalent to `expr`. If n is larger than 256 the result is equivalent to chr(n % 256)',
2512
+ examples: '> SELECT char(65);\n A\n',
2513
+ expr: 'char()',
2514
+ description: {
2515
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2516
+ value: ''
2517
+ }
2518
+ },
2519
+ {
2520
+ name: 'char_length(expr)',
2521
+ funcDesc: 'Returns the character length of string data or number of bytes of binary data. The length of string data includes the trailing spaces. The length of binary data includes binary zeros.',
2522
+ examples: "> SELECT char_length('Spark SQL ');\n 10\n> SELECT char_length(x'537061726b2053514c');\n 9\n> SELECT CHAR_LENGTH('Spark SQL ');\n 10\n> SELECT CHARACTER_LENGTH('Spark SQL ');\n 10\n",
2523
+ expr: 'char_length()',
2524
+ description: {
2525
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2526
+ value: ''
2527
+ }
2528
+ },
2529
+ {
2530
+ name: 'character_length(expr)',
2531
+ funcDesc: 'Returns the character length of string data or number of bytes of binary data. The length of string data includes the trailing spaces. The length of binary data includes binary zeros.',
2532
+ examples: "> SELECT character_length('Spark SQL ');\n 10\n> SELECT character_length(x'537061726b2053514c');\n 9\n> SELECT CHAR_LENGTH('Spark SQL ');\n 10\n> SELECT CHARACTER_LENGTH('Spark SQL ');\n 10\n",
2533
+ expr: 'character_length()',
2534
+ description: {
2535
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2536
+ value: ''
2537
+ }
2538
+ },
2539
+ {
2540
+ name: 'chr(expr)',
2541
+ funcDesc: 'Returns the ASCII character having the binary equivalent to `expr`. If n is larger than 256 the result is equivalent to chr(n % 256)',
2542
+ examples: '> SELECT chr(65);\n A\n',
2543
+ expr: 'chr()',
2544
+ description: {
2545
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2546
+ value: ''
2547
+ }
2548
+ },
2549
+ {
2550
+ name: 'concat_ws(sep[, str | array(str)]+)',
2551
+ funcDesc: 'Returns the concatenation of the strings separated by `sep`.',
2552
+ examples: "> SELECT concat_ws(' ', 'Spark', 'SQL');\n Spark SQL\n> SELECT concat_ws('s');\n",
2553
+ expr: 'concat_ws()',
2554
+ description: {
2555
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2556
+ value: ''
2557
+ }
2558
+ },
2559
+ {
2560
+ name: 'contains(left, right)',
2561
+ funcDesc: 'Returns a boolean. The value is True if right is found inside left. Returns NULL if either input expression is NULL. Otherwise, returns False. Both left or right must be of STRING or BINARY type.',
2562
+ examples: "> SELECT contains('Spark SQL', 'Spark');\n true\n> SELECT contains('Spark SQL', 'SPARK');\n false\n> SELECT contains('Spark SQL', null);\n NULL\n> SELECT contains(x'537061726b2053514c', x'537061726b');\n true\n",
2563
+ expr: 'contains()',
2564
+ description: {
2565
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2566
+ value: ''
2567
+ }
2568
+ },
2569
+ {
2570
+ name: 'decode(bin, charset)',
2571
+ funcDesc: 'Decodes the first argument using the second argument character set.',
2572
+ examples: "> SELECT decode(encode('abc', 'utf-8'), 'utf-8');\n abc\n> SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic');\n San Francisco\n> SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic');\n Non domestic\n> SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle');\n NULL\n> SELECT decode(null, 6, 'Spark', NULL, 'SQL', 4, 'rocks');\n SQL\n",
2573
+ expr: 'decode()',
2574
+ description: {
2575
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2576
+ value: ''
2577
+ }
2578
+ },
2579
+ {
2580
+ name: 'decode(expr, search, result [, search, result ] ... [, default])',
2581
+ funcDesc: 'Compares expr to each search value in order. If expr is equal to a search value, decode returns the corresponding result. If no match is found, then it returns default. If default is omitted, it returns null.',
2582
+ examples: "> SELECT decode(encode('abc', 'utf-8'), 'utf-8');\n abc\n> SELECT decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic');\n San Francisco\n> SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic');\n Non domestic\n> SELECT decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle');\n NULL\n> SELECT decode(null, 6, 'Spark', NULL, 'SQL', 4, 'rocks');\n SQL\n",
2583
+ expr: 'decode()',
2584
+ description: {
2585
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2586
+ value: ''
2587
+ }
2588
+ },
2589
+ {
2590
+ name: 'elt(n, input1, input2, ...)',
2591
+ funcDesc: 'Returns the `n`-th input, e.g., returns `input2` when `n` is 2. The function returns NULL if the index exceeds the length of the array and `spark.sql.ansi.enabled` is set to false. If `spark.sql.ansi.enabled` is set to true, it throws ArrayIndexOutOfBoundsException for invalid indices.',
2592
+ examples: "> SELECT elt(1, 'scala', 'java');\n scala\n> SELECT elt(2, 'a', 1);\n 1\n",
2593
+ expr: 'elt()',
2594
+ description: {
2595
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2596
+ value: ''
2597
+ }
2598
+ },
2599
+ {
2600
+ name: 'encode(str, charset)',
2601
+ funcDesc: 'Encodes the first argument using the second argument character set.',
2602
+ examples: "> SELECT encode('abc', 'utf-8');\n abc\n",
2603
+ expr: 'encode()',
2604
+ description: {
2605
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2606
+ value: ''
2607
+ }
2608
+ },
2609
+ {
2610
+ name: 'endswith(left, right)',
2611
+ funcDesc: 'Returns a boolean. The value is True if left ends with right. Returns NULL if either input expression is NULL. Otherwise, returns False. Both left or right must be of STRING or BINARY type.',
2612
+ examples: "> SELECT endswith('Spark SQL', 'SQL');\n true\n> SELECT endswith('Spark SQL', 'Spark');\n false\n> SELECT endswith('Spark SQL', null);\n NULL\n> SELECT endswith(x'537061726b2053514c', x'537061726b');\n false\n> SELECT endswith(x'537061726b2053514c', x'53514c');\n true\n",
2613
+ expr: 'endswith()',
2614
+ description: {
2615
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2616
+ value: ''
2617
+ }
2618
+ },
2619
+ {
2620
+ name: 'find_in_set(str, str_array)',
2621
+ funcDesc: 'Returns the index (1-based) of the given string (`str`) in the comma-delimited list (`str_array`). Returns 0, if the string was not found or if the given string (`str`) contains a comma.',
2622
+ examples: "> SELECT find_in_set('ab','abc,b,ab,c,def');\n 3\n",
2623
+ expr: 'find_in_set()',
2624
+ description: {
2625
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2626
+ value: ''
2627
+ }
2628
+ },
2629
+ {
2630
+ name: 'format_number(expr1, expr2)',
2631
+ funcDesc: "Formats the number `expr1` like '#,###,###.##', rounded to `expr2` decimal places. If `expr2` is 0, the result has no decimal point or fractional part. `expr2` also accept a user specified format. This is supposed to function like MySQL's FORMAT.",
2632
+ examples: "> SELECT format_number(12332.123456, 4);\n 12,332.1235\n> SELECT format_number(12332.123456, '##################.###');\n 12332.123\n",
2633
+ expr: 'format_number()',
2634
+ description: {
2635
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2636
+ value: ''
2637
+ }
2638
+ },
2639
+ {
2640
+ name: 'format_string(strfmt, obj, ...)',
2641
+ funcDesc: 'Returns a formatted string from printf-style format strings.',
2642
+ examples: '> SELECT format_string("Hello World %d %s", 100, "days");\n Hello World 100 days\n',
2643
+ expr: 'format_string()',
2644
+ description: {
2645
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2646
+ value: ''
2647
+ }
2648
+ },
2649
+ {
2650
+ name: 'initcap(str)',
2651
+ funcDesc: 'Returns `str` with the first letter of each word in uppercase. All other letters are in lowercase. Words are delimited by white space.',
2652
+ examples: "> SELECT initcap('sPark sql');\n Spark Sql\n",
2653
+ expr: 'initcap()',
2654
+ description: {
2655
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2656
+ value: ''
2657
+ }
2658
+ },
2659
+ {
2660
+ name: 'instr(str, substr)',
2661
+ funcDesc: 'Returns the (1-based) index of the first occurrence of `substr` in `str`.',
2662
+ examples: "> SELECT instr('SparkSQL', 'SQL');\n 6\n",
2663
+ expr: 'instr()',
2664
+ description: {
2665
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2666
+ value: ''
2667
+ }
2668
+ },
2669
+ {
2670
+ name: 'lcase(str)',
2671
+ funcDesc: 'Returns `str` with all characters changed to lowercase.',
2672
+ examples: "> SELECT lcase('SparkSql');\n sparksql\n",
2673
+ expr: 'lcase()',
2674
+ description: {
2675
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2676
+ value: ''
2677
+ }
2678
+ },
2679
+ {
2680
+ name: 'left(str, len)',
2681
+ funcDesc: 'Returns the leftmost `len`(`len` can be string type) characters from the string `str`,if `len` is less or equal than 0 the result is an empty string.',
2682
+ examples: "> SELECT left('Spark SQL', 3);\n Spa\n> SELECT left(encode('Spark SQL', 'utf-8'), 3);\n Spa\n",
2683
+ expr: 'left()',
2684
+ description: {
2685
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2686
+ value: ''
2687
+ }
2688
+ },
2689
+ {
2690
+ name: 'len(expr)',
2691
+ funcDesc: 'Returns the character length of string data or number of bytes of binary data. The length of string data includes the trailing spaces. The length of binary data includes binary zeros.',
2692
+ examples: "> SELECT len('Spark SQL ');\n 10\n> SELECT len(x'537061726b2053514c');\n 9\n> SELECT CHAR_LENGTH('Spark SQL ');\n 10\n> SELECT CHARACTER_LENGTH('Spark SQL ');\n 10\n",
2693
+ expr: 'len()',
2694
+ description: {
2695
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2696
+ value: ''
2697
+ }
2698
+ },
2699
+ {
2700
+ name: 'length(expr)',
2701
+ funcDesc: 'Returns the character length of string data or number of bytes of binary data. The length of string data includes the trailing spaces. The length of binary data includes binary zeros.',
2702
+ examples: "> SELECT length('Spark SQL ');\n 10\n> SELECT length(x'537061726b2053514c');\n 9\n> SELECT CHAR_LENGTH('Spark SQL ');\n 10\n> SELECT CHARACTER_LENGTH('Spark SQL ');\n 10\n",
2703
+ expr: 'length()',
2704
+ description: {
2705
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2706
+ value: ''
2707
+ }
2708
+ },
2709
+ {
2710
+ name: 'levenshtein(str1, str2)',
2711
+ funcDesc: 'Returns the Levenshtein distance between the two given strings.',
2712
+ examples: "> SELECT levenshtein('kitten', 'sitting');\n 3\n",
2713
+ expr: 'levenshtein()',
2714
+ description: {
2715
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2716
+ value: ''
2717
+ }
2718
+ },
2719
+ {
2720
+ name: 'locate(substr, str[, pos])',
2721
+ funcDesc: 'Returns the position of the first occurrence of `substr` in `str` after position `pos`. The given `pos` and return value are 1-based.',
2722
+ examples: "> SELECT locate('bar', 'foobarbar');\n 4\n> SELECT locate('bar', 'foobarbar', 5);\n 7\n> SELECT POSITION('bar' IN 'foobarbar');\n 4\n",
2723
+ expr: 'locate()',
2724
+ description: {
2725
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2726
+ value: ''
2727
+ }
2728
+ },
2729
+ {
2730
+ name: 'lower(str)',
2731
+ funcDesc: 'Returns `str` with all characters changed to lowercase.',
2732
+ examples: "> SELECT lower('SparkSql');\n sparksql\n",
2733
+ expr: 'lower()',
2734
+ description: {
2735
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2736
+ value: ''
2737
+ }
2738
+ },
2739
+ {
2740
+ name: 'lpad(str, len[, pad])',
2741
+ funcDesc: 'Returns `str`, left-padded with `pad` to a length of `len`. If `str` is longer than `len`, the return value is shortened to `len` characters or bytes. If `pad` is not specified, `str` will be padded to the left with space characters if it is a character string, and with zeros if it is a byte sequence.',
2742
+ examples: "> SELECT lpad('hi', 5, '??');\n ???hi\n> SELECT lpad('hi', 1, '??');\n h\n> SELECT lpad('hi', 5);\n hi\n> SELECT hex(lpad(unhex('aabb'), 5));\n 000000AABB\n> SELECT hex(lpad(unhex('aabb'), 5, unhex('1122')));\n 112211AABB\n",
2743
+ expr: 'lpad()',
2744
+ description: {
2745
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2746
+ value: ''
2747
+ }
2748
+ },
2749
+ {
2750
+ name: 'ltrim(str)',
2751
+ funcDesc: 'Removes the leading space characters from `str`.',
2752
+ examples: "> SELECT ltrim(' SparkSQL ');\n SparkSQL\n",
2753
+ expr: 'ltrim()',
2754
+ description: {
2755
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2756
+ value: ''
2757
+ }
2758
+ },
2759
+ {
2760
+ name: 'mask(input[, upperChar, lowerChar, digitChar, otherChar])',
2761
+ funcDesc: "masks the given string value. The function replaces characters with 'X' or 'x', and numbers with 'n'. This can be useful for creating copies of tables with sensitive information removed.",
2762
+ examples: "> SELECT mask('abcd-EFGH-8765-4321');\n xxxx-XXXX-nnnn-nnnn\n> SELECT mask('abcd-EFGH-8765-4321', 'Q');\n xxxx-QQQQ-nnnn-nnnn\n> SELECT mask('AbCD123-@$#', 'Q', 'q');\n QqQQnnn-@$#\n> SELECT mask('AbCD123-@$#');\n XxXXnnn-@$#\n> SELECT mask('AbCD123-@$#', 'Q');\n QxQQnnn-@$#\n> SELECT mask('AbCD123-@$#', 'Q', 'q');\n QqQQnnn-@$#\n> SELECT mask('AbCD123-@$#', 'Q', 'q', 'd');\n QqQQddd-@$#\n> SELECT mask('AbCD123-@$#', 'Q', 'q', 'd', 'o');\n QqQQdddoooo\n> SELECT mask('AbCD123-@$#', NULL, 'q', 'd', 'o');\n AqCDdddoooo\n> SELECT mask('AbCD123-@$#', NULL, NULL, 'd', 'o');\n AbCDdddoooo\n> SELECT mask('AbCD123-@$#', NULL, NULL, NULL, 'o');\n AbCD123oooo\n> SELECT mask(NULL, NULL, NULL, NULL, 'o');\n NULL\n> SELECT mask(NULL);\n NULL\n> SELECT mask('AbCD123-@$#', NULL, NULL, NULL, NULL);\n AbCD123-@$#\n",
2763
+ expr: 'mask()',
2764
+ description: {
2765
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2766
+ value: ''
2767
+ }
2768
+ },
2769
+ {
2770
+ name: 'octet_length(expr)',
2771
+ funcDesc: 'Returns the byte length of string data or number of bytes of binary data.',
2772
+ examples: "> SELECT octet_length('Spark SQL');\n 9\n> SELECT octet_length(x'537061726b2053514c');\n 9\n",
2773
+ expr: 'octet_length()',
2774
+ description: {
2775
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2776
+ value: ''
2777
+ }
2778
+ },
2779
+ {
2780
+ name: 'overlay(input, replace, pos[, len])',
2781
+ funcDesc: 'Replace `input` with `replace` that starts at `pos` and is of length `len`.',
2782
+ examples: "> SELECT overlay('Spark SQL' PLACING '_' FROM 6);\n Spark_SQL\n> SELECT overlay('Spark SQL' PLACING 'CORE' FROM 7);\n Spark CORE\n> SELECT overlay('Spark SQL' PLACING 'ANSI ' FROM 7 FOR 0);\n Spark ANSI SQL\n> SELECT overlay('Spark SQL' PLACING 'tructured' FROM 2 FOR 4);\n Structured SQL\n> SELECT overlay(encode('Spark SQL', 'utf-8') PLACING encode('_', 'utf-8') FROM 6);\n Spark_SQL\n> SELECT overlay(encode('Spark SQL', 'utf-8') PLACING encode('CORE', 'utf-8') FROM 7);\n Spark CORE\n> SELECT overlay(encode('Spark SQL', 'utf-8') PLACING encode('ANSI ', 'utf-8') FROM 7 FOR 0);\n Spark ANSI SQL\n> SELECT overlay(encode('Spark SQL', 'utf-8') PLACING encode('tructured', 'utf-8') FROM 2 FOR 4);\n Structured SQL\n",
2783
+ expr: 'overlay()',
2784
+ description: {
2785
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2786
+ value: ''
2787
+ }
2788
+ },
2789
+ {
2790
+ name: 'position(substr, str[, pos])',
2791
+ funcDesc: 'Returns the position of the first occurrence of `substr` in `str` after position `pos`. The given `pos` and return value are 1-based.',
2792
+ examples: "> SELECT position('bar', 'foobarbar');\n 4\n> SELECT position('bar', 'foobarbar', 5);\n 7\n> SELECT POSITION('bar' IN 'foobarbar');\n 4\n",
2793
+ expr: 'position()',
2794
+ description: {
2795
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2796
+ value: ''
2797
+ }
2798
+ },
2799
+ {
2800
+ name: 'printf(strfmt, obj, ...)',
2801
+ funcDesc: 'Returns a formatted string from printf-style format strings.',
2802
+ examples: '> SELECT printf("Hello World %d %s", 100, "days");\n Hello World 100 days\n',
2803
+ expr: 'printf()',
2804
+ description: {
2805
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2806
+ value: ''
2807
+ }
2808
+ },
2809
+ {
2810
+ name: 'regexp_count(str, regexp)',
2811
+ funcDesc: 'Returns a count of the number of times that the regular expression pattern `regexp` is matched in the string `str`.',
2812
+ examples: "> SELECT regexp_count('Steven Jones and Stephen Smith are the best players', 'Ste(v|ph)en');\n 2\n> SELECT regexp_count('abcdefghijklmnopqrstuvwxyz', '[a-z]{3}');\n 8\n",
2813
+ expr: 'regexp_count()',
2814
+ description: {
2815
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2816
+ value: ''
2817
+ }
2818
+ },
2819
+ {
2820
+ name: 'regexp_extract(str, regexp[, idx])',
2821
+ funcDesc: 'Extract the first string in the `str` that match the `regexp` expression and corresponding to the regex group index.',
2822
+ examples: "> SELECT regexp_extract('100-200', '(\\\\d+)-(\\\\d+)', 1);\n 100\n",
2823
+ expr: 'regexp_extract()',
2824
+ description: {
2825
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2826
+ value: ''
2827
+ }
2828
+ },
2829
+ {
2830
+ name: 'regexp_extract_all(str, regexp[, idx])',
2831
+ funcDesc: 'Extract all strings in the `str` that match the `regexp` expression and corresponding to the regex group index.',
2832
+ examples: '> SELECT regexp_extract_all(\'100-200, 300-400\', \'(\\\\d+)-(\\\\d+)\', 1);\n ["100","300"]\n',
2833
+ expr: 'regexp_extract_all()',
2834
+ description: {
2835
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2836
+ value: ''
2837
+ }
2838
+ },
2839
+ {
2840
+ name: 'regexp_instr(str, regexp)',
2841
+ funcDesc: 'Searches a string for a regular expression and returns an integer that indicates the beginning position of the matched substring. Positions are 1-based, not 0-based. If no match is found, returns 0.',
2842
+ examples: "> SELECT regexp_instr('user@spark.apache.org', '@[^.]*');\n 5\n",
2843
+ expr: 'regexp_instr()',
2844
+ description: {
2845
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2846
+ value: ''
2847
+ }
2848
+ },
2849
+ {
2850
+ name: 'regexp_replace(str, regexp, rep[, position])',
2851
+ funcDesc: 'Replaces all substrings of `str` that match `regexp` with `rep`.',
2852
+ examples: "> SELECT regexp_replace('100-200', '(\\\\d+)', 'num');\n num-num\n",
2853
+ expr: 'regexp_replace()',
2854
+ description: {
2855
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2856
+ value: ''
2857
+ }
2858
+ },
2859
+ {
2860
+ name: 'regexp_substr(str, regexp)',
2861
+ funcDesc: 'Returns the substring that matches the regular expression `regexp` within the string `str`. If the regular expression is not found, the result is null.',
2862
+ examples: "> SELECT regexp_substr('Steven Jones and Stephen Smith are the best players', 'Ste(v|ph)en');\n Steven\n> SELECT regexp_substr('Steven Jones and Stephen Smith are the best players', 'Jeck');\n NULL\n",
2863
+ expr: 'regexp_substr()',
2864
+ description: {
2865
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2866
+ value: ''
2867
+ }
2868
+ },
2869
+ {
2870
+ name: 'repeat(str, n)',
2871
+ funcDesc: 'Returns the string which repeats the given string value n times.',
2872
+ examples: "> SELECT repeat('123', 2);\n 123123\n",
2873
+ expr: 'repeat()',
2874
+ description: {
2875
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2876
+ value: ''
2877
+ }
2878
+ },
2879
+ {
2880
+ name: 'replace(str, search[, replace])',
2881
+ funcDesc: 'Replaces all occurrences of `search` with `replace`.',
2882
+ examples: "> SELECT replace('ABCabc', 'abc', 'DEF');\n ABCDEF\n",
2883
+ expr: 'replace()',
2884
+ description: {
2885
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2886
+ value: ''
2887
+ }
2888
+ },
2889
+ {
2890
+ name: 'right(str, len)',
2891
+ funcDesc: 'Returns the rightmost `len`(`len` can be string type) characters from the string `str`,if `len` is less or equal than 0 the result is an empty string.',
2892
+ examples: "> SELECT right('Spark SQL', 3);\n SQL\n",
2893
+ expr: 'right()',
2894
+ description: {
2895
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2896
+ value: ''
2897
+ }
2898
+ },
2899
+ {
2900
+ name: 'rpad(str, len[, pad])',
2901
+ funcDesc: 'Returns `str`, right-padded with `pad` to a length of `len`. If `str` is longer than `len`, the return value is shortened to `len` characters. If `pad` is not specified, `str` will be padded to the right with space characters if it is a character string, and with zeros if it is a binary string.',
2902
+ examples: "> SELECT rpad('hi', 5, '??');\n hi???\n> SELECT rpad('hi', 1, '??');\n h\n> SELECT rpad('hi', 5);\n hi\n> SELECT hex(rpad(unhex('aabb'), 5));\n AABB000000\n> SELECT hex(rpad(unhex('aabb'), 5, unhex('1122')));\n AABB112211\n",
2903
+ expr: 'rpad()',
2904
+ description: {
2905
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2906
+ value: ''
2907
+ }
2908
+ },
2909
+ {
2910
+ name: 'rtrim(str)',
2911
+ funcDesc: 'Removes the trailing space characters from `str`.',
2912
+ examples: "> SELECT rtrim(' SparkSQL ');\n SparkSQL\n",
2913
+ expr: 'rtrim()',
2914
+ description: {
2915
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2916
+ value: ''
2917
+ }
2918
+ },
2919
+ {
2920
+ name: 'sentences(str[, lang, country])',
2921
+ funcDesc: 'Splits `str` into an array of array of words.',
2922
+ examples: '> SELECT sentences(\'Hi there! Good morning.\');\n [["Hi","there"],["Good","morning"]]\n',
2923
+ expr: 'sentences()',
2924
+ description: {
2925
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2926
+ value: ''
2927
+ }
2928
+ },
2929
+ {
2930
+ name: 'soundex(str)',
2931
+ funcDesc: 'Returns Soundex code of the string.',
2932
+ examples: "> SELECT soundex('Miller');\n M460\n",
2933
+ expr: 'soundex()',
2934
+ description: {
2935
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2936
+ value: ''
2937
+ }
2938
+ },
2939
+ {
2940
+ name: 'space(n)',
2941
+ funcDesc: 'Returns a string consisting of `n` spaces.',
2942
+ examples: "> SELECT concat(space(2), '1');\n 1\n",
2943
+ expr: 'space()',
2944
+ description: {
2945
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2946
+ value: ''
2947
+ }
2948
+ },
2949
+ {
2950
+ name: 'split(str, regex, limit)',
2951
+ funcDesc: 'Splits `str` around occurrences that match `regex` and returns an array with a length of at most `limit`',
2952
+ examples: '> SELECT split(\'oneAtwoBthreeC\', \'[ABC]\');\n ["one","two","three",""]\n> SELECT split(\'oneAtwoBthreeC\', \'[ABC]\', -1);\n ["one","two","three",""]\n> SELECT split(\'oneAtwoBthreeC\', \'[ABC]\', 2);\n ["one","twoBthreeC"]\n',
2953
+ expr: 'split()',
2954
+ description: {
2955
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2956
+ value: ''
2957
+ }
2958
+ },
2959
+ {
2960
+ name: 'split_part(str, delimiter, partNum)',
2961
+ funcDesc: 'Splits `str` by delimiter and return requested part of the split (1-based). If any input is null, returns null. if `partNum` is out of range of split parts, returns empty string. If `partNum` is 0, throws an error. If `partNum` is negative, the parts are counted backward from the end of the string. If the `delimiter` is an empty string, the `str` is not split.',
2962
+ examples: "> SELECT split_part('11.12.13', '.', 3);\n 13\n",
2963
+ expr: 'split_part()',
2964
+ description: {
2965
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2966
+ value: ''
2967
+ }
2968
+ },
2969
+ {
2970
+ name: 'startswith(left, right)',
2971
+ funcDesc: 'Returns a boolean. The value is True if left starts with right. Returns NULL if either input expression is NULL. Otherwise, returns False. Both left or right must be of STRING or BINARY type.',
2972
+ examples: "> SELECT startswith('Spark SQL', 'Spark');\n true\n> SELECT startswith('Spark SQL', 'SQL');\n false\n> SELECT startswith('Spark SQL', null);\n NULL\n> SELECT startswith(x'537061726b2053514c', x'537061726b');\n true\n> SELECT startswith(x'537061726b2053514c', x'53514c');\n false\n",
2973
+ expr: 'startswith()',
2974
+ description: {
2975
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2976
+ value: ''
2977
+ }
2978
+ },
2979
+ {
2980
+ name: 'substr(str, pos[, len])',
2981
+ funcDesc: 'Returns the substring of `str` that starts at `pos` and is of length `len`, or the slice of byte array that starts at `pos` and is of length `len`.',
2982
+ examples: "> SELECT substr('Spark SQL', 5);\n k SQL\n> SELECT substr('Spark SQL', -3);\n SQL\n> SELECT substr('Spark SQL', 5, 1);\n k\n> SELECT substr('Spark SQL' FROM 5);\n k SQL\n> SELECT substr('Spark SQL' FROM -3);\n SQL\n> SELECT substr('Spark SQL' FROM 5 FOR 1);\n k\n> SELECT substr(encode('Spark SQL', 'utf-8'), 5);\n k SQL\n",
2983
+ expr: 'substr()',
2984
+ description: {
2985
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2986
+ value: ''
2987
+ }
2988
+ },
2989
+ {
2990
+ name: 'substr(str FROM pos[ FOR len]])',
2991
+ funcDesc: 'Returns the substring of `str` that starts at `pos` and is of length `len`, or the slice of byte array that starts at `pos` and is of length `len`.',
2992
+ examples: "> SELECT substr('Spark SQL', 5);\n k SQL\n> SELECT substr('Spark SQL', -3);\n SQL\n> SELECT substr('Spark SQL', 5, 1);\n k\n> SELECT substr('Spark SQL' FROM 5);\n k SQL\n> SELECT substr('Spark SQL' FROM -3);\n SQL\n> SELECT substr('Spark SQL' FROM 5 FOR 1);\n k\n> SELECT substr(encode('Spark SQL', 'utf-8'), 5);\n k SQL\n",
2993
+ expr: 'substr()',
2994
+ description: {
2995
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
2996
+ value: ''
2997
+ }
2998
+ },
2999
+ {
3000
+ name: 'substring(str, pos[, len])',
3001
+ funcDesc: 'Returns the substring of `str` that starts at `pos` and is of length `len`, or the slice of byte array that starts at `pos` and is of length `len`.',
3002
+ examples: "> SELECT substring('Spark SQL', 5);\n k SQL\n> SELECT substring('Spark SQL', -3);\n SQL\n> SELECT substring('Spark SQL', 5, 1);\n k\n> SELECT substring('Spark SQL' FROM 5);\n k SQL\n> SELECT substring('Spark SQL' FROM -3);\n SQL\n> SELECT substring('Spark SQL' FROM 5 FOR 1);\n k\n> SELECT substring(encode('Spark SQL', 'utf-8'), 5);\n k SQL\n",
3003
+ expr: 'substring()',
3004
+ description: {
3005
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3006
+ value: ''
3007
+ }
3008
+ },
3009
+ {
3010
+ name: 'substring(str FROM pos[ FOR len]])',
3011
+ funcDesc: 'Returns the substring of `str` that starts at `pos` and is of length `len`, or the slice of byte array that starts at `pos` and is of length `len`.',
3012
+ examples: "> SELECT substring('Spark SQL', 5);\n k SQL\n> SELECT substring('Spark SQL', -3);\n SQL\n> SELECT substring('Spark SQL', 5, 1);\n k\n> SELECT substring('Spark SQL' FROM 5);\n k SQL\n> SELECT substring('Spark SQL' FROM -3);\n SQL\n> SELECT substring('Spark SQL' FROM 5 FOR 1);\n k\n> SELECT substring(encode('Spark SQL', 'utf-8'), 5);\n k SQL\n",
3013
+ expr: 'substring()',
3014
+ description: {
3015
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3016
+ value: ''
3017
+ }
3018
+ },
3019
+ {
3020
+ name: 'substring_index(str, delim, count)',
3021
+ funcDesc: 'Returns the substring from `str` before `count` occurrences of the delimiter `delim`. If `count` is positive, everything to the left of the final delimiter (counting from the left) is returned. If `count` is negative, everything to the right of the final delimiter (counting from the right) is returned. The function substring_index performs a case-sensitive match when searching for `delim`.',
3022
+ examples: "> SELECT substring_index('www.apache.org', '.', 2);\n www.apache\n",
3023
+ expr: 'substring_index()',
3024
+ description: {
3025
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3026
+ value: ''
3027
+ }
3028
+ },
3029
+ {
3030
+ name: 'to_binary(str[, fmt])',
3031
+ funcDesc: 'Converts the input `str` to a binary value based on the supplied `fmt`. `fmt` can be a case-insensitive string literal of "hex", "utf-8", "utf8", or "base64". By default, the binary format for conversion is "hex" if `fmt` is omitted. The function returns NULL if at least one of the input parameters is NULL.',
3032
+ examples: "> SELECT to_binary('abc', 'utf-8');\n abc\n",
3033
+ expr: 'to_binary()',
3034
+ description: {
3035
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3036
+ value: ''
3037
+ }
3038
+ },
3039
+ {
3040
+ name: 'to_char(numberExpr, formatExpr)',
3041
+ funcDesc: "Convert `numberExpr` to a string based on the `formatExpr`. Throws an exception if the conversion fails. The format can consist of the following characters, case insensitive: '0' or '9': Specifies an expected digit between 0 and 9. A sequence of 0 or 9 in the format string matches a sequence of digits in the input value, generating a result string of the same length as the corresponding sequence in the format string. The result string is left-padded with zeros if the 0/9 sequence comprises more digits than the matching part of the decimal value, starts with 0, and is before the decimal point. Otherwise, it is padded with spaces. '.' or 'D': Specifies the position of the decimal point (optional, only allowed once). ',' or 'G': Specifies the position of the grouping (thousands) separator (,). There must be a 0 or 9 to the left and right of each grouping separator. '\n′\n:Specifiesthelocationofthe\n′\n:\n𝑆\n𝑝\n𝑒\n𝑐\n𝑖\n𝑓\n𝑖\n𝑒\n𝑠\n𝑡\nℎ\n𝑒\n𝑙\n𝑜\n𝑐\n𝑎\n𝑡\n𝑖\n𝑜\n𝑛\n𝑜\n𝑓\n𝑡\nℎ\n𝑒\n currency sign. This character may only be specified once. 'S' or 'MI': Specifies the position of a '-' or '+' sign (optional, only allowed once at the beginning or end of the format string). Note that 'S' prints '+' for positive values but 'MI' prints a space. 'PR': Only allowed at the end of the format string; specifies that the result string will be wrapped by angle brackets if the input value is negative. ('<1>').",
3042
+ examples: "> SELECT to_char(454, '999');\n 454\n> SELECT to_char(454.00, '000D00');\n 454.00\n> SELECT to_char(12454, '99G999');\n 12,454\n> SELECT to_char(78.12, '$99.99');\n $78.12\n> SELECT to_char(-12454.8, '99G999D9S');\n 12,454.8-\n",
3043
+ expr: 'to_char()',
3044
+ description: {
3045
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3046
+ value: ''
3047
+ }
3048
+ },
3049
+ {
3050
+ name: 'to_number(expr, fmt)',
3051
+ funcDesc: "Convert string 'expr' to a number based on the string format 'fmt'. Throws an exception if the conversion fails. The format can consist of the following characters, case insensitive: '0' or '9': Specifies an expected digit between 0 and 9. A sequence of 0 or 9 in the format string matches a sequence of digits in the input string. If the 0/9 sequence starts with 0 and is before the decimal point, it can only match a digit sequence of the same size. Otherwise, if the sequence starts with 9 or is after the decimal point, it can match a digit sequence that has the same or smaller size. '.' or 'D': Specifies the position of the decimal point (optional, only allowed once). ',' or 'G': Specifies the position of the grouping (thousands) separator (,). There must be a 0 or 9 to the left and right of each grouping separator. 'expr' must match the grouping separator relevant for the size of the number. '\n′\n:Specifiesthelocationofthe\n′\n:\n𝑆\n𝑝\n𝑒\n𝑐\n𝑖\n𝑓\n𝑖\n𝑒\n𝑠\n𝑡\nℎ\n𝑒\n𝑙\n𝑜\n𝑐\n𝑎\n𝑡\n𝑖\n𝑜\n𝑛\n𝑜\n𝑓\n𝑡\nℎ\n𝑒\n currency sign. This character may only be specified once. 'S' or 'MI': Specifies the position of a '-' or '+' sign (optional, only allowed once at the beginning or end of the format string). Note that 'S' allows '-' but 'MI' does not. 'PR': Only allowed at the end of the format string; specifies that 'expr' indicates a negative number with wrapping angled brackets. ('<1>').",
3052
+ examples: "> SELECT to_number('454', '999');\n 454\n> SELECT to_number('454.00', '000.00');\n 454.00\n> SELECT to_number('12,454', '99,999');\n 12454\n> SELECT to_number('$78.12', '$99.99');\n 78.12\n> SELECT to_number('12,454.8-', '99,999.9S');\n -12454.8\n",
3053
+ expr: 'to_number()',
3054
+ description: {
3055
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3056
+ value: ''
3057
+ }
3058
+ },
3059
+ {
3060
+ name: 'translate(input, from, to)',
3061
+ funcDesc: 'Translates the `input` string by replacing the characters present in the `from` string with the corresponding characters in the `to` string.',
3062
+ examples: "> SELECT translate('AaBbCc', 'abc', '123');\n A1B2C3\n",
3063
+ expr: 'translate()',
3064
+ description: {
3065
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3066
+ value: ''
3067
+ }
3068
+ },
3069
+ {
3070
+ name: 'trim(str)',
3071
+ funcDesc: 'Removes the leading and trailing space characters from `str`.',
3072
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3073
+ expr: 'trim()',
3074
+ description: {
3075
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3076
+ value: ''
3077
+ }
3078
+ },
3079
+ {
3080
+ name: 'trim(BOTH FROM str)',
3081
+ funcDesc: 'Removes the leading and trailing space characters from `str`.',
3082
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3083
+ expr: 'trim()',
3084
+ description: {
3085
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3086
+ value: ''
3087
+ }
3088
+ },
3089
+ {
3090
+ name: 'trim(LEADING FROM str)',
3091
+ funcDesc: 'Removes the leading space characters from `str`.',
3092
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3093
+ expr: 'trim()',
3094
+ description: {
3095
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3096
+ value: ''
3097
+ }
3098
+ },
3099
+ {
3100
+ name: 'trim(TRAILING FROM str)',
3101
+ funcDesc: 'Removes the trailing space characters from `str`.',
3102
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3103
+ expr: 'trim()',
3104
+ description: {
3105
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3106
+ value: ''
3107
+ }
3108
+ },
3109
+ {
3110
+ name: 'trim(trimStr FROM str)',
3111
+ funcDesc: 'Remove the leading and trailing `trimStr` characters from `str`.',
3112
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3113
+ expr: 'trim()',
3114
+ description: {
3115
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3116
+ value: ''
3117
+ }
3118
+ },
3119
+ {
3120
+ name: 'trim(BOTH trimStr FROM str)',
3121
+ funcDesc: 'Remove the leading and trailing `trimStr` characters from `str`.',
3122
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3123
+ expr: 'trim()',
3124
+ description: {
3125
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3126
+ value: ''
3127
+ }
3128
+ },
3129
+ {
3130
+ name: 'trim(LEADING trimStr FROM str)',
3131
+ funcDesc: 'Remove the leading `trimStr` characters from `str`.',
3132
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3133
+ expr: 'trim()',
3134
+ description: {
3135
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3136
+ value: ''
3137
+ }
3138
+ },
3139
+ {
3140
+ name: 'trim(TRAILING trimStr FROM str)',
3141
+ funcDesc: 'Remove the trailing `trimStr` characters from `str`.',
3142
+ examples: "> SELECT trim(' SparkSQL ');\n SparkSQL\n> SELECT trim(BOTH FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(LEADING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim(TRAILING FROM ' SparkSQL ');\n SparkSQL\n> SELECT trim('SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(BOTH 'SL' FROM 'SSparkSQLS');\n parkSQ\n> SELECT trim(LEADING 'SL' FROM 'SSparkSQLS');\n parkSQLS\n> SELECT trim(TRAILING 'SL' FROM 'SSparkSQLS');\n SSparkSQ\n",
3143
+ expr: 'trim()',
3144
+ description: {
3145
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3146
+ value: ''
3147
+ }
3148
+ },
3149
+ {
3150
+ name: 'try_to_binary(str[, fmt])',
3151
+ funcDesc: 'This is a special version of `to_binary` that performs the same operation, but returns a NULL value instead of raising an error if the conversion cannot be performed.',
3152
+ examples: "> SELECT try_to_binary('abc', 'utf-8');\n abc\n> select try_to_binary('a!', 'base64');\n NULL\n> select try_to_binary('abc', 'invalidFormat');\n NULL\n",
3153
+ expr: 'try_to_binary()',
3154
+ description: {
3155
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3156
+ value: ''
3157
+ }
3158
+ },
3159
+ {
3160
+ name: 'try_to_number(expr, fmt)',
3161
+ funcDesc: "Convert string 'expr' to a number based on the string format `fmt`. Returns NULL if the string 'expr' does not match the expected format. The format follows the same semantics as the to_number function.",
3162
+ examples: "> SELECT try_to_number('454', '999');\n 454\n> SELECT try_to_number('454.00', '000.00');\n 454.00\n> SELECT try_to_number('12,454', '99,999');\n 12454\n> SELECT try_to_number('$78.12', '$99.99');\n 78.12\n> SELECT try_to_number('12,454.8-', '99,999.9S');\n -12454.8\n",
3163
+ expr: 'try_to_number()',
3164
+ description: {
3165
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3166
+ value: ''
3167
+ }
3168
+ },
3169
+ {
3170
+ name: 'ucase(str)',
3171
+ funcDesc: 'Returns `str` with all characters changed to uppercase.',
3172
+ examples: "> SELECT ucase('SparkSql');\n SPARKSQL\n",
3173
+ expr: 'ucase()',
3174
+ description: {
3175
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3176
+ value: ''
3177
+ }
3178
+ },
3179
+ {
3180
+ name: 'unbase64(str)',
3181
+ funcDesc: 'Converts the argument from a base 64 string `str` to a binary.',
3182
+ examples: "> SELECT unbase64('U3BhcmsgU1FM');\n Spark SQL\n",
3183
+ expr: 'unbase64()',
3184
+ description: {
3185
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3186
+ value: ''
3187
+ }
3188
+ },
3189
+ {
3190
+ name: 'upper(str)',
3191
+ funcDesc: 'Returns `str` with all characters changed to uppercase.',
3192
+ examples: "> SELECT upper('SparkSql');\n SPARKSQL\n",
3193
+ expr: 'upper()',
3194
+ description: {
3195
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3196
+ value: ''
3197
+ }
3198
+ },
3199
+ {
3200
+ name: 'coalesce(expr1, expr2, ...)',
3201
+ funcDesc: 'Returns the first non-null argument if exists. Otherwise, null.',
3202
+ examples: '> SELECT coalesce(NULL, 1, NULL);\n 1\n',
3203
+ expr: 'coalesce()',
3204
+ description: {
3205
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3206
+ value: ''
3207
+ }
3208
+ },
3209
+ {
3210
+ name: 'if(expr1, expr2, expr3)',
3211
+ funcDesc: 'If `expr1` evaluates to true, then returns `expr2`; otherwise returns `expr3`.',
3212
+ examples: "> SELECT if(1 < 2, 'a', 'b');\n a\n",
3213
+ expr: 'if()',
3214
+ description: {
3215
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3216
+ value: ''
3217
+ }
3218
+ },
3219
+ {
3220
+ name: 'ifnull(expr1, expr2)',
3221
+ funcDesc: 'Returns `expr2` if `expr1` is null, or `expr1` otherwise.',
3222
+ examples: '> SELECT ifnull(NULL, array(\'2\'));\n ["2"]\n',
3223
+ expr: 'ifnull()',
3224
+ description: {
3225
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3226
+ value: ''
3227
+ }
3228
+ },
3229
+ {
3230
+ name: 'nanvl(expr1, expr2)',
3231
+ funcDesc: "Returns `expr1` if it's not NaN, or `expr2` otherwise.",
3232
+ examples: "> SELECT nanvl(cast('NaN' as double), 123);\n 123.0\n",
3233
+ expr: 'nanvl()',
3234
+ description: {
3235
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3236
+ value: ''
3237
+ }
3238
+ },
3239
+ {
3240
+ name: 'nullif(expr1, expr2)',
3241
+ funcDesc: 'Returns null if `expr1` equals to `expr2`, or `expr1` otherwise.',
3242
+ examples: '> SELECT nullif(2, 2);\n NULL\n',
3243
+ expr: 'nullif()',
3244
+ description: {
3245
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3246
+ value: ''
3247
+ }
3248
+ },
3249
+ {
3250
+ name: 'nvl(expr1, expr2)',
3251
+ funcDesc: 'Returns `expr2` if `expr1` is null, or `expr1` otherwise.',
3252
+ examples: '> SELECT nvl(NULL, array(\'2\'));\n ["2"]\n',
3253
+ expr: 'nvl()',
3254
+ description: {
3255
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3256
+ value: ''
3257
+ }
3258
+ },
3259
+ {
3260
+ name: 'nvl2(expr1, expr2, expr3)',
3261
+ funcDesc: 'Returns `expr2` if `expr1` is not null, or `expr3` otherwise.',
3262
+ examples: '> SELECT nvl2(NULL, 2, 1);\n 1\n',
3263
+ expr: 'nvl2()',
3264
+ description: {
3265
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3266
+ value: ''
3267
+ }
3268
+ },
3269
+ {
3270
+ name: 'CASE WHEN expr1 THEN expr2 [WHEN expr3 THEN expr4]* [ELSE expr5] END',
3271
+ funcDesc: 'When `expr1` = true, returns `expr2`; else when `expr3` = true, returns `expr4`; else returns `expr5`.',
3272
+ examples: '> SELECT CASE WHEN 1 > 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END;\n 1.0\n> SELECT CASE WHEN 1 < 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END;\n 2.0\n> SELECT CASE WHEN 1 < 0 THEN 1 WHEN 2 < 0 THEN 2.0 END;\n NULL',
3273
+ expr: 'CASE WHEN expr1 THEN expr2 [WHEN expr3 THEN expr4]* [ELSE expr5] END',
3274
+ description: {
3275
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3276
+ value: ''
3277
+ }
3278
+ },
3279
+ {
3280
+ name: 'expr1 & expr2',
3281
+ funcDesc: 'Returns the result of bitwise AND of `expr1` and `expr2`.',
3282
+ examples: '> SELECT 3 & 5;\n 1\n',
3283
+ expr: 'expr1 & expr2',
3284
+ description: {
3285
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3286
+ value: ''
3287
+ }
3288
+ },
3289
+ {
3290
+ name: 'expr1 ^ expr2',
3291
+ funcDesc: 'Returns the result of bitwise exclusive OR of `expr1` and `expr2`.',
3292
+ examples: '> SELECT 3 ^ 5;\n 6\n',
3293
+ expr: 'expr1 ^ expr2',
3294
+ description: {
3295
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3296
+ value: ''
3297
+ }
3298
+ },
3299
+ {
3300
+ name: 'bit_count(expr)',
3301
+ funcDesc: 'Returns the number of bits that are set in the argument expr as an unsigned 64-bit integer, or NULL if the argument is NULL.',
3302
+ examples: '> SELECT bit_count(0);\n 0\n',
3303
+ expr: 'bit_count()',
3304
+ description: {
3305
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3306
+ value: ''
3307
+ }
3308
+ },
3309
+ {
3310
+ name: 'bit_get(expr, pos)',
3311
+ funcDesc: 'Returns the value of the bit (0 or 1) at the specified position. The positions are numbered from right to left, starting at zero. The position argument cannot be negative.',
3312
+ examples: '> SELECT bit_get(11, 0);\n 1\n> SELECT bit_get(11, 2);\n 0\n',
3313
+ expr: 'bit_get()',
3314
+ description: {
3315
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3316
+ value: ''
3317
+ }
3318
+ },
3319
+ {
3320
+ name: 'getbit(expr, pos)',
3321
+ funcDesc: 'Returns the value of the bit (0 or 1) at the specified position. The positions are numbered from right to left, starting at zero. The position argument cannot be negative.',
3322
+ examples: '> SELECT getbit(11, 0);\n 1\n> SELECT getbit(11, 2);\n 0\n',
3323
+ expr: 'getbit()',
3324
+ description: {
3325
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3326
+ value: ''
3327
+ }
3328
+ },
3329
+ {
3330
+ name: 'shiftright(base, expr)',
3331
+ funcDesc: 'Bitwise (signed) right shift.',
3332
+ examples: '> SELECT shiftright(4, 1);\n 2\n',
3333
+ expr: 'shiftright()',
3334
+ description: {
3335
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3336
+ value: ''
3337
+ }
3338
+ },
3339
+ {
3340
+ name: 'shiftrightunsigned(base, expr)',
3341
+ funcDesc: 'Bitwise unsigned right shift.',
3342
+ examples: '> SELECT shiftrightunsigned(4, 1);\n 2\n',
3343
+ expr: 'shiftrightunsigned()',
3344
+ description: {
3345
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3346
+ value: ''
3347
+ }
3348
+ },
3349
+ {
3350
+ name: 'expr1 | expr2',
3351
+ funcDesc: 'Returns the result of bitwise OR of `expr1` and `expr2`.',
3352
+ examples: '> SELECT 3 | 5;\n 7\n',
3353
+ expr: 'expr1 | expr2',
3354
+ description: {
3355
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3356
+ value: ''
3357
+ }
3358
+ },
3359
+ {
3360
+ name: '~ expr',
3361
+ funcDesc: 'Returns the result of bitwise NOT of `expr`.',
3362
+ examples: '> SELECT ~ 0;\n -1\n',
3363
+ expr: '~ expr',
3364
+ description: {
3365
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3366
+ value: ''
3367
+ }
3368
+ },
3369
+ {
3370
+ name: 'bigint(expr)',
3371
+ funcDesc: 'Casts the value `expr` to the target data type `bigint`.',
3372
+ examples: "> SELECT bigint(current_timestamp);\n 1616168320\n> SELECT bigint('5');\n 5\n",
3373
+ expr: 'bigint()',
3374
+ description: {
3375
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3376
+ value: ''
3377
+ }
3378
+ },
3379
+ {
3380
+ name: 'binary(expr)',
3381
+ funcDesc: 'Casts the value `expr` to the target data type `binary`.',
3382
+ examples: "> SELECT binary('Spark SQL');\n [53 70 61 72 6B 20 53 51 4C]\n> SELECT binary(1984);\n [00 00 07 C0]\n",
3383
+ expr: 'binary()',
3384
+ description: {
3385
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3386
+ value: ''
3387
+ }
3388
+ },
3389
+ {
3390
+ name: 'boolean(expr)',
3391
+ funcDesc: 'Casts the value `expr` to the target data type `boolean`.',
3392
+ examples: '> SELECT boolean(1);\n true\n> SELECT boolean(0);\n false\n> SELECT boolean(2);\n true\n',
3393
+ expr: 'boolean()',
3394
+ description: {
3395
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3396
+ value: ''
3397
+ }
3398
+ },
3399
+ {
3400
+ name: 'cast(expr AS type)',
3401
+ funcDesc: 'Casts the value `expr` to the target data type `type`.',
3402
+ examples: "> SELECT cast('10' as int);\n 10\n",
3403
+ expr: 'cast()',
3404
+ description: {
3405
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3406
+ value: ''
3407
+ }
3408
+ },
3409
+ {
3410
+ name: 'date(expr)',
3411
+ funcDesc: 'Casts the value `expr` to the target data type `date`.',
3412
+ examples: "> SELECT date_add('2016-07-30', 1);\n 2016-07-31\n",
3413
+ expr: 'date()',
3414
+ description: {
3415
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3416
+ value: ''
3417
+ }
3418
+ },
3419
+ {
3420
+ name: 'decimal(expr)',
3421
+ funcDesc: 'Casts the value `expr` to the target data type `decimal`.',
3422
+ examples: "> SELECT decimal('5.2');\n 5\n",
3423
+ expr: 'decimal()',
3424
+ description: {
3425
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3426
+ value: ''
3427
+ }
3428
+ },
3429
+ {
3430
+ name: 'double(expr)',
3431
+ funcDesc: 'Casts the value `expr` to the target data type `double`.',
3432
+ examples: "> SELECT double('5.2');\n 5.2",
3433
+ expr: 'double()',
3434
+ description: {
3435
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3436
+ value: ''
3437
+ }
3438
+ },
3439
+ {
3440
+ name: 'float(expr)',
3441
+ funcDesc: 'Casts the value `expr` to the target data type `float`.',
3442
+ examples: "> SELECT float('5.2');\n 5.2\n",
3443
+ expr: 'float()',
3444
+ description: {
3445
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3446
+ value: ''
3447
+ }
3448
+ },
3449
+ {
3450
+ name: 'int(expr)',
3451
+ funcDesc: 'Casts the value `expr` to the target data type `int`.',
3452
+ examples: "> SELECT int(-5.6);\n 5\n> SELECT int('5');\n 5\n",
3453
+ expr: 'int()',
3454
+ description: {
3455
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3456
+ value: ''
3457
+ }
3458
+ },
3459
+ {
3460
+ name: 'smallint(expr)',
3461
+ funcDesc: 'Casts the value `expr` to the target data type `smallint`.',
3462
+ examples: "> SELECT smallint(-5.6);\n 5\n> SELECT smallint('5');\n 5\n",
3463
+ expr: 'smallint()',
3464
+ description: {
3465
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3466
+ value: ''
3467
+ }
3468
+ },
3469
+ {
3470
+ name: 'string(expr)',
3471
+ funcDesc: 'Casts the value `expr` to the target data type `string`.',
3472
+ examples: '> SELECT string(5);\n 5\n> SELECT string(current_date);\n 2021-04-01\n',
3473
+ expr: 'string()',
3474
+ description: {
3475
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3476
+ value: ''
3477
+ }
3478
+ },
3479
+ {
3480
+ name: 'timestamp(expr)',
3481
+ funcDesc: 'Casts the value `expr` to the target data type `timestamp`.',
3482
+ examples: '> SELECT timestamp_micros(1230219000123123);\n 2008-12-25 07:30:00.123123\n',
3483
+ expr: 'timestamp()',
3484
+ description: {
3485
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3486
+ value: ''
3487
+ }
3488
+ },
3489
+ {
3490
+ name: 'tinyint(expr)',
3491
+ funcDesc: 'Casts the value `expr` to the target data type `tinyint`.',
3492
+ examples: "> SELECT tinyint('12');\n 12\n> SELECT tinyint(5.4);\n 5\n",
3493
+ expr: 'tinyint()',
3494
+ description: {
3495
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3496
+ value: ''
3497
+ }
3498
+ },
3499
+ {
3500
+ name: '! expr',
3501
+ funcDesc: 'Logical not.',
3502
+ examples: '> SELECT ! true;\n false\n> SELECT ! false;\n true\n> SELECT ! NULL;\n NULL\n',
3503
+ expr: '! expr',
3504
+ description: {
3505
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3506
+ value: ''
3507
+ }
3508
+ },
3509
+ {
3510
+ name: 'expr1 < expr2',
3511
+ funcDesc: 'Returns true if `expr1` is less than `expr2`.',
3512
+ examples: "> SELECT 1 < 2;\n true\n> SELECT 1.1 < '1';\n false\n> SELECT to_date('2009-07-30 04:17:52') < to_date('2009-07-30 04:17:52');\n false\n SELECT to_date('2009-07-30 04:17:52') < to_date('2009-08-01 04:17:52');\n true\n> SELECT 1 < NULL;\n NULL\n",
3513
+ expr: 'expr1 < expr2',
3514
+ description: {
3515
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3516
+ value: ''
3517
+ }
3518
+ },
3519
+ {
3520
+ name: 'expr1 <= expr2',
3521
+ funcDesc: 'Returns true if `expr1` is less than or equal to `expr2`.',
3522
+ examples: "> SELECT 2 <= 2;\n true\n> SELECT 1.0 <= '1';\n true\n> SELECT to_date('2009-07-30 04:17:52') <= to_date('2009-07-30 04:17:52');\n true\n> SELECT to_date('2009-07-30 04:17:52') <= to_date('2009-08-01 04:17:52');\n true\n> SELECT 1 <= NULL;\n NULL\n",
3523
+ expr: 'expr1 <= expr2',
3524
+ description: {
3525
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3526
+ value: ''
3527
+ }
3528
+ },
3529
+ {
3530
+ name: 'expr1 <=> expr2',
3531
+ funcDesc: 'Returns same result as the EQUAL(=) operator for non-null operands, but returns true if both are null, false if one of the them is null.',
3532
+ examples: "> SELECT 2 <=> 2;\n true\n> SELECT 1 <=> '1';\n true\n> SELECT true <=> NULL;\n false\n> SELECT NULL <=> NULL;\n true\n",
3533
+ expr: 'expr1 <=> expr2',
3534
+ description: {
3535
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3536
+ value: ''
3537
+ }
3538
+ },
3539
+ {
3540
+ name: 'expr1 = expr2',
3541
+ funcDesc: 'Returns true if `expr1` equals `expr2`, or false otherwise.',
3542
+ examples: "> SELECT 2 = 2;\n true\n> SELECT 1 = '1';\n true\n> SELECT true = NULL;\n NULL\n> SELECT NULL = NULL;\n NULL\n",
3543
+ expr: 'expr1 = expr2',
3544
+ description: {
3545
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3546
+ value: ''
3547
+ }
3548
+ },
3549
+ {
3550
+ name: 'expr1 == expr2',
3551
+ funcDesc: 'Returns true if `expr1` equals `expr2`, or false otherwise.',
3552
+ examples: "> SELECT 2 == 2;\n true\n> SELECT 1 == '1';\n true\n> SELECT true == NULL;\n NULL\n> SELECT NULL == NULL;\n NULL\n",
3553
+ expr: 'expr1 == expr2',
3554
+ description: {
3555
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3556
+ value: ''
3557
+ }
3558
+ },
3559
+ {
3560
+ name: 'expr1 > expr2',
3561
+ funcDesc: 'Returns true if `expr1` is greater than `expr2`.',
3562
+ examples: "> SELECT 2 > 1;\n true\n> SELECT 2 > 1.1;\n true\n> SELECT to_date('2009-07-30 04:17:52') > to_date('2009-07-30 04:17:52');\n false\n> SELECT to_date('2009-07-30 04:17:52') > to_date('2009-08-01 04:17:52');\n false\n> SELECT 1 > NULL;\n NULL\n",
3563
+ expr: 'expr1 > expr2',
3564
+ description: {
3565
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3566
+ value: ''
3567
+ }
3568
+ },
3569
+ {
3570
+ name: 'expr1 >= expr2',
3571
+ funcDesc: 'Returns true if `expr1` is greater than or equal to `expr2`.',
3572
+ examples: "> SELECT 2 >= 1;\n true\n> SELECT 2.0 >= '2.1';\n false\n> SELECT to_date('2009-07-30 04:17:52') >= to_date('2009-07-30 04:17:52');\n true\n> SELECT to_date('2009-07-30 04:17:52') >= to_date('2009-08-01 04:17:52');\n false\n> SELECT 1 >= NULL;\n NULL\n",
3573
+ expr: 'expr1 >= expr2',
3574
+ description: {
3575
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3576
+ value: ''
3577
+ }
3578
+ },
3579
+ {
3580
+ name: 'expr1 and expr2',
3581
+ funcDesc: 'Logical AND.',
3582
+ examples: '> SELECT true and true;\n true\n> SELECT true and false;\n false\n> SELECT true and NULL;\n NULL\n> SELECT false and NULL;\n false\n',
3583
+ expr: 'expr1 and expr2',
3584
+ description: {
3585
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3586
+ value: ''
3587
+ }
3588
+ },
3589
+ {
3590
+ name: 'str ilike pattern[ ESCAPE escape]',
3591
+ funcDesc: 'Returns true if str matches `pattern` with `escape` case-insensitively, null if any arguments are null, false otherwise.',
3592
+ examples: "> SELECT ilike('Spark', '_Park');\n true\n> SET spark.sql.parser.escapedStringLiterals=true;\n spark.sql.parser.escapedStringLiterals true\n> SELECT '%SystemDrive%\\Users\\John' ilike '\\%SystemDrive\\%\\\\users%';\n true\n> SET spark.sql.parser.escapedStringLiterals=false;\n spark.sql.parser.escapedStringLiterals false\n> SELECT '%SystemDrive%\\\\USERS\\\\John' ilike '\\%SystemDrive\\%\\\\\\\\Users%';\n true\n> SELECT '%SystemDrive%/Users/John' ilike '/%SYSTEMDrive/%//Users%' ESCAPE '/';\n true\n",
3593
+ expr: 'str ilike pattern[ ESCAPE escape]',
3594
+ description: {
3595
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3596
+ value: ''
3597
+ }
3598
+ },
3599
+ {
3600
+ name: 'expr1 in(expr2, expr3, ...)',
3601
+ funcDesc: 'Returns true if `expr` equals to any valN.',
3602
+ examples: "> SELECT 1 in(1, 2, 3);\n true\n> SELECT 1 in(2, 3, 4);\n false\n> SELECT named_struct('a', 1, 'b', 2) in(named_struct('a', 1, 'b', 1), named_struct('a', 1, 'b', 3));\n false\n> SELECT named_struct('a', 1, 'b', 2) in(named_struct('a', 1, 'b', 2), named_struct('a', 1, 'b', 3));\n true\n",
3603
+ expr: 'expr1 in()',
3604
+ description: {
3605
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3606
+ value: ''
3607
+ }
3608
+ },
3609
+ {
3610
+ name: 'isnan(expr)',
3611
+ funcDesc: 'Returns true if `expr` is NaN, or false otherwise.',
3612
+ examples: "> SELECT isnan(cast('NaN' as double));\n true\n",
3613
+ expr: 'isnan()',
3614
+ description: {
3615
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3616
+ value: ''
3617
+ }
3618
+ },
3619
+ {
3620
+ name: 'isnotnull(expr)',
3621
+ funcDesc: 'Returns true if `expr` is not null, or false otherwise.',
3622
+ examples: '> SELECT isnotnull(1);\n true\n',
3623
+ expr: 'isnotnull()',
3624
+ description: {
3625
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3626
+ value: ''
3627
+ }
3628
+ },
3629
+ {
3630
+ name: 'isnull(expr)',
3631
+ funcDesc: 'Returns true if `expr` is null, or false otherwise.',
3632
+ examples: '> SELECT isnull(1);\n false\n',
3633
+ expr: 'isnull()',
3634
+ description: {
3635
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3636
+ value: ''
3637
+ }
3638
+ },
3639
+ {
3640
+ name: 'str like pattern[ ESCAPE escape]',
3641
+ funcDesc: 'Returns true if str matches `pattern` with `escape`, null if any arguments are null, false otherwise.',
3642
+ examples: "> SELECT like('Spark', '_park');\n true\n> SET spark.sql.parser.escapedStringLiterals=true;\n spark.sql.parser.escapedStringLiterals true\n> SELECT '%SystemDrive%\\Users\\John' like '\\%SystemDrive\\%\\\\Users%';\n true\n> SET spark.sql.parser.escapedStringLiterals=false;\n spark.sql.parser.escapedStringLiterals false\n> SELECT '%SystemDrive%\\\\Users\\\\John' like '\\%SystemDrive\\%\\\\\\\\Users%';\n true\n> SELECT '%SystemDrive%/Users/John' like '/%SystemDrive/%//Users%' ESCAPE '/';\n true\n",
3643
+ expr: 'str like pattern[ ESCAPE escape]',
3644
+ description: {
3645
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3646
+ value: ''
3647
+ }
3648
+ },
3649
+ {
3650
+ name: 'not expr',
3651
+ funcDesc: 'Logical not.',
3652
+ examples: '> SELECT not true;\n false\n> SELECT not false;\n true\n> SELECT not NULL;\n NULL\n',
3653
+ expr: 'not expr',
3654
+ description: {
3655
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3656
+ value: ''
3657
+ }
3658
+ },
3659
+ {
3660
+ name: 'expr1 or expr2',
3661
+ funcDesc: 'Logical OR.',
3662
+ examples: '> SELECT true or false;\n true\n> SELECT false or false;\n false\n> SELECT true or NULL;\n true\n> SELECT false or NULL;\n NULL\n',
3663
+ expr: 'expr1 or expr2',
3664
+ description: {
3665
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3666
+ value: ''
3667
+ }
3668
+ },
3669
+ {
3670
+ name: 'regexp(str, regexp)',
3671
+ funcDesc: 'Returns true if `str` matches `regexp`, or false otherwise.',
3672
+ examples: "> SET spark.sql.parser.escapedStringLiterals=true;\nspark.sql.parser.escapedStringLiterals true\n> SELECT regexp('%SystemDrive%\\Users\\John', '%SystemDrive%\\\\Users.*');\ntrue\n> SET spark.sql.parser.escapedStringLiterals=false;\nspark.sql.parser.escapedStringLiterals false\n> SELECT regexp('%SystemDrive%\\\\Users\\\\John', '%SystemDrive%\\\\\\\\Users.*');\ntrue\n",
3673
+ expr: 'regexp()',
3674
+ description: {
3675
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3676
+ value: ''
3677
+ }
3678
+ },
3679
+ {
3680
+ name: 'regexp_like(str, regexp)',
3681
+ funcDesc: 'Returns true if `str` matches `regexp`, or false otherwise.',
3682
+ examples: "> SET spark.sql.parser.escapedStringLiterals=true;\nspark.sql.parser.escapedStringLiterals true\n> SELECT regexp_like('%SystemDrive%\\Users\\John', '%SystemDrive%\\\\Users.*');\ntrue\n> SET spark.sql.parser.escapedStringLiterals=false;\nspark.sql.parser.escapedStringLiterals false\n> SELECT regexp_like('%SystemDrive%\\\\Users\\\\John', '%SystemDrive%\\\\\\\\Users.*');\ntrue\n",
3683
+ expr: 'regexp_like()',
3684
+ description: {
3685
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3686
+ value: ''
3687
+ }
3688
+ },
3689
+ {
3690
+ name: 'rlike(str, regexp)',
3691
+ funcDesc: 'Returns true if `str` matches `regexp`, or false otherwise.',
3692
+ examples: "> SET spark.sql.parser.escapedStringLiterals=true;\nspark.sql.parser.escapedStringLiterals true\n> SELECT rlike('%SystemDrive%\\Users\\John', '%SystemDrive%\\\\Users.*');\ntrue\n> SET spark.sql.parser.escapedStringLiterals=false;\nspark.sql.parser.escapedStringLiterals false\n> SELECT rlike('%SystemDrive%\\\\Users\\\\John', '%SystemDrive%\\\\\\\\Users.*');\ntrue\n",
3693
+ expr: 'rlike()',
3694
+ description: {
3695
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3696
+ value: ''
3697
+ }
3698
+ },
3699
+ {
3700
+ name: 'from_csv(csvStr, schema[, options])',
3701
+ funcDesc: 'Returns a struct value with the given `csvStr` and `schema`.',
3702
+ examples: "> SELECT from_csv('1, 0.8', 'a INT, b DOUBLE');\n {\"a\":1,\"b\":0.8}\n> SELECT from_csv('26/08/2015', 'time Timestamp', map('timestampFormat', 'dd/MM/yyyy'));\n {\"time\":2015-08-26 00:00:00}\n",
3703
+ expr: 'from_csv()',
3704
+ description: {
3705
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3706
+ value: ''
3707
+ }
3708
+ },
3709
+ {
3710
+ name: 'schema_of_csv(csv[, options])',
3711
+ funcDesc: 'Returns schema in the DDL format of CSV string.',
3712
+ examples: "> SELECT schema_of_csv('1,abc');\n STRUCT<_c0: INT, _c1: STRING>\n",
3713
+ expr: 'schema_of_csv()',
3714
+ description: {
3715
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3716
+ value: ''
3717
+ }
3718
+ },
3719
+ {
3720
+ name: 'to_csv(expr[, options])',
3721
+ funcDesc: 'Returns a CSV string with a given struct value',
3722
+ examples: "> SELECT to_csv(named_struct('a', 1, 'b', 2));\n 1,2\n> SELECT to_csv(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));\n 26/08/2015\n",
3723
+ expr: 'to_csv()',
3724
+ description: {
3725
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3726
+ value: ''
3727
+ }
3728
+ },
3729
+ {
3730
+ name: 'aes_decrypt(expr, key[, mode[, padding]])',
3731
+ funcDesc: "Returns a decrypted value of `expr` using AES in `mode` with `padding`. Key lengths of 16, 24 and 32 bits are supported. Supported combinations of (`mode`, `padding`) are ('ECB', 'PKCS') and ('GCM', 'NONE'). The default mode is GCM.",
3732
+ examples: "> SELECT aes_decrypt(unhex('83F16B2AA704794132802D248E6BFD4E380078182D1544813898AC97E709B28A94'), '0000111122223333');\n Spark\n> SELECT aes_decrypt(unhex('6E7CA17BBB468D3084B5744BCA729FB7B2B7BCB8E4472847D02670489D95FA97DBBA7D3210'), '0000111122223333', 'GCM');\n Spark SQL\n> SELECT aes_decrypt(unbase64('3lmwu+Mw0H3fi5NDvcu9lg=='), '1234567890abcdef', 'ECB', 'PKCS');\n Spark SQL\n",
3733
+ expr: 'aes_decrypt()',
3734
+ description: {
3735
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3736
+ value: ''
3737
+ }
3738
+ },
3739
+ {
3740
+ name: 'aes_encrypt(expr, key[, mode[, padding]])',
3741
+ funcDesc: "Returns an encrypted value of `expr` using AES in given `mode` with the specified `padding`. Key lengths of 16, 24 and 32 bits are supported. Supported combinations of (`mode`, `padding`) are ('ECB', 'PKCS') and ('GCM', 'NONE'). The default mode is GCM.",
3742
+ examples: "> SELECT hex(aes_encrypt('Spark', '0000111122223333'));\n 83F16B2AA704794132802D248E6BFD4E380078182D1544813898AC97E709B28A94\n> SELECT hex(aes_encrypt('Spark SQL', '0000111122223333', 'GCM'));\n 6E7CA17BBB468D3084B5744BCA729FB7B2B7BCB8E4472847D02670489D95FA97DBBA7D3210\n> SELECT base64(aes_encrypt('Spark SQL', '1234567890abcdef', 'ECB', 'PKCS'));\n 3lmwu+Mw0H3fi5NDvcu9lg==\n",
3743
+ expr: 'aes_encrypt()',
3744
+ description: {
3745
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3746
+ value: ''
3747
+ }
3748
+ },
3749
+ {
3750
+ name: 'assert_true(expr)',
3751
+ funcDesc: 'Throws an exception if `expr` is not true.',
3752
+ examples: '> SELECT assert_true(0 < 1);\n NULL\n',
3753
+ expr: 'assert_true()',
3754
+ description: {
3755
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3756
+ value: ''
3757
+ }
3758
+ },
3759
+ {
3760
+ name: 'current_catalog()',
3761
+ funcDesc: 'Returns the current catalog.',
3762
+ examples: '> SELECT current_catalog();\n spark_catalog\n',
3763
+ expr: 'current_catalog()',
3764
+ description: {
3765
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3766
+ value: ''
3767
+ }
3768
+ },
3769
+ {
3770
+ name: 'current_database()',
3771
+ funcDesc: 'Returns the current database.',
3772
+ examples: '> SELECT current_database();\n default\n',
3773
+ expr: 'current_database()',
3774
+ description: {
3775
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3776
+ value: ''
3777
+ }
3778
+ },
3779
+ {
3780
+ name: 'current_schema()',
3781
+ funcDesc: 'Returns the current database.',
3782
+ examples: '> SELECT current_schema();\n default\n',
3783
+ expr: 'current_schema()',
3784
+ description: {
3785
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3786
+ value: ''
3787
+ }
3788
+ },
3789
+ {
3790
+ name: 'current_user()',
3791
+ funcDesc: 'user name of current execution context.',
3792
+ examples: '> SELECT current_user();\n mockingjay\n',
3793
+ expr: 'current_user()',
3794
+ description: {
3795
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3796
+ value: ''
3797
+ }
3798
+ },
3799
+ {
3800
+ name: 'equal_null(expr1, expr2)',
3801
+ funcDesc: 'Returns same result as the EQUAL(=) operator for non-null operands, but returns true if both are null, false if one of the them is null.',
3802
+ examples: "> SELECT equal_null(3, 3);\n true\n> SELECT equal_null(1, '11');\n false\n> SELECT equal_null(true, NULL);\n false\n> SELECT equal_null(NULL, 'abc');\n false\n> SELECT equal_null(NULL, NULL);\n true\n",
3803
+ expr: 'equal_null()',
3804
+ description: {
3805
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3806
+ value: ''
3807
+ }
3808
+ },
3809
+ {
3810
+ name: 'input_file_block_length()',
3811
+ funcDesc: 'Returns the length of the block being read, or -1 if not available.',
3812
+ examples: '> SELECT input_file_block_length();\n -1\n',
3813
+ expr: 'input_file_block_length()',
3814
+ description: {
3815
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3816
+ value: ''
3817
+ }
3818
+ },
3819
+ {
3820
+ name: 'input_file_block_start()',
3821
+ funcDesc: 'Returns the start offset of the block being read, or -1 if not available.',
3822
+ examples: '> SELECT input_file_block_start();\n -1\n',
3823
+ expr: 'input_file_block_start()',
3824
+ description: {
3825
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3826
+ value: ''
3827
+ }
3828
+ },
3829
+ {
3830
+ name: 'input_file_name()',
3831
+ funcDesc: 'Returns the name of the file being read, or empty string if not available.',
3832
+ examples: '> SELECT input_file_name();\n',
3833
+ expr: 'input_file_name()',
3834
+ description: {
3835
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3836
+ value: ''
3837
+ }
3838
+ },
3839
+ {
3840
+ name: 'java_method(class, method[, arg1[, arg2 ..]])',
3841
+ funcDesc: 'Calls a method with reflection.',
3842
+ examples: "> SELECT java_method('java.util.UUID', 'randomUUID');\n c33fb387-8500-4bfa-81d2-6e0e3e930df2\n> SELECT java_method('java.util.UUID', 'fromString', 'a5cf6c42-0c85-418f-af6c-3e4e5b1328f2');\n a5cf6c42-0c85-418f-af6c-3e4e5b1328f2\n",
3843
+ expr: 'java_method()',
3844
+ description: {
3845
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3846
+ value: ''
3847
+ }
3848
+ },
3849
+ {
3850
+ name: 'monotonically_increasing_id()',
3851
+ funcDesc: 'Returns monotonically increasing 64-bit integers. The generated ID is guaranteed to be monotonically increasing and unique, but not consecutive. The current implementation puts the partition ID in the upper 31 bits, and the lower 33 bits represent the record number within each partition. The assumption is that the data frame has less than 1 billion partitions, and each partition has less than 8 billion records. The function is non-deterministic because its result depends on partition IDs.',
3852
+ examples: '> SELECT monotonically_increasing_id();\n 0\n',
3853
+ expr: 'monotonically_increasing_id()',
3854
+ description: {
3855
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3856
+ value: ''
3857
+ }
3858
+ },
3859
+ {
3860
+ name: 'reflect(class, method[, arg1[, arg2 ..]])',
3861
+ funcDesc: 'Calls a method with reflection.',
3862
+ examples: "> SELECT reflect('java.util.UUID', 'randomUUID');\n c33fb387-8500-4bfa-81d2-6e0e3e930df2\n> SELECT reflect('java.util.UUID', 'fromString', 'a5cf6c42-0c85-418f-af6c-3e4e5b1328f2');\n a5cf6c42-0c85-418f-af6c-3e4e5b1328f2\n",
3863
+ expr: 'reflect()',
3864
+ description: {
3865
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3866
+ value: ''
3867
+ }
3868
+ },
3869
+ {
3870
+ name: 'spark_partition_id()',
3871
+ funcDesc: 'Returns the current partition id.',
3872
+ examples: '> SELECT spark_partition_id();\n 0\n',
3873
+ expr: 'spark_partition_id()',
3874
+ description: {
3875
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3876
+ value: ''
3877
+ }
3878
+ },
3879
+ {
3880
+ name: 'typeof(expr)',
3881
+ funcDesc: 'Return DDL-formatted type string for the data type of the input.',
3882
+ examples: '> SELECT typeof(1);\n int\n> SELECT typeof(array(1));\n array<int>\n',
3883
+ expr: 'typeof()',
3884
+ description: {
3885
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3886
+ value: ''
3887
+ }
3888
+ },
3889
+ {
3890
+ name: 'user()',
3891
+ funcDesc: 'user name of current execution context.',
3892
+ examples: '> SELECT user();\n mockingjay\n',
3893
+ expr: 'user()',
3894
+ description: {
3895
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3896
+ value: ''
3897
+ }
3898
+ },
3899
+ {
3900
+ name: 'uuid()',
3901
+ funcDesc: 'Returns an universally unique identifier (UUID) string. The value is returned as a canonical UUID 36-character string.',
3902
+ examples: '> SELECT uuid();\n 46707d92-02f4-4817-8116-a4c3b23e6266\n',
3903
+ expr: 'uuid()',
3904
+ description: {
3905
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3906
+ value: ''
3907
+ }
3908
+ },
3909
+ {
3910
+ name: 'version()',
3911
+ funcDesc: 'Returns the Spark version. The string contains 2 fields, the first being a release version and the second being a git revision.',
3912
+ examples: '> SELECT version();\n 3.1.0 a6d6ea3efedbad14d99c24143834cd4e2e52fb40\n',
3913
+ expr: 'version()',
3914
+ description: {
3915
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3916
+ value: ''
3917
+ }
3918
+ },
3919
+ {
3920
+ name: 'explode(expr)',
3921
+ funcDesc: 'Separates the elements of array `expr` into multiple rows, or the elements of map `expr` into multiple rows and columns. Unless specified otherwise, uses the default column name `col` for elements of the array or `key` and `value` for the elements of the map.',
3922
+ examples: '> SELECT explode(array(10, 20));\n 10\n 20\n',
3923
+ expr: 'explode()',
3924
+ description: {
3925
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3926
+ value: ''
3927
+ }
3928
+ },
3929
+ {
3930
+ name: 'explode_outer(expr)',
3931
+ funcDesc: 'Separates the elements of array `expr` into multiple rows, or the elements of map `expr` into multiple rows and columns. Unless specified otherwise, uses the default column name `col` for elements of the array or `key` and `value` for the elements of the map.',
3932
+ examples: '> SELECT explode_outer(array(10, 20));\n 10\n 20\n',
3933
+ expr: 'explode_outer()',
3934
+ description: {
3935
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3936
+ value: ''
3937
+ }
3938
+ },
3939
+ {
3940
+ name: 'inline(expr)',
3941
+ funcDesc: 'Explodes an array of structs into a table. Uses column names col1, col2, etc. by default unless specified otherwise.',
3942
+ examples: "> SELECT inline(array(struct(1, 'a'), struct(2, 'b')));\n 1 a\n 2 b\n",
3943
+ expr: 'inline()',
3944
+ description: {
3945
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3946
+ value: ''
3947
+ }
3948
+ },
3949
+ {
3950
+ name: 'inline_outer(expr)',
3951
+ funcDesc: 'Explodes an array of structs into a table. Uses column names col1, col2, etc. by default unless specified otherwise.',
3952
+ examples: "> SELECT inline_outer(array(struct(1, 'a'), struct(2, 'b')));\n 1 a\n 2 b\n",
3953
+ expr: 'inline_outer()',
3954
+ description: {
3955
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3956
+ value: ''
3957
+ }
3958
+ },
3959
+ {
3960
+ name: 'posexplode(expr)',
3961
+ funcDesc: 'Separates the elements of array `expr` into multiple rows with positions, or the elements of map `expr` into multiple rows and columns with positions. Unless specified otherwise, uses the column name `pos` for position, `col` for elements of the array or `key` and `value` for elements of the map.',
3962
+ examples: '> SELECT posexplode(array(10,20));\n 0 10\n 1 20\n',
3963
+ expr: 'posexplode()',
3964
+ description: {
3965
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3966
+ value: ''
3967
+ }
3968
+ },
3969
+ {
3970
+ name: 'posexplode_outer(expr)',
3971
+ funcDesc: 'Separates the elements of array `expr` into multiple rows with positions, or the elements of map `expr` into multiple rows and columns with positions. Unless specified otherwise, uses the column name `pos` for position, `col` for elements of the array or `key` and `value` for elements of the map.',
3972
+ examples: '> SELECT posexplode_outer(array(10,20));\n 0 10\n 1 20\n',
3973
+ expr: 'posexplode_outer()',
3974
+ description: {
3975
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3976
+ value: ''
3977
+ }
3978
+ },
3979
+ {
3980
+ name: 'stack(n, expr1, ..., exprk)',
3981
+ funcDesc: 'Separates `expr1`, ..., `exprk` into `n` rows. Uses column names col0, col1, etc. by default unless specified otherwise.',
3982
+ examples: '> SELECT stack(2, 1, 2, 3);\n 1 2\n 3 NULL\n',
3983
+ expr: 'stack()',
3984
+ description: {
3985
+ kind: vscode_languageserver_types_1.MarkupKind.Markdown,
3986
+ value: ''
3987
+ }
3988
+ }
3989
+ ].map(func => ({
3990
+ ...func,
3991
+ description: {
3992
+ kind: func.description.kind,
3993
+ value: generateDescription(func)
3994
+ }
3995
+ }));
3996
+ //# sourceMappingURL=built-in-functions.js.map