@malloydata/malloy 0.0.182-dev240911155850 → 0.0.182-dev240912152159
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.
- package/dist/dialect/dialect.d.ts +3 -1
- package/dist/dialect/dialect_map.d.ts +1 -2
- package/dist/dialect/dialect_map.js +5 -74
- package/dist/dialect/duckdb/dialect_functions.d.ts +2 -0
- package/dist/dialect/duckdb/dialect_functions.js +67 -0
- package/dist/dialect/duckdb/duckdb.d.ts +3 -1
- package/dist/dialect/duckdb/duckdb.js +6 -5
- package/dist/dialect/duckdb/function_overrides.d.ts +2 -0
- package/dist/dialect/duckdb/function_overrides.js +55 -0
- package/dist/dialect/functions/index.d.ts +3 -1
- package/dist/dialect/functions/index.js +6 -3
- package/dist/dialect/functions/malloy_standard_functions.d.ts +134 -0
- package/dist/dialect/functions/malloy_standard_functions.js +612 -0
- package/dist/dialect/functions/util.d.ts +78 -2
- package/dist/dialect/functions/util.js +257 -3
- package/dist/dialect/index.d.ts +5 -4
- package/dist/dialect/index.js +3 -4
- package/dist/dialect/postgres/dialect_functions.d.ts +2 -0
- package/dist/dialect/postgres/dialect_functions.js +51 -0
- package/dist/dialect/postgres/function_overrides.d.ts +2 -0
- package/dist/dialect/postgres/function_overrides.js +73 -0
- package/dist/dialect/postgres/postgres.d.ts +3 -2
- package/dist/dialect/postgres/postgres.js +6 -6
- package/dist/dialect/snowflake/dialect_functions.d.ts +2 -0
- package/dist/dialect/snowflake/dialect_functions.js +57 -0
- package/dist/dialect/snowflake/function_overrides.d.ts +2 -0
- package/dist/dialect/snowflake/function_overrides.js +39 -0
- package/dist/dialect/snowflake/snowflake.d.ts +3 -2
- package/dist/dialect/snowflake/snowflake.js +6 -6
- package/dist/dialect/standardsql/dialect_functions.d.ts +2 -0
- package/dist/dialect/standardsql/dialect_functions.js +65 -0
- package/dist/dialect/standardsql/function_overrides.d.ts +2 -0
- package/dist/dialect/standardsql/function_overrides.js +17 -0
- package/dist/dialect/standardsql/standardsql.d.ts +3 -1
- package/dist/dialect/standardsql/standardsql.js +6 -5
- package/dist/dialect/trino/dialect_functions.d.ts +2 -0
- package/dist/dialect/trino/dialect_functions.js +63 -0
- package/dist/dialect/trino/function_overrides.d.ts +2 -0
- package/dist/dialect/trino/function_overrides.js +50 -0
- package/dist/dialect/trino/trino.d.ts +3 -1
- package/dist/dialect/trino/trino.js +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -4
- package/dist/lang/ast/expressions/expr-func.js +25 -29
- package/dist/lang/ast/types/dialect-name-space.js +5 -5
- package/dist/lang/ast/types/global-name-space.d.ts +4 -2
- package/dist/lang/ast/types/global-name-space.js +59 -6
- package/dist/model/malloy_query.d.ts +1 -1
- package/dist/model/malloy_query.js +7 -6
- package/dist/model/malloy_types.d.ts +7 -7
- package/package.json +1 -1
- package/dist/dialect/duckdb/functions/byte_length.d.ts +0 -2
- package/dist/dialect/duckdb/functions/byte_length.js +0 -33
- package/dist/dialect/duckdb/functions/count_approx.d.ts +0 -2
- package/dist/dialect/duckdb/functions/count_approx.js +0 -20
- package/dist/dialect/duckdb/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/duckdb/functions/dialect_functions.js +0 -16
- package/dist/dialect/duckdb/functions/div.d.ts +0 -2
- package/dist/dialect/duckdb/functions/div.js +0 -38
- package/dist/dialect/duckdb/functions/duckdb_functions.d.ts +0 -1
- package/dist/dialect/duckdb/functions/duckdb_functions.js +0 -54
- package/dist/dialect/duckdb/functions/ends_with.d.ts +0 -2
- package/dist/dialect/duckdb/functions/ends_with.js +0 -35
- package/dist/dialect/duckdb/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/duckdb/functions/greatest_and_least.js +0 -51
- package/dist/dialect/duckdb/functions/index.d.ts +0 -1
- package/dist/dialect/duckdb/functions/index.js +0 -28
- package/dist/dialect/duckdb/functions/is_inf.d.ts +0 -2
- package/dist/dialect/duckdb/functions/is_inf.js +0 -33
- package/dist/dialect/duckdb/functions/is_nan.d.ts +0 -2
- package/dist/dialect/duckdb/functions/is_nan.js +0 -33
- package/dist/dialect/duckdb/functions/log.d.ts +0 -2
- package/dist/dialect/duckdb/functions/log.js +0 -38
- package/dist/dialect/duckdb/functions/rand.d.ts +0 -2
- package/dist/dialect/duckdb/functions/rand.js +0 -31
- package/dist/dialect/duckdb/functions/replace.d.ts +0 -2
- package/dist/dialect/duckdb/functions/replace.js +0 -40
- package/dist/dialect/duckdb/functions/trunc.d.ts +0 -2
- package/dist/dialect/duckdb/functions/trunc.js +0 -39
- package/dist/dialect/duckdb/functions/unicode.d.ts +0 -2
- package/dist/dialect/duckdb/functions/unicode.js +0 -35
- package/dist/dialect/functions/all_functions.d.ts +0 -8
- package/dist/dialect/functions/all_functions.js +0 -146
- package/dist/dialect/functions/atan2.d.ts +0 -2
- package/dist/dialect/functions/atan2.js +0 -33
- package/dist/dialect/functions/avg_moving.d.ts +0 -2
- package/dist/dialect/functions/avg_moving.js +0 -46
- package/dist/dialect/functions/chr.d.ts +0 -4
- package/dist/dialect/functions/chr.js +0 -45
- package/dist/dialect/functions/coalesce.d.ts +0 -2
- package/dist/dialect/functions/coalesce.js +0 -38
- package/dist/dialect/functions/concat.d.ts +0 -2
- package/dist/dialect/functions/concat.js +0 -38
- package/dist/dialect/functions/div.d.ts +0 -2
- package/dist/dialect/functions/div.js +0 -36
- package/dist/dialect/functions/first_value_window.d.ts +0 -3
- package/dist/dialect/functions/first_value_window.js +0 -49
- package/dist/dialect/functions/function_map.d.ts +0 -16
- package/dist/dialect/functions/function_map.js +0 -72
- package/dist/dialect/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/functions/greatest_and_least.js +0 -44
- package/dist/dialect/functions/ifnull.d.ts +0 -2
- package/dist/dialect/functions/ifnull.js +0 -38
- package/dist/dialect/functions/is_inf.d.ts +0 -2
- package/dist/dialect/functions/is_inf.js +0 -33
- package/dist/dialect/functions/is_nan.d.ts +0 -2
- package/dist/dialect/functions/is_nan.js +0 -33
- package/dist/dialect/functions/lag.d.ts +0 -2
- package/dist/dialect/functions/lag.js +0 -53
- package/dist/dialect/functions/lead.d.ts +0 -2
- package/dist/dialect/functions/lead.js +0 -50
- package/dist/dialect/functions/length.d.ts +0 -3
- package/dist/dialect/functions/length.js +0 -40
- package/dist/dialect/functions/log.d.ts +0 -2
- package/dist/dialect/functions/log.js +0 -35
- package/dist/dialect/functions/lower.d.ts +0 -2
- package/dist/dialect/functions/lower.js +0 -34
- package/dist/dialect/functions/nullif.d.ts +0 -2
- package/dist/dialect/functions/nullif.js +0 -42
- package/dist/dialect/functions/pi.d.ts +0 -2
- package/dist/dialect/functions/pi.js +0 -31
- package/dist/dialect/functions/pow.d.ts +0 -2
- package/dist/dialect/functions/pow.js +0 -35
- package/dist/dialect/functions/rand.d.ts +0 -2
- package/dist/dialect/functions/rand.js +0 -31
- package/dist/dialect/functions/rank.d.ts +0 -2
- package/dist/dialect/functions/rank.js +0 -36
- package/dist/dialect/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/functions/regexp_extract.js +0 -41
- package/dist/dialect/functions/repeat.d.ts +0 -2
- package/dist/dialect/functions/repeat.js +0 -35
- package/dist/dialect/functions/replace.d.ts +0 -2
- package/dist/dialect/functions/replace.js +0 -42
- package/dist/dialect/functions/reverse.d.ts +0 -2
- package/dist/dialect/functions/reverse.js +0 -34
- package/dist/dialect/functions/round.d.ts +0 -2
- package/dist/dialect/functions/round.js +0 -40
- package/dist/dialect/functions/row_number.d.ts +0 -2
- package/dist/dialect/functions/row_number.js +0 -40
- package/dist/dialect/functions/simple_numeric_functions.d.ts +0 -15
- package/dist/dialect/functions/simple_numeric_functions.js +0 -60
- package/dist/dialect/functions/sql.d.ts +0 -6
- package/dist/dialect/functions/sql.js +0 -52
- package/dist/dialect/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/functions/starts_ends_with.js +0 -43
- package/dist/dialect/functions/stddev.d.ts +0 -2
- package/dist/dialect/functions/stddev.js +0 -34
- package/dist/dialect/functions/string_agg.d.ts +0 -3
- package/dist/dialect/functions/string_agg.js +0 -55
- package/dist/dialect/functions/strpos.d.ts +0 -2
- package/dist/dialect/functions/strpos.js +0 -35
- package/dist/dialect/functions/substr.d.ts +0 -2
- package/dist/dialect/functions/substr.js +0 -37
- package/dist/dialect/functions/sum_min_max_window.d.ts +0 -7
- package/dist/dialect/functions/sum_min_max_window.js +0 -94
- package/dist/dialect/functions/sum_moving.d.ts +0 -2
- package/dist/dialect/functions/sum_moving.js +0 -43
- package/dist/dialect/functions/trim_functions.d.ts +0 -4
- package/dist/dialect/functions/trim_functions.js +0 -42
- package/dist/dialect/functions/trunc.d.ts +0 -2
- package/dist/dialect/functions/trunc.js +0 -38
- package/dist/dialect/functions/upper.d.ts +0 -2
- package/dist/dialect/functions/upper.js +0 -34
- package/dist/dialect/postgres/functions/byte_length.d.ts +0 -2
- package/dist/dialect/postgres/functions/byte_length.js +0 -33
- package/dist/dialect/postgres/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/postgres/functions/dialect_functions.js +0 -11
- package/dist/dialect/postgres/functions/ends_with.d.ts +0 -2
- package/dist/dialect/postgres/functions/ends_with.js +0 -38
- package/dist/dialect/postgres/functions/greatest_and_least.d.ts +0 -3
- package/dist/dialect/postgres/functions/greatest_and_least.js +0 -43
- package/dist/dialect/postgres/functions/ifnull.d.ts +0 -2
- package/dist/dialect/postgres/functions/ifnull.js +0 -40
- package/dist/dialect/postgres/functions/index.d.ts +0 -1
- package/dist/dialect/postgres/functions/index.js +0 -28
- package/dist/dialect/postgres/functions/is_inf.d.ts +0 -2
- package/dist/dialect/postgres/functions/is_inf.js +0 -34
- package/dist/dialect/postgres/functions/is_nan.d.ts +0 -2
- package/dist/dialect/postgres/functions/is_nan.js +0 -33
- package/dist/dialect/postgres/functions/log.d.ts +0 -2
- package/dist/dialect/postgres/functions/log.js +0 -37
- package/dist/dialect/postgres/functions/postgres_functions.d.ts +0 -1
- package/dist/dialect/postgres/functions/postgres_functions.js +0 -63
- package/dist/dialect/postgres/functions/rand.d.ts +0 -2
- package/dist/dialect/postgres/functions/rand.js +0 -31
- package/dist/dialect/postgres/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/postgres/functions/regexp_extract.js +0 -35
- package/dist/dialect/postgres/functions/replace.d.ts +0 -2
- package/dist/dialect/postgres/functions/replace.js +0 -40
- package/dist/dialect/postgres/functions/round.d.ts +0 -2
- package/dist/dialect/postgres/functions/round.js +0 -39
- package/dist/dialect/postgres/functions/stddev.d.ts +0 -2
- package/dist/dialect/postgres/functions/stddev.js +0 -37
- package/dist/dialect/postgres/functions/string_agg.d.ts +0 -3
- package/dist/dialect/postgres/functions/string_agg.js +0 -55
- package/dist/dialect/postgres/functions/substr.d.ts +0 -2
- package/dist/dialect/postgres/functions/substr.js +0 -38
- package/dist/dialect/postgres/functions/trunc.d.ts +0 -2
- package/dist/dialect/postgres/functions/trunc.js +0 -40
- package/dist/dialect/postgres/functions/unicode.d.ts +0 -2
- package/dist/dialect/postgres/functions/unicode.js +0 -34
- package/dist/dialect/snowflake/functions/chr.d.ts +0 -2
- package/dist/dialect/snowflake/functions/chr.js +0 -36
- package/dist/dialect/snowflake/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/snowflake/functions/dialect_functions.js +0 -11
- package/dist/dialect/snowflake/functions/div.d.ts +0 -2
- package/dist/dialect/snowflake/functions/div.js +0 -37
- package/dist/dialect/snowflake/functions/index.d.ts +0 -1
- package/dist/dialect/snowflake/functions/index.js +0 -28
- package/dist/dialect/snowflake/functions/is_inf.d.ts +0 -2
- package/dist/dialect/snowflake/functions/is_inf.js +0 -34
- package/dist/dialect/snowflake/functions/is_nan.d.ts +0 -2
- package/dist/dialect/snowflake/functions/is_nan.js +0 -33
- package/dist/dialect/snowflake/functions/length.d.ts +0 -3
- package/dist/dialect/snowflake/functions/length.js +0 -39
- package/dist/dialect/snowflake/functions/log.d.ts +0 -2
- package/dist/dialect/snowflake/functions/log.js +0 -37
- package/dist/dialect/snowflake/functions/rand.d.ts +0 -2
- package/dist/dialect/snowflake/functions/rand.js +0 -33
- package/dist/dialect/snowflake/functions/regexp_extract.d.ts +0 -2
- package/dist/dialect/snowflake/functions/regexp_extract.js +0 -35
- package/dist/dialect/snowflake/functions/snowflake_functions.d.ts +0 -1
- package/dist/dialect/snowflake/functions/snowflake_functions.js +0 -56
- package/dist/dialect/snowflake/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/snowflake/functions/starts_ends_with.js +0 -43
- package/dist/dialect/snowflake/functions/string_agg.d.ts +0 -3
- package/dist/dialect/snowflake/functions/string_agg.js +0 -55
- package/dist/dialect/snowflake/functions/strpos.d.ts +0 -2
- package/dist/dialect/snowflake/functions/strpos.js +0 -35
- package/dist/dialect/snowflake/functions/trunc.d.ts +0 -2
- package/dist/dialect/snowflake/functions/trunc.js +0 -39
- package/dist/dialect/standardsql/functions/chr.d.ts +0 -2
- package/dist/dialect/standardsql/functions/chr.js +0 -37
- package/dist/dialect/standardsql/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/standardsql/functions/dialect_functions.js +0 -16
- package/dist/dialect/standardsql/functions/index.d.ts +0 -1
- package/dist/dialect/standardsql/functions/index.js +0 -28
- package/dist/dialect/standardsql/functions/pi.d.ts +0 -2
- package/dist/dialect/standardsql/functions/pi.js +0 -32
- package/dist/dialect/standardsql/functions/standardsql_functions.d.ts +0 -1
- package/dist/dialect/standardsql/functions/standardsql_functions.js +0 -36
- package/dist/dialect/standardsql/functions/string_agg.d.ts +0 -3
- package/dist/dialect/standardsql/functions/string_agg.js +0 -59
- package/dist/dialect/trino/functions/byte_length.d.ts +0 -2
- package/dist/dialect/trino/functions/byte_length.js +0 -33
- package/dist/dialect/trino/functions/chr.d.ts +0 -4
- package/dist/dialect/trino/functions/chr.js +0 -45
- package/dist/dialect/trino/functions/concat.d.ts +0 -2
- package/dist/dialect/trino/functions/concat.js +0 -38
- package/dist/dialect/trino/functions/count_approx.d.ts +0 -2
- package/dist/dialect/trino/functions/count_approx.js +0 -20
- package/dist/dialect/trino/functions/dialect_functions.d.ts +0 -4
- package/dist/dialect/trino/functions/dialect_functions.js +0 -16
- package/dist/dialect/trino/functions/div.d.ts +0 -2
- package/dist/dialect/trino/functions/div.js +0 -36
- package/dist/dialect/trino/functions/ifnull.d.ts +0 -2
- package/dist/dialect/trino/functions/ifnull.js +0 -40
- package/dist/dialect/trino/functions/index.d.ts +0 -1
- package/dist/dialect/trino/functions/index.js +0 -28
- package/dist/dialect/trino/functions/is_inf.d.ts +0 -2
- package/dist/dialect/trino/functions/is_inf.js +0 -33
- package/dist/dialect/trino/functions/log.d.ts +0 -2
- package/dist/dialect/trino/functions/log.js +0 -37
- package/dist/dialect/trino/functions/repeat.d.ts +0 -2
- package/dist/dialect/trino/functions/repeat.js +0 -35
- package/dist/dialect/trino/functions/reverse.d.ts +0 -2
- package/dist/dialect/trino/functions/reverse.js +0 -34
- package/dist/dialect/trino/functions/starts_ends_with.d.ts +0 -3
- package/dist/dialect/trino/functions/starts_ends_with.js +0 -43
- package/dist/dialect/trino/functions/string_agg.d.ts +0 -3
- package/dist/dialect/trino/functions/string_agg.js +0 -55
- package/dist/dialect/trino/functions/trino_functions.d.ts +0 -1
- package/dist/dialect/trino/functions/trino_functions.js +0 -59
- package/dist/dialect/trino/functions/trunc.d.ts +0 -2
- package/dist/dialect/trino/functions/trunc.js +0 -39
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionMap } from './function_map';
|
|
2
|
-
/**
|
|
3
|
-
* This is a function map containing default implementations of all Malloy
|
|
4
|
-
* built-in functions. These don't work in all dialects, but are a good starting
|
|
5
|
-
* point. In dialects where they don't work, specific functions are overridden in
|
|
6
|
-
* a dialect-specific function map.
|
|
7
|
-
*/
|
|
8
|
-
export declare const FUNCTIONS: FunctionMap;
|
|
@@ -1,146 +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.FUNCTIONS = void 0;
|
|
26
|
-
const concat_1 = require("./concat");
|
|
27
|
-
const trunc_1 = require("./trunc");
|
|
28
|
-
const stddev_1 = require("./stddev");
|
|
29
|
-
const round_1 = require("./round");
|
|
30
|
-
const lower_1 = require("./lower");
|
|
31
|
-
const chr_1 = require("./chr");
|
|
32
|
-
const upper_1 = require("./upper");
|
|
33
|
-
const substr_1 = require("./substr");
|
|
34
|
-
const regexp_extract_1 = require("./regexp_extract");
|
|
35
|
-
const replace_1 = require("./replace");
|
|
36
|
-
const length_1 = require("./length");
|
|
37
|
-
const ifnull_1 = require("./ifnull");
|
|
38
|
-
const nullif_1 = require("./nullif");
|
|
39
|
-
const row_number_1 = require("./row_number");
|
|
40
|
-
const lag_1 = require("./lag");
|
|
41
|
-
const lead_1 = require("./lead");
|
|
42
|
-
const rank_1 = require("./rank");
|
|
43
|
-
const first_value_window_1 = require("./first_value_window");
|
|
44
|
-
const sum_min_max_window_1 = require("./sum_min_max_window");
|
|
45
|
-
const starts_ends_with_1 = require("./starts_ends_with");
|
|
46
|
-
const is_inf_1 = require("./is_inf");
|
|
47
|
-
const is_nan_1 = require("./is_nan");
|
|
48
|
-
const atan2_1 = require("./atan2");
|
|
49
|
-
const pow_1 = require("./pow");
|
|
50
|
-
const log_1 = require("./log");
|
|
51
|
-
const strpos_1 = require("./strpos");
|
|
52
|
-
const div_1 = require("./div");
|
|
53
|
-
const greatest_and_least_1 = require("./greatest_and_least");
|
|
54
|
-
const trim_functions_1 = require("./trim_functions");
|
|
55
|
-
const rand_1 = require("./rand");
|
|
56
|
-
const pi_1 = require("./pi");
|
|
57
|
-
const repeat_1 = require("./repeat");
|
|
58
|
-
const reverse_1 = require("./reverse");
|
|
59
|
-
const simple_numeric_functions_1 = require("./simple_numeric_functions");
|
|
60
|
-
const avg_moving_1 = require("./avg_moving");
|
|
61
|
-
const function_map_1 = require("./function_map");
|
|
62
|
-
const coalesce_1 = require("./coalesce");
|
|
63
|
-
const string_agg_1 = require("./string_agg");
|
|
64
|
-
const sql_1 = require("./sql");
|
|
65
|
-
const sum_moving_1 = require("./sum_moving");
|
|
66
|
-
/**
|
|
67
|
-
* This is a function map containing default implementations of all Malloy
|
|
68
|
-
* built-in functions. These don't work in all dialects, but are a good starting
|
|
69
|
-
* point. In dialects where they don't work, specific functions are overridden in
|
|
70
|
-
* a dialect-specific function map.
|
|
71
|
-
*/
|
|
72
|
-
exports.FUNCTIONS = new function_map_1.FunctionMap();
|
|
73
|
-
// Scalar functions
|
|
74
|
-
exports.FUNCTIONS.add('concat', concat_1.fnConcat);
|
|
75
|
-
exports.FUNCTIONS.add('round', round_1.fnRound);
|
|
76
|
-
exports.FUNCTIONS.add('trunc', trunc_1.fnTrunc);
|
|
77
|
-
exports.FUNCTIONS.add('floor', simple_numeric_functions_1.fnFloor);
|
|
78
|
-
exports.FUNCTIONS.add('ceil', simple_numeric_functions_1.fnCeil);
|
|
79
|
-
exports.FUNCTIONS.add('cos', simple_numeric_functions_1.fnCos);
|
|
80
|
-
exports.FUNCTIONS.add('acos', simple_numeric_functions_1.fnAcos);
|
|
81
|
-
exports.FUNCTIONS.add('sin', simple_numeric_functions_1.fnSin);
|
|
82
|
-
exports.FUNCTIONS.add('asin', simple_numeric_functions_1.fnAsin);
|
|
83
|
-
exports.FUNCTIONS.add('tan', simple_numeric_functions_1.fnTan);
|
|
84
|
-
exports.FUNCTIONS.add('atan', simple_numeric_functions_1.fnAtan);
|
|
85
|
-
exports.FUNCTIONS.add('atan2', atan2_1.fnAtan2);
|
|
86
|
-
exports.FUNCTIONS.add('lower', lower_1.fnLower);
|
|
87
|
-
exports.FUNCTIONS.add('upper', upper_1.fnUpper);
|
|
88
|
-
exports.FUNCTIONS.add('sqrt', simple_numeric_functions_1.fnSqrt);
|
|
89
|
-
exports.FUNCTIONS.add('pow', pow_1.fnPow);
|
|
90
|
-
exports.FUNCTIONS.add('abs', simple_numeric_functions_1.fnAbs);
|
|
91
|
-
exports.FUNCTIONS.add('sign', simple_numeric_functions_1.fnSign);
|
|
92
|
-
exports.FUNCTIONS.add('is_inf', is_inf_1.fnIsInf);
|
|
93
|
-
exports.FUNCTIONS.add('is_nan', is_nan_1.fnIsNan);
|
|
94
|
-
exports.FUNCTIONS.add('greatest', greatest_and_least_1.fnGreatest);
|
|
95
|
-
exports.FUNCTIONS.add('least', greatest_and_least_1.fnLeast);
|
|
96
|
-
exports.FUNCTIONS.add('div', div_1.fnDiv);
|
|
97
|
-
exports.FUNCTIONS.add('strpos', strpos_1.fnStrpos);
|
|
98
|
-
exports.FUNCTIONS.add('starts_with', starts_ends_with_1.fnStartsWith);
|
|
99
|
-
exports.FUNCTIONS.add('ends_with', starts_ends_with_1.fnEndsWith);
|
|
100
|
-
exports.FUNCTIONS.add('trim', trim_functions_1.fnTrim);
|
|
101
|
-
exports.FUNCTIONS.add('ltrim', trim_functions_1.fnLtrim);
|
|
102
|
-
exports.FUNCTIONS.add('rtrim', trim_functions_1.fnRtrim);
|
|
103
|
-
exports.FUNCTIONS.add('rand', rand_1.fnRand);
|
|
104
|
-
exports.FUNCTIONS.add('pi', pi_1.fnPi);
|
|
105
|
-
exports.FUNCTIONS.add('substr', substr_1.fnSubstr);
|
|
106
|
-
exports.FUNCTIONS.add('regexp_extract', regexp_extract_1.fnRegexpExtract);
|
|
107
|
-
exports.FUNCTIONS.add('replace', replace_1.fnReplace);
|
|
108
|
-
exports.FUNCTIONS.add('length', length_1.fnLength);
|
|
109
|
-
exports.FUNCTIONS.add('byte_length', length_1.fnByteLength);
|
|
110
|
-
exports.FUNCTIONS.add('ifnull', ifnull_1.fnIfnull);
|
|
111
|
-
exports.FUNCTIONS.add('coalesce', coalesce_1.fnCoalesce);
|
|
112
|
-
exports.FUNCTIONS.add('nullif', nullif_1.fnNullif);
|
|
113
|
-
exports.FUNCTIONS.add('chr', chr_1.fnChr);
|
|
114
|
-
exports.FUNCTIONS.add('ascii', chr_1.fnAscii);
|
|
115
|
-
exports.FUNCTIONS.add('unicode', chr_1.fnUnicode);
|
|
116
|
-
exports.FUNCTIONS.add('repeat', repeat_1.fnRepeat);
|
|
117
|
-
exports.FUNCTIONS.add('reverse', reverse_1.fnReverse);
|
|
118
|
-
exports.FUNCTIONS.add('log', log_1.fnLog);
|
|
119
|
-
exports.FUNCTIONS.add('ln', simple_numeric_functions_1.fnLn);
|
|
120
|
-
exports.FUNCTIONS.add('exp', simple_numeric_functions_1.fnExp);
|
|
121
|
-
// Aggregate functions
|
|
122
|
-
exports.FUNCTIONS.add('stddev', stddev_1.fnStddev);
|
|
123
|
-
exports.FUNCTIONS.add('string_agg', string_agg_1.fnStringAgg);
|
|
124
|
-
exports.FUNCTIONS.add('string_agg_distinct', string_agg_1.fnStringAggDistinct);
|
|
125
|
-
// Analytic functions
|
|
126
|
-
exports.FUNCTIONS.add('row_number', row_number_1.fnRowNumber);
|
|
127
|
-
exports.FUNCTIONS.add('lag', lag_1.fnLag);
|
|
128
|
-
exports.FUNCTIONS.add('lead', lead_1.fnLead);
|
|
129
|
-
exports.FUNCTIONS.add('rank', rank_1.fnRank);
|
|
130
|
-
exports.FUNCTIONS.add('first_value', first_value_window_1.fnFirstValueWindow);
|
|
131
|
-
exports.FUNCTIONS.add('last_value', first_value_window_1.fnLastValueWindow);
|
|
132
|
-
exports.FUNCTIONS.add('min_cumulative', sum_min_max_window_1.fnMinCumulative);
|
|
133
|
-
exports.FUNCTIONS.add('max_cumulative', sum_min_max_window_1.fnMaxCumulative);
|
|
134
|
-
exports.FUNCTIONS.add('sum_cumulative', sum_min_max_window_1.fnSumCumulative);
|
|
135
|
-
exports.FUNCTIONS.add('min_window', sum_min_max_window_1.fnMinWindow);
|
|
136
|
-
exports.FUNCTIONS.add('max_window', sum_min_max_window_1.fnMaxWindow);
|
|
137
|
-
exports.FUNCTIONS.add('sum_window', sum_min_max_window_1.fnSumWindow);
|
|
138
|
-
exports.FUNCTIONS.add('avg_moving', avg_moving_1.fnAvgRolling);
|
|
139
|
-
exports.FUNCTIONS.add('sum_moving', sum_moving_1.fnSumMoving);
|
|
140
|
-
exports.FUNCTIONS.add('sql_number', sql_1.fnSqlNumber);
|
|
141
|
-
exports.FUNCTIONS.add('sql_string', sql_1.fnSqlString);
|
|
142
|
-
exports.FUNCTIONS.add('sql_date', sql_1.fnSqlDate);
|
|
143
|
-
exports.FUNCTIONS.add('sql_timestamp', sql_1.fnSqlTimestamp);
|
|
144
|
-
exports.FUNCTIONS.add('sql_boolean', sql_1.fnSqlBoolean);
|
|
145
|
-
exports.FUNCTIONS.seal();
|
|
146
|
-
//# sourceMappingURL=all_functions.js.map
|
|
@@ -1,33 +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.fnAtan2 = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnAtan2() {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [(0, util_1.param)('y', (0, util_1.anyExprType)('number')), (0, util_1.param)('x', (0, util_1.anyExprType)('number'))], (0, util_1.sql) `ATAN2(${(0, util_1.arg)('y')}, ${(0, util_1.arg)('x')})`),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
exports.fnAtan2 = fnAtan2;
|
|
33
|
-
//# sourceMappingURL=atan2.js.map
|
|
@@ -1,46 +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.fnAvgRolling = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
const types = ['string', 'number', 'timestamp', 'date'];
|
|
28
|
-
function fnAvgRolling() {
|
|
29
|
-
return types.flatMap(type => {
|
|
30
|
-
const value = (0, util_1.makeParam)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)));
|
|
31
|
-
const preceding = (0, util_1.makeParam)('preceding', (0, util_1.literal)((0, util_1.maxScalar)('number')));
|
|
32
|
-
const following = (0, util_1.makeParam)('following', (0, util_1.literal)((0, util_1.maxScalar)('number')));
|
|
33
|
-
return [
|
|
34
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param, preceding.param], (0, util_1.sql) `AVG(${value.arg})`, {
|
|
35
|
-
needsWindowOrderBy: true,
|
|
36
|
-
between: { preceding: 'preceding', following: 0 },
|
|
37
|
-
}),
|
|
38
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [value.param, preceding.param, following.param], (0, util_1.sql) `AVG(${value.arg})`, {
|
|
39
|
-
needsWindowOrderBy: true,
|
|
40
|
-
between: { preceding: 'preceding', following: 'following' },
|
|
41
|
-
}),
|
|
42
|
-
];
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
exports.fnAvgRolling = fnAvgRolling;
|
|
46
|
-
//# sourceMappingURL=avg_moving.js.map
|
|
@@ -1,45 +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.fnUnicode = exports.fnAscii = exports.fnChr = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnChr() {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [(0, util_1.param)('value', (0, util_1.anyExprType)('number'))], (0, util_1.sql) `CASE WHEN ${(0, util_1.arg)('value')} = 0 THEN '' ELSE CHR(${(0, util_1.arg)('value')}) END`),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
exports.fnChr = fnChr;
|
|
33
|
-
function fnAscii() {
|
|
34
|
-
return [
|
|
35
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [(0, util_1.param)('value', (0, util_1.anyExprType)('string'))], (0, util_1.sql) `ASCII(${(0, util_1.arg)('value')})`),
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
exports.fnAscii = fnAscii;
|
|
39
|
-
function fnUnicode() {
|
|
40
|
-
return [
|
|
41
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [(0, util_1.param)('value', (0, util_1.anyExprType)('string'))], (0, util_1.sql) `UNICODE(${(0, util_1.arg)('value')})`),
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
exports.fnUnicode = fnUnicode;
|
|
45
|
-
//# sourceMappingURL=chr.js.map
|
|
@@ -1,38 +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.fnCoalesce = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
const types = [
|
|
28
|
-
'string',
|
|
29
|
-
'number',
|
|
30
|
-
'timestamp',
|
|
31
|
-
'date',
|
|
32
|
-
'json',
|
|
33
|
-
];
|
|
34
|
-
function fnCoalesce() {
|
|
35
|
-
return types.map(type => (0, util_1.overload)((0, util_1.minScalar)(type), [(0, util_1.params)('values', (0, util_1.anyExprType)(type))], (0, util_1.sql) `COALESCE(${(0, util_1.spread)((0, util_1.arg)('values'))})`));
|
|
36
|
-
}
|
|
37
|
-
exports.fnCoalesce = fnCoalesce;
|
|
38
|
-
//# sourceMappingURL=coalesce.js.map
|
|
@@ -1,38 +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.fnConcat = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnConcat() {
|
|
28
|
-
return [
|
|
29
|
-
// TODO: in DuckDB and Postgres, nulls are treated like "",
|
|
30
|
-
// but in BigQuery and Snowflake, nulls propagate and the result becomes null
|
|
31
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [], { node: 'stringLiteral', literal: '' }),
|
|
32
|
-
(0, util_1.overload)((0, util_1.minScalar)('string'), [
|
|
33
|
-
(0, util_1.params)('values', (0, util_1.anyExprType)('string'), (0, util_1.anyExprType)('number'), (0, util_1.anyExprType)('date'), (0, util_1.anyExprType)('timestamp'), (0, util_1.anyExprType)('boolean')),
|
|
34
|
-
], (0, util_1.sql) `CONCAT(${(0, util_1.spread)((0, util_1.arg)('values'))})`),
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
exports.fnConcat = fnConcat;
|
|
38
|
-
//# sourceMappingURL=concat.js.map
|
|
@@ -1,36 +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.fnDiv = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
function fnDiv() {
|
|
28
|
-
return [
|
|
29
|
-
(0, util_1.overload)((0, util_1.minScalar)('number'), [
|
|
30
|
-
(0, util_1.param)('dividend', (0, util_1.anyExprType)('number')),
|
|
31
|
-
(0, util_1.param)('divisor', (0, util_1.anyExprType)('number')),
|
|
32
|
-
], (0, util_1.sql) `DIV(${(0, util_1.arg)('dividend')}, ${(0, util_1.arg)('divisor')})`),
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
exports.fnDiv = fnDiv;
|
|
36
|
-
//# sourceMappingURL=div.js.map
|
|
@@ -1,49 +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.fnLastValueWindow = exports.fnFirstValueWindow = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
const types = [
|
|
28
|
-
'string',
|
|
29
|
-
'number',
|
|
30
|
-
'timestamp',
|
|
31
|
-
'date',
|
|
32
|
-
'json',
|
|
33
|
-
];
|
|
34
|
-
function fnFirstValueWindow() {
|
|
35
|
-
return types.flatMap(type => [
|
|
36
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [(0, util_1.param)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)))], (0, util_1.sql) `FIRST_VALUE(${(0, util_1.arg)('value')})`, { needsWindowOrderBy: true }),
|
|
37
|
-
]);
|
|
38
|
-
}
|
|
39
|
-
exports.fnFirstValueWindow = fnFirstValueWindow;
|
|
40
|
-
function fnLastValueWindow() {
|
|
41
|
-
return types.flatMap(type => [
|
|
42
|
-
(0, util_1.overload)((0, util_1.minAnalytic)(type), [(0, util_1.param)('value', (0, util_1.output)((0, util_1.maxAggregate)(type)))], (0, util_1.sql) `LAST_VALUE(${(0, util_1.arg)('value')})`, {
|
|
43
|
-
needsWindowOrderBy: true,
|
|
44
|
-
between: { preceding: -1, following: -1 },
|
|
45
|
-
}),
|
|
46
|
-
]);
|
|
47
|
-
}
|
|
48
|
-
exports.fnLastValueWindow = fnLastValueWindow;
|
|
49
|
-
//# sourceMappingURL=first_value_window.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DialectFunctionOverloadDef } from './util';
|
|
2
|
-
type Thunk<T> = () => T;
|
|
3
|
-
export declare class FunctionMap {
|
|
4
|
-
private functions;
|
|
5
|
-
private getters;
|
|
6
|
-
private sealed;
|
|
7
|
-
constructor(getters?: Map<string, Thunk<DialectFunctionOverloadDef[]>>);
|
|
8
|
-
clone(): FunctionMap;
|
|
9
|
-
add(name: string, getter: Thunk<DialectFunctionOverloadDef[]>): void;
|
|
10
|
-
get(name: string): DialectFunctionOverloadDef[] | undefined;
|
|
11
|
-
delete(name: string): void;
|
|
12
|
-
seal(): void;
|
|
13
|
-
private ensureNotSealed;
|
|
14
|
-
private ensureSealed;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,72 +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.FunctionMap = void 0;
|
|
26
|
-
class FunctionMap {
|
|
27
|
-
constructor(getters) {
|
|
28
|
-
this.functions = new Map();
|
|
29
|
-
this.sealed = false;
|
|
30
|
-
this.getters = getters !== null && getters !== void 0 ? getters : new Map();
|
|
31
|
-
}
|
|
32
|
-
clone() {
|
|
33
|
-
return new FunctionMap(new Map(this.getters));
|
|
34
|
-
}
|
|
35
|
-
add(name, getter) {
|
|
36
|
-
this.ensureNotSealed();
|
|
37
|
-
this.getters.set(name, getter);
|
|
38
|
-
}
|
|
39
|
-
get(name) {
|
|
40
|
-
this.ensureSealed();
|
|
41
|
-
const ready = this.functions.get(name);
|
|
42
|
-
if (ready)
|
|
43
|
-
return ready;
|
|
44
|
-
const getter = this.getters.get(name);
|
|
45
|
-
if (getter === undefined) {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
const func = getter();
|
|
49
|
-
this.functions.set(name, func);
|
|
50
|
-
return func;
|
|
51
|
-
}
|
|
52
|
-
delete(name) {
|
|
53
|
-
this.ensureNotSealed();
|
|
54
|
-
this.functions.delete(name);
|
|
55
|
-
this.getters.delete(name);
|
|
56
|
-
}
|
|
57
|
-
seal() {
|
|
58
|
-
this.sealed = true;
|
|
59
|
-
}
|
|
60
|
-
ensureNotSealed() {
|
|
61
|
-
if (this.sealed) {
|
|
62
|
-
throw new Error('Cannot update sealed FunctionMap');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
ensureSealed() {
|
|
66
|
-
if (!this.sealed) {
|
|
67
|
-
throw new Error('Cannot get from unsealed FunctionMap');
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.FunctionMap = FunctionMap;
|
|
72
|
-
//# sourceMappingURL=function_map.js.map
|
|
@@ -1,44 +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.fnLeast = exports.fnGreatest = void 0;
|
|
26
|
-
const util_1 = require("./util");
|
|
27
|
-
const types = [
|
|
28
|
-
'string',
|
|
29
|
-
'number',
|
|
30
|
-
'timestamp',
|
|
31
|
-
'date',
|
|
32
|
-
'json',
|
|
33
|
-
];
|
|
34
|
-
// TODO Flip this around so that in DuckDB and Postgres, it just calls the function
|
|
35
|
-
// directly, and in BigQuery we add a wrapper to ensure that the null behavior is consistent.
|
|
36
|
-
// It should be that nulls are ignored, rather than propagated.
|
|
37
|
-
function greatestOrLeast(fn) {
|
|
38
|
-
return types.map(type => (0, util_1.overload)((0, util_1.minScalar)(type), [(0, util_1.params)('values', (0, util_1.anyExprType)(type))], (0, util_1.sql) `${fn}(${(0, util_1.spread)((0, util_1.arg)('values'))})`));
|
|
39
|
-
}
|
|
40
|
-
const fnGreatest = () => greatestOrLeast('GREATEST');
|
|
41
|
-
exports.fnGreatest = fnGreatest;
|
|
42
|
-
const fnLeast = () => greatestOrLeast('LEAST');
|
|
43
|
-
exports.fnLeast = fnLeast;
|
|
44
|
-
//# sourceMappingURL=greatest_and_least.js.map
|