@malloydata/malloy 0.0.22-dev230126015148 → 0.0.22-dev230206094309

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 (93) hide show
  1. package/package.json +2 -2
  2. package/dist/connection_utils.d.ts +0 -1
  3. package/dist/connection_utils.js +0 -66
  4. package/dist/dialect/dialect.d.ts +0 -66
  5. package/dist/dialect/dialect.js +0 -85
  6. package/dist/dialect/dialect_map.d.ts +0 -3
  7. package/dist/dialect/dialect_map.js +0 -45
  8. package/dist/dialect/duckdb.d.ts +0 -52
  9. package/dist/dialect/duckdb.js +0 -364
  10. package/dist/dialect/index.d.ts +0 -6
  11. package/dist/dialect/index.js +0 -37
  12. package/dist/dialect/postgres.d.ts +0 -52
  13. package/dist/dialect/postgres.js +0 -330
  14. package/dist/dialect/standardsql.d.ts +0 -49
  15. package/dist/dialect/standardsql.js +0 -381
  16. package/dist/index.d.ts +0 -10
  17. package/dist/index.js +0 -59
  18. package/dist/lang/ast/apply-expr.d.ts +0 -3
  19. package/dist/lang/ast/apply-expr.js +0 -34
  20. package/dist/lang/ast/ast-expr.d.ts +0 -206
  21. package/dist/lang/ast/ast-expr.js +0 -781
  22. package/dist/lang/ast/ast-main.d.ts +0 -915
  23. package/dist/lang/ast/ast-main.js +0 -3672
  24. package/dist/lang/ast/ast-time-expr.d.ts +0 -69
  25. package/dist/lang/ast/ast-time-expr.js +0 -389
  26. package/dist/lang/ast/ast-types.d.ts +0 -83
  27. package/dist/lang/ast/ast-types.js +0 -225
  28. package/dist/lang/ast/index.d.ts +0 -5
  29. package/dist/lang/ast/index.js +0 -44
  30. package/dist/lang/ast/time-utils.d.ts +0 -9
  31. package/dist/lang/ast/time-utils.js +0 -104
  32. package/dist/lang/field-utils.d.ts +0 -5
  33. package/dist/lang/field-utils.js +0 -43
  34. package/dist/lang/index.d.ts +0 -9
  35. package/dist/lang/index.js +0 -32
  36. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +0 -165
  37. package/dist/lang/lib/Malloy/MalloyLexer.js +0 -1232
  38. package/dist/lang/lib/Malloy/MalloyParser.d.ts +0 -1947
  39. package/dist/lang/lib/Malloy/MalloyParser.js +0 -11909
  40. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -2022
  41. package/dist/lang/lib/Malloy/MalloyParserListener.js +0 -4
  42. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -1274
  43. package/dist/lang/lib/Malloy/MalloyParserVisitor.js +0 -4
  44. package/dist/lang/parse-log.d.ts +0 -27
  45. package/dist/lang/parse-log.js +0 -51
  46. package/dist/lang/parse-malloy.d.ts +0 -236
  47. package/dist/lang/parse-malloy.js +0 -746
  48. package/dist/lang/parse-to-ast.d.ts +0 -155
  49. package/dist/lang/parse-to-ast.js +0 -990
  50. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +0 -10
  51. package/dist/lang/parse-tree-walkers/document-completion-walker.js +0 -148
  52. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +0 -9
  53. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +0 -107
  54. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +0 -83
  55. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +0 -385
  56. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +0 -11
  57. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -182
  58. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +0 -34
  59. package/dist/lang/parse-tree-walkers/explore-query-walker.js +0 -74
  60. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +0 -11
  61. package/dist/lang/parse-tree-walkers/find-external-references.js +0 -61
  62. package/dist/lang/reference-list.d.ts +0 -10
  63. package/dist/lang/reference-list.js +0 -90
  64. package/dist/lang/space-field.d.ts +0 -17
  65. package/dist/lang/space-field.js +0 -127
  66. package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
  67. package/dist/lang/test/document-help-context-walker.spec.js +0 -55
  68. package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
  69. package/dist/lang/test/document-symbol-walker.spec.js +0 -110
  70. package/dist/lang/test/field-symbols.spec.d.ts +0 -1
  71. package/dist/lang/test/field-symbols.spec.js +0 -180
  72. package/dist/lang/test/parse.spec.d.ts +0 -14
  73. package/dist/lang/test/parse.spec.js +0 -2134
  74. package/dist/lang/test/test-translator.d.ts +0 -38
  75. package/dist/lang/test/test-translator.js +0 -344
  76. package/dist/lang/zone.d.ts +0 -57
  77. package/dist/lang/zone.js +0 -107
  78. package/dist/malloy.d.ts +0 -1146
  79. package/dist/malloy.js +0 -2413
  80. package/dist/model/index.d.ts +0 -2
  81. package/dist/model/index.js +0 -45
  82. package/dist/model/malloy_query.d.ts +0 -351
  83. package/dist/model/malloy_query.js +0 -3174
  84. package/dist/model/malloy_types.d.ts +0 -551
  85. package/dist/model/malloy_types.js +0 -378
  86. package/dist/model/sql_block.d.ts +0 -7
  87. package/dist/model/sql_block.js +0 -56
  88. package/dist/model/utils.d.ts +0 -22
  89. package/dist/model/utils.js +0 -102
  90. package/dist/run_sql_options.d.ts +0 -3
  91. package/dist/run_sql_options.js +0 -25
  92. package/dist/runtime_types.d.ts +0 -105
  93. package/dist/runtime_types.js +0 -25
@@ -1,330 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.PostgresDialect = void 0;
26
- const utils_1 = require("../model/utils");
27
- const malloy_types_1 = require("../model/malloy_types");
28
- const dialect_1 = require("./dialect");
29
- const castMap = {
30
- number: "double precision",
31
- string: "varchar",
32
- };
33
- const pgExtractionMap = {
34
- day_of_week: "dow",
35
- day_of_year: "doy",
36
- };
37
- const pgMakeIntervalMap = {
38
- year: "years",
39
- month: "months",
40
- week: "weeks",
41
- day: "days",
42
- hour: "hours",
43
- minute: "mins",
44
- second: "secs",
45
- };
46
- const inSeconds = {
47
- second: 1,
48
- minute: 60,
49
- hour: 3600,
50
- };
51
- class PostgresDialect extends dialect_1.Dialect {
52
- constructor() {
53
- super(...arguments);
54
- this.name = "postgres";
55
- this.defaultNumberType = "DOUBLE PRECISION";
56
- this.udfPrefix = "pg_temp.__udf";
57
- this.hasFinalStage = true;
58
- this.stringTypeName = "VARCHAR";
59
- this.divisionIsInteger = true;
60
- this.supportsSumDistinctFunction = false;
61
- this.unnestWithNumbers = false;
62
- this.defaultSampling = { rows: 50000 };
63
- this.supportUnnestArrayAgg = true;
64
- this.supportsCTEinCoorelatedSubQueries = true;
65
- this.dontUnionIndex = false;
66
- this.supportsQualify = false;
67
- this.functionInfo = {
68
- concat: { returnType: "string" },
69
- };
70
- }
71
- quoteTablePath(tablePath) {
72
- return tablePath
73
- .split(".")
74
- .map((part) => `"${part}"`)
75
- .join(".");
76
- }
77
- sqlGroupSetTable(groupSetCount) {
78
- return `CROSS JOIN GENERATE_SERIES(0,${groupSetCount},1) as group_set`;
79
- }
80
- sqlAnyValue(groupSet, fieldName) {
81
- return `MAX(${fieldName})`;
82
- }
83
- mapFields(fieldList) {
84
- return fieldList
85
- .map((f) => `\n ${f.sqlExpression}${f.type == "number" ? `::${this.defaultNumberType}` : ""} as ${f.sqlOutputName}`
86
- //`${f.sqlExpression} ${f.type} as ${f.sqlOutputName}`
87
- )
88
- .join(", ");
89
- }
90
- sqlAggregateTurtle(groupSet, fieldList, orderBy, limit) {
91
- let tail = "";
92
- if (limit !== undefined) {
93
- tail += `[1:${limit}]`;
94
- }
95
- const fields = this.mapFields(fieldList);
96
- // return `(ARRAY_AGG((SELECT __x FROM (SELECT ${fields}) as __x) ${orderBy} ) FILTER (WHERE group_set=${groupSet}))${tail}`;
97
- return `COALESCE(TO_JSONB((ARRAY_AGG((SELECT TO_JSONB(__x) FROM (SELECT ${fields}\n ) as __x) ${orderBy} ) FILTER (WHERE group_set=${groupSet}))${tail}),'[]'::JSONB)`;
98
- }
99
- sqlAnyValueTurtle(groupSet, fieldList) {
100
- const fields = fieldList
101
- .map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
102
- .join(", ");
103
- return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}))`;
104
- }
105
- sqlAnyValueLastTurtle(name, groupSet, sqlName) {
106
- return `(ARRAY_AGG(${name}__${groupSet}) FILTER (WHERE group_set=${groupSet} AND ${name}__${groupSet} IS NOT NULL))[1] as ${sqlName}`;
107
- }
108
- sqlCoaleseMeasuresInline(groupSet, fieldList) {
109
- const fields = this.mapFields(fieldList);
110
- return `TO_JSONB((ARRAY_AGG((SELECT __x FROM (SELECT ${fields}) as __x)) FILTER (WHERE group_set=${groupSet}))[1])`;
111
- }
112
- // UNNEST((select ARRAY((SELECT ROW(gen_random_uuid()::text, state, airport_count) FROM UNNEST(base.by_state) as by_state(state text, airport_count numeric, by_fac_type record[]))))) as by_state(__distinct_key text, state text, airport_count numeric)
113
- // sqlUnnestAlias(
114
- // source: string,
115
- // alias: string,
116
- // fieldList: DialectFieldList,
117
- // needDistinctKey: boolean
118
- // ): string {
119
- // const fields = [];
120
- // for (const f of fieldList) {
121
- // let t = undefined;
122
- // switch (f.type) {
123
- // case "string":
124
- // t = "text";
125
- // break;
126
- // case "number":
127
- // t = this.defaultNumberType;
128
- // break;
129
- // case "struct":
130
- // t = "record[]";
131
- // break;
132
- // }
133
- // fields.push(`${f.sqlOutputName} ${t || f.type}`);
134
- // }
135
- // if (needDistinctKey) {
136
- // return `UNNEST((select ARRAY((SELECT ROW(gen_random_uuid()::text, ${fieldList
137
- // .map((f) => f.sqlOutputName)
138
- // .join(", ")}) FROM UNNEST(${source}) as ${alias}(${fields.join(
139
- // ", "
140
- // )}))))) as ${alias}(__distinct_key text, ${fields.join(", ")})`;
141
- // } else {
142
- // return `UNNEST(${source}) as ${alias}(${fields.join(", ")})`;
143
- // }
144
- // }
145
- sqlUnnestAlias(source, alias, fieldList, needDistinctKey, isArray) {
146
- if (isArray) {
147
- if (needDistinctKey) {
148
- return `LEFT JOIN UNNEST(ARRAY((SELECT jsonb_build_object('__row_id', row_number() over (), 'value', v) FROM UNNEST(${source}) as v))) as ${alias} ON true`;
149
- }
150
- else {
151
- return `LEFT JOIN UNNEST(ARRAY((SELECT jsonb_build_object('value', v) FROM UNNEST(${source}) as v))) as ${alias} ON true`;
152
- }
153
- }
154
- else if (needDistinctKey) {
155
- // return `UNNEST(ARRAY(( SELECT AS STRUCT GENERATE_UUID() as __distinct_key, * FROM UNNEST(${source})))) as ${alias}`;
156
- return `LEFT JOIN UNNEST(ARRAY((SELECT jsonb_build_object('__row_number', row_number() over())|| __xx::jsonb as b FROM JSONB_ARRAY_ELEMENTS(${source}) __xx ))) as ${alias} ON true`;
157
- }
158
- else {
159
- // return `CROSS JOIN LATERAL JSONB_ARRAY_ELEMENTS(${source}) as ${alias}`;
160
- return `LEFT JOIN JSONB_ARRAY_ELEMENTS(${source}) as ${alias} ON true`;
161
- }
162
- }
163
- sqlSumDistinctHashedKey(sqlDistinctKey) {
164
- return `('x' || MD5(${sqlDistinctKey}::varchar))::bit(64)::bigint::DECIMAL(65,0) *18446744073709551616 + ('x' || SUBSTR(MD5(${sqlDistinctKey}::varchar),17))::bit(64)::bigint::DECIMAL(65,0)`;
165
- }
166
- sqlGenerateUUID() {
167
- return `GEN_RANDOM_UUID()`;
168
- }
169
- sqlFieldReference(alias, fieldName, fieldType, isNested, _isArray) {
170
- let ret = `${alias}->>'${fieldName}'`;
171
- if (isNested) {
172
- switch (fieldType) {
173
- case "string":
174
- break;
175
- case "number":
176
- ret = `(${ret})::double precision`;
177
- break;
178
- case "struct":
179
- ret = `(${ret})::jsonb`;
180
- break;
181
- }
182
- return ret;
183
- }
184
- else {
185
- return `${alias}."${fieldName}"`;
186
- }
187
- }
188
- sqlUnnestPipelineHead(isSingleton, sourceSQLExpression) {
189
- if (isSingleton) {
190
- return `UNNEST(ARRAY((SELECT ${sourceSQLExpression})))`;
191
- }
192
- else {
193
- return `JSONB_ARRAY_ELEMENTS(${sourceSQLExpression})`;
194
- }
195
- }
196
- sqlCreateFunction(id, funcText) {
197
- return `CREATE FUNCTION ${id}(JSONB) RETURNS JSONB AS $$\n${(0, utils_1.indent)(funcText)}\n$$ LANGUAGE SQL;\n`;
198
- }
199
- sqlCreateFunctionCombineLastStage(lastStageName) {
200
- return `SELECT JSONB_AGG(__stage0) FROM ${lastStageName}\n`;
201
- }
202
- sqlFinalStage(lastStageName, _fields) {
203
- return `SELECT row_to_json(finalStage) as row FROM ${lastStageName} AS finalStage`;
204
- }
205
- sqlSelectAliasAsStruct(alias) {
206
- return `ROW(${alias})`;
207
- }
208
- // TODO
209
- sqlMaybeQuoteIdentifier(identifier) {
210
- return `"${identifier}"`;
211
- }
212
- // The simple way to do this is to add a comment on the table
213
- // with the expiration time. https://www.postgresql.org/docs/current/sql-comment.html
214
- // and have a reaper that read comments.
215
- sqlCreateTableAsSelect(_tableName, _sql) {
216
- throw new Error("Not implemented Yet");
217
- }
218
- sqlNow() {
219
- return (0, malloy_types_1.mkExpr) `CURRENT_TIMESTAMP`;
220
- }
221
- sqlTrunc(sqlTime, units) {
222
- // adjusting for monday/sunday weeks
223
- const week = units == "week";
224
- const truncThis = week
225
- ? (0, malloy_types_1.mkExpr) `${sqlTime.value}+interval'1'day`
226
- : sqlTime.value;
227
- const trunced = (0, malloy_types_1.mkExpr) `DATE_TRUNC('${units}', ${truncThis})`;
228
- return week ? (0, malloy_types_1.mkExpr) `(${trunced}-interval'1'day)` : trunced;
229
- }
230
- sqlExtract(from, units) {
231
- const pgUnits = pgExtractionMap[units] || units;
232
- const extracted = (0, malloy_types_1.mkExpr) `EXTRACT(${pgUnits} FROM ${from.value})`;
233
- return units == "day_of_week" ? (0, malloy_types_1.mkExpr) `(${extracted}+1)` : extracted;
234
- }
235
- sqlAlterTime(op, expr, n, timeframe) {
236
- if (timeframe == "quarter") {
237
- timeframe = "month";
238
- n = (0, malloy_types_1.mkExpr) `${n}*3`;
239
- }
240
- const interval = (0, malloy_types_1.mkExpr) `make_interval(${pgMakeIntervalMap[timeframe]}=>${n})`;
241
- return (0, malloy_types_1.mkExpr) `((${expr.value})${op}${interval})`;
242
- }
243
- sqlCast(cast) {
244
- if (cast.dstType !== cast.srcType) {
245
- const castTo = castMap[cast.dstType] || cast.dstType;
246
- return (0, malloy_types_1.mkExpr) `cast(${cast.expr} as ${castTo})`;
247
- }
248
- return cast.expr;
249
- }
250
- sqlRegexpMatch(expr, regexp) {
251
- return (0, malloy_types_1.mkExpr) `(${expr} ~ ${regexp})`;
252
- }
253
- sqlLiteralTime(timeString, type, _timezone) {
254
- if (type == "date") {
255
- return `DATE('${timeString}')`;
256
- }
257
- else if (type == "timestamp") {
258
- return `TIMESTAMP '${timeString}'`;
259
- }
260
- else {
261
- throw new Error(`Unknown Literal time format ${type}`);
262
- }
263
- }
264
- getFunctionInfo(functionName) {
265
- return this.functionInfo[functionName];
266
- }
267
- sqlMeasureTime(from, to, units) {
268
- let lVal = from.value;
269
- let rVal = to.value;
270
- if (inSeconds[units]) {
271
- lVal = (0, malloy_types_1.mkExpr) `EXTRACT(EPOCH FROM ${lVal})`;
272
- rVal = (0, malloy_types_1.mkExpr) `EXTRACT(EPOCH FROM ${rVal})`;
273
- const duration = (0, malloy_types_1.mkExpr) `(${rVal} - ${lVal})`;
274
- return units == "second"
275
- ? duration
276
- : (0, malloy_types_1.mkExpr) `TRUNC(${duration}/${inSeconds[units].toString()})`;
277
- }
278
- if (units === "day") {
279
- return (0, malloy_types_1.mkExpr) `${rVal}::date - ${lVal}::date`;
280
- }
281
- const yearDiff = (0, malloy_types_1.mkExpr) `(DATE_PART('year', ${rVal}) - DATE_PART('year', ${lVal}))`;
282
- if (units == "year") {
283
- return yearDiff;
284
- }
285
- if (units == "week") {
286
- const dayDiffForWeekStart = (0, malloy_types_1.mkExpr) `(DATE_TRUNC('week', ${rVal} + '1 day'::interval)::date - DATE_TRUNC('week', ${lVal} + '1 day'::interval)::date)`;
287
- return (0, malloy_types_1.mkExpr) `${dayDiffForWeekStart} / 7`;
288
- }
289
- if (units == "month") {
290
- const monthDiff = (0, malloy_types_1.mkExpr) `DATE_PART('month', ${rVal}) - DATE_PART('month', ${lVal})`;
291
- return (0, malloy_types_1.mkExpr) `${yearDiff} * 12 + ${monthDiff}`;
292
- }
293
- if (units == "quarter") {
294
- const qDiff = (0, malloy_types_1.mkExpr) `DATE_PART('quarter', ${rVal}) - DATE_PART('quarter', ${lVal})`;
295
- return (0, malloy_types_1.mkExpr) `${yearDiff} * 4 + ${qDiff}`;
296
- }
297
- throw new Error(`Unknown or unhandled postgres time unit: ${units}`);
298
- }
299
- sqlSumDistinct(key, value) {
300
- // return `sum_distinct(list({key:${key}, val: ${value}}))`;
301
- return `(
302
- SELECT sum((a::json->>'f2')::DOUBLE PRECISION) as value
303
- FROM (
304
- SELECT UNNEST(array_agg(distinct row_to_json(row(${key},${value}))::text)) a
305
- ) a
306
- )`;
307
- }
308
- sqlSampleTable(tableSQL, sample) {
309
- if (sample !== undefined) {
310
- if ((0, malloy_types_1.isSamplingEnable)(sample) && sample.enable) {
311
- sample = this.defaultSampling;
312
- }
313
- if ((0, malloy_types_1.isSamplingRows)(sample)) {
314
- return `(SELECT * FROM ${tableSQL} TABLESAMPLE SYSTEM_ROWS(${sample.rows}))`;
315
- }
316
- else if ((0, malloy_types_1.isSamplingPercent)(sample)) {
317
- return `(SELECT * FROM ${tableSQL} TABLESAMPLE SYSTEM (${sample.percent}))`;
318
- }
319
- }
320
- return tableSQL;
321
- }
322
- sqlOrderBy(orderTerms) {
323
- return `ORDER BY ${orderTerms.map((t) => `${t} NULLS LAST`).join(",")}`;
324
- }
325
- sqlLiteralString(literal) {
326
- return "'" + literal.replace(/'/g, "''") + "'";
327
- }
328
- }
329
- exports.PostgresDialect = PostgresDialect;
330
- //# sourceMappingURL=postgres.js.map
@@ -1,49 +0,0 @@
1
- import { TimestampUnit, ExtractUnit, Expr, TimeValue, TypecastFragment, Sampling } from "../model/malloy_types";
2
- import { Dialect, DialectFieldList, FunctionInfo } from "./dialect";
3
- export declare class StandardSQLDialect extends Dialect {
4
- name: string;
5
- defaultNumberType: string;
6
- udfPrefix: string;
7
- hasFinalStage: boolean;
8
- stringTypeName: string;
9
- divisionIsInteger: boolean;
10
- supportsSumDistinctFunction: boolean;
11
- unnestWithNumbers: boolean;
12
- defaultSampling: {
13
- enable: boolean;
14
- };
15
- supportUnnestArrayAgg: boolean;
16
- supportsCTEinCoorelatedSubQueries: boolean;
17
- dontUnionIndex: boolean;
18
- supportsQualify: boolean;
19
- functionInfo: Record<string, FunctionInfo>;
20
- quoteTablePath(tablePath: string): string;
21
- sqlGroupSetTable(groupSetCount: number): string;
22
- sqlAnyValue(groupSet: number, fieldName: string): string;
23
- sqlAggregateTurtle(groupSet: number, fieldList: DialectFieldList, orderBy: string | undefined, limit: number | undefined): string;
24
- sqlAnyValueTurtle(groupSet: number, fieldList: DialectFieldList): string;
25
- sqlAnyValueLastTurtle(name: string, groupSet: number, sqlName: string): string;
26
- sqlCoaleseMeasuresInline(groupSet: number, fieldList: DialectFieldList): string;
27
- sqlUnnestAlias(source: string, alias: string, fieldList: DialectFieldList, needDistinctKey: boolean, isArray: boolean): string;
28
- sqlSumDistinctHashedKey(sqlDistinctKey: string): string;
29
- sqlGenerateUUID(): string;
30
- sqlFieldReference(alias: string, fieldName: string, _fieldType: string, _isNested: boolean, _isArray: boolean): string;
31
- sqlUnnestPipelineHead(isSingleton: boolean, sourceSQLExpression: string): string;
32
- sqlCreateFunction(id: string, funcText: string): string;
33
- sqlCreateTableAsSelect(tableName: string, sql: string): string;
34
- sqlCreateFunctionCombineLastStage(lastStageName: string): string;
35
- sqlSelectAliasAsStruct(alias: string): string;
36
- keywords: string[];
37
- sqlMaybeQuoteIdentifier(identifier: string): string;
38
- sqlNow(): Expr;
39
- sqlTrunc(sqlTime: TimeValue, units: TimestampUnit): Expr;
40
- sqlExtract(expr: TimeValue, units: ExtractUnit): Expr;
41
- sqlAlterTime(op: "+" | "-", expr: TimeValue, n: Expr, timeframe: TimestampUnit): Expr;
42
- ignoreInProject(fieldName: string): boolean;
43
- sqlCast(cast: TypecastFragment): Expr;
44
- sqlRegexpMatch(expr: Expr, regexp: string): Expr;
45
- sqlLiteralTime(timeString: string, type: "date" | "timestamp", timezone: string): string;
46
- sqlMeasureTime(from: TimeValue, to: TimeValue, units: string): Expr;
47
- sqlSampleTable(tableSQL: string, sample: Sampling | undefined): string;
48
- sqlLiteralString(literal: string): string;
49
- }