sqlframe 1.9.0__py3-none-any.whl → 1.10.0__py3-none-any.whl
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.
- sqlframe/_version.py +2 -2
- sqlframe/base/function_alternatives.py +96 -0
- sqlframe/base/functions.py +4013 -1
- sqlframe/base/session.py +2 -2
- sqlframe/base/types.py +1 -1
- sqlframe/base/util.py +5 -0
- sqlframe/bigquery/functions.py +4 -0
- sqlframe/bigquery/functions.pyi +37 -1
- sqlframe/duckdb/functions.py +3 -0
- sqlframe/duckdb/functions.pyi +29 -0
- sqlframe/postgres/functions.py +6 -0
- sqlframe/postgres/functions.pyi +28 -0
- sqlframe/snowflake/functions.py +3 -0
- sqlframe/snowflake/functions.pyi +27 -0
- sqlframe/spark/functions.pyi +161 -1
- {sqlframe-1.9.0.dist-info → sqlframe-1.10.0.dist-info}/METADATA +1 -1
- {sqlframe-1.9.0.dist-info → sqlframe-1.10.0.dist-info}/RECORD +20 -20
- {sqlframe-1.9.0.dist-info → sqlframe-1.10.0.dist-info}/LICENSE +0 -0
- {sqlframe-1.9.0.dist-info → sqlframe-1.10.0.dist-info}/WHEEL +0 -0
- {sqlframe-1.9.0.dist-info → sqlframe-1.10.0.dist-info}/top_level.txt +0 -0
sqlframe/base/session.py
CHANGED
|
@@ -442,12 +442,12 @@ class _BaseSession(t.Generic[CATALOG, READER, WRITER, DF, CONN]):
|
|
|
442
442
|
|
|
443
443
|
@classmethod
|
|
444
444
|
def _to_row(cls, columns: t.List[str], values: t.Iterable[t.Any]) -> Row:
|
|
445
|
-
from sqlframe.base.types import Row
|
|
445
|
+
from sqlframe.base.types import Row, _create_row
|
|
446
446
|
|
|
447
447
|
converted_values = []
|
|
448
448
|
for value in values:
|
|
449
449
|
converted_values.append(cls._to_value(value))
|
|
450
|
-
return
|
|
450
|
+
return _create_row(columns, converted_values)
|
|
451
451
|
|
|
452
452
|
def _fetch_rows(
|
|
453
453
|
self, sql: t.Union[str, exp.Expression], *, quote_identifiers: bool = True
|
sqlframe/base/types.py
CHANGED
|
@@ -222,7 +222,7 @@ class StructType(DataType):
|
|
|
222
222
|
def _create_row(
|
|
223
223
|
fields: t.Union[Row, t.List[str]], values: t.Union[t.Tuple[t.Any, ...], t.List[t.Any]]
|
|
224
224
|
) -> Row:
|
|
225
|
-
row = Row(*values)
|
|
225
|
+
row = Row(*[float(x) if isinstance(x, Decimal) else x for x in values])
|
|
226
226
|
row.__fields__ = fields
|
|
227
227
|
return row
|
|
228
228
|
|
sqlframe/base/util.py
CHANGED
|
@@ -71,6 +71,11 @@ def get_column_mapping_from_schema_input(
|
|
|
71
71
|
col_name_type_strs = [x.strip() for x in schema.split(",")]
|
|
72
72
|
if len(col_name_type_strs) == 1 and len(col_name_type_strs[0].split(" ")) == 1:
|
|
73
73
|
value = {"value": col_name_type_strs[0].strip()}
|
|
74
|
+
elif schema.startswith("struct<") and schema.endswith(">"):
|
|
75
|
+
value = {
|
|
76
|
+
name_type_str.split(":")[0].strip(): name_type_str.split(":")[1].strip()
|
|
77
|
+
for name_type_str in schema[7:-1].split(",")
|
|
78
|
+
}
|
|
74
79
|
else:
|
|
75
80
|
value = {
|
|
76
81
|
name_type_str.split(" ")[0].strip(): name_type_str.split(" ")[1].strip()
|
sqlframe/bigquery/functions.py
CHANGED
|
@@ -26,8 +26,11 @@ globals().update(
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
29
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
30
|
+
current_user_from_session_user as current_user,
|
|
29
31
|
e_literal as e,
|
|
30
32
|
expm1_from_exp as expm1,
|
|
33
|
+
extract_convert_to_var as extract,
|
|
31
34
|
factorial_from_case_statement as factorial,
|
|
32
35
|
log1p_from_log as log1p,
|
|
33
36
|
rint_from_round as rint,
|
|
@@ -63,6 +66,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
63
66
|
element_at_using_brackets as element_at,
|
|
64
67
|
array_union_using_array_concat as array_union,
|
|
65
68
|
sequence_from_generate_array as sequence,
|
|
69
|
+
position_as_strpos as position,
|
|
66
70
|
)
|
|
67
71
|
|
|
68
72
|
|
sqlframe/bigquery/functions.pyi
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import typing as t
|
|
2
2
|
|
|
3
3
|
from sqlframe.base.column import Column as Column
|
|
4
|
+
from sqlframe.base.function_alternatives import ( # noqa
|
|
5
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
6
|
+
)
|
|
4
7
|
from sqlframe.base.function_alternatives import (
|
|
5
8
|
array_union_using_array_concat as array_union,
|
|
6
9
|
)
|
|
@@ -16,6 +19,9 @@ from sqlframe.base.function_alternatives import (
|
|
|
16
19
|
from sqlframe.base.function_alternatives import (
|
|
17
20
|
concat_ws_from_array_to_string as concat_ws,
|
|
18
21
|
)
|
|
22
|
+
from sqlframe.base.function_alternatives import (
|
|
23
|
+
current_user_from_session_user as current_user,
|
|
24
|
+
)
|
|
19
25
|
from sqlframe.base.function_alternatives import (
|
|
20
26
|
dayofmonth_from_extract_with_day as dayofmonth,
|
|
21
27
|
)
|
|
@@ -25,7 +31,7 @@ from sqlframe.base.function_alternatives import (
|
|
|
25
31
|
from sqlframe.base.function_alternatives import (
|
|
26
32
|
dayofyear_from_extract as dayofyear,
|
|
27
33
|
)
|
|
28
|
-
from sqlframe.base.function_alternatives import (
|
|
34
|
+
from sqlframe.base.function_alternatives import (
|
|
29
35
|
e_literal as e,
|
|
30
36
|
)
|
|
31
37
|
from sqlframe.base.function_alternatives import (
|
|
@@ -34,6 +40,9 @@ from sqlframe.base.function_alternatives import (
|
|
|
34
40
|
from sqlframe.base.function_alternatives import (
|
|
35
41
|
expm1_from_exp as expm1,
|
|
36
42
|
)
|
|
43
|
+
from sqlframe.base.function_alternatives import (
|
|
44
|
+
extract_convert_to_var as extract,
|
|
45
|
+
)
|
|
37
46
|
from sqlframe.base.function_alternatives import (
|
|
38
47
|
factorial_from_case_statement as factorial,
|
|
39
48
|
)
|
|
@@ -79,6 +88,9 @@ from sqlframe.base.function_alternatives import (
|
|
|
79
88
|
from sqlframe.base.function_alternatives import (
|
|
80
89
|
percentile_approx_without_accuracy_and_plural as percentile_approx,
|
|
81
90
|
)
|
|
91
|
+
from sqlframe.base.function_alternatives import (
|
|
92
|
+
position_as_strpos as position,
|
|
93
|
+
)
|
|
82
94
|
from sqlframe.base.function_alternatives import (
|
|
83
95
|
quarter_from_extract as quarter,
|
|
84
96
|
)
|
|
@@ -133,9 +145,13 @@ from sqlframe.base.functions import atanh as atanh
|
|
|
133
145
|
from sqlframe.base.functions import avg as avg
|
|
134
146
|
from sqlframe.base.functions import bitwise_not as bitwise_not
|
|
135
147
|
from sqlframe.base.functions import bitwiseNOT as bitwiseNOT
|
|
148
|
+
from sqlframe.base.functions import bool_and as bool_and
|
|
149
|
+
from sqlframe.base.functions import bool_or as bool_or
|
|
150
|
+
from sqlframe.base.functions import call_function as call_function
|
|
136
151
|
from sqlframe.base.functions import cbrt as cbrt
|
|
137
152
|
from sqlframe.base.functions import ceil as ceil
|
|
138
153
|
from sqlframe.base.functions import ceiling as ceiling
|
|
154
|
+
from sqlframe.base.functions import char as char
|
|
139
155
|
from sqlframe.base.functions import coalesce as coalesce
|
|
140
156
|
from sqlframe.base.functions import col as col
|
|
141
157
|
from sqlframe.base.functions import collect_list as collect_list
|
|
@@ -145,6 +161,7 @@ from sqlframe.base.functions import cos as cos
|
|
|
145
161
|
from sqlframe.base.functions import cosh as cosh
|
|
146
162
|
from sqlframe.base.functions import cot as cot
|
|
147
163
|
from sqlframe.base.functions import count as count
|
|
164
|
+
from sqlframe.base.functions import count_if as count_if
|
|
148
165
|
from sqlframe.base.functions import covar_pop as covar_pop
|
|
149
166
|
from sqlframe.base.functions import covar_samp as covar_samp
|
|
150
167
|
from sqlframe.base.functions import csc as csc
|
|
@@ -156,6 +173,8 @@ from sqlframe.base.functions import date_diff as date_diff
|
|
|
156
173
|
from sqlframe.base.functions import date_format as date_format
|
|
157
174
|
from sqlframe.base.functions import date_sub as date_sub
|
|
158
175
|
from sqlframe.base.functions import date_trunc as date_trunc
|
|
176
|
+
from sqlframe.base.functions import dateadd as dateadd
|
|
177
|
+
from sqlframe.base.functions import datediff as datediff
|
|
159
178
|
from sqlframe.base.functions import dense_rank as dense_rank
|
|
160
179
|
from sqlframe.base.functions import desc as desc
|
|
161
180
|
from sqlframe.base.functions import desc_nulls_first as desc_nulls_first
|
|
@@ -167,14 +186,18 @@ from sqlframe.base.functions import expr as expr
|
|
|
167
186
|
from sqlframe.base.functions import floor as floor
|
|
168
187
|
from sqlframe.base.functions import get_json_object as get_json_object
|
|
169
188
|
from sqlframe.base.functions import greatest as greatest
|
|
189
|
+
from sqlframe.base.functions import ifnull as ifnull
|
|
170
190
|
from sqlframe.base.functions import initcap as initcap
|
|
171
191
|
from sqlframe.base.functions import input_file_name as input_file_name
|
|
172
192
|
from sqlframe.base.functions import isnan as isnan
|
|
173
193
|
from sqlframe.base.functions import lag as lag
|
|
194
|
+
from sqlframe.base.functions import lcase as lcase
|
|
174
195
|
from sqlframe.base.functions import lead as lead
|
|
175
196
|
from sqlframe.base.functions import least as least
|
|
197
|
+
from sqlframe.base.functions import left as left
|
|
176
198
|
from sqlframe.base.functions import length as length
|
|
177
199
|
from sqlframe.base.functions import lit as lit
|
|
200
|
+
from sqlframe.base.functions import ln as ln
|
|
178
201
|
from sqlframe.base.functions import log as log
|
|
179
202
|
from sqlframe.base.functions import log2 as log2
|
|
180
203
|
from sqlframe.base.functions import log10 as log10
|
|
@@ -187,33 +210,43 @@ from sqlframe.base.functions import md5 as md5
|
|
|
187
210
|
from sqlframe.base.functions import mean as mean
|
|
188
211
|
from sqlframe.base.functions import min as min
|
|
189
212
|
from sqlframe.base.functions import min_by as min_by
|
|
213
|
+
from sqlframe.base.functions import now as now
|
|
190
214
|
from sqlframe.base.functions import nth_value as nth_value
|
|
191
215
|
from sqlframe.base.functions import ntile as ntile
|
|
192
216
|
from sqlframe.base.functions import nullif as nullif
|
|
217
|
+
from sqlframe.base.functions import nvl as nvl
|
|
218
|
+
from sqlframe.base.functions import nvl2 as nvl2
|
|
193
219
|
from sqlframe.base.functions import octet_length as octet_length
|
|
194
220
|
from sqlframe.base.functions import percent_rank as percent_rank
|
|
195
221
|
from sqlframe.base.functions import posexplode as posexplode
|
|
196
222
|
from sqlframe.base.functions import posexplode_outer as posexplode_outer
|
|
197
223
|
from sqlframe.base.functions import pow as pow
|
|
224
|
+
from sqlframe.base.functions import power as power
|
|
198
225
|
from sqlframe.base.functions import rank as rank
|
|
226
|
+
from sqlframe.base.functions import regexp_like as regexp_like
|
|
199
227
|
from sqlframe.base.functions import regexp_replace as regexp_replace
|
|
200
228
|
from sqlframe.base.functions import repeat as repeat
|
|
201
229
|
from sqlframe.base.functions import reverse as reverse
|
|
230
|
+
from sqlframe.base.functions import right as right
|
|
231
|
+
from sqlframe.base.functions import rlike as rlike
|
|
202
232
|
from sqlframe.base.functions import round as round
|
|
203
233
|
from sqlframe.base.functions import row_number as row_number
|
|
204
234
|
from sqlframe.base.functions import rpad as rpad
|
|
205
235
|
from sqlframe.base.functions import rtrim as rtrim
|
|
206
236
|
from sqlframe.base.functions import sec as sec
|
|
237
|
+
from sqlframe.base.functions import sha as sha
|
|
207
238
|
from sqlframe.base.functions import shiftLeft as shiftLeft
|
|
208
239
|
from sqlframe.base.functions import shiftleft as shiftleft
|
|
209
240
|
from sqlframe.base.functions import shiftRight as shiftRight
|
|
210
241
|
from sqlframe.base.functions import shiftright as shiftright
|
|
242
|
+
from sqlframe.base.functions import sign as sign
|
|
211
243
|
from sqlframe.base.functions import signum as signum
|
|
212
244
|
from sqlframe.base.functions import sin as sin
|
|
213
245
|
from sqlframe.base.functions import sinh as sinh
|
|
214
246
|
from sqlframe.base.functions import size as size
|
|
215
247
|
from sqlframe.base.functions import soundex as soundex
|
|
216
248
|
from sqlframe.base.functions import sqrt as sqrt
|
|
249
|
+
from sqlframe.base.functions import startswith as startswith
|
|
217
250
|
from sqlframe.base.functions import stddev as stddev
|
|
218
251
|
from sqlframe.base.functions import stddev_pop as stddev_pop
|
|
219
252
|
from sqlframe.base.functions import stddev_samp as stddev_samp
|
|
@@ -231,9 +264,12 @@ from sqlframe.base.functions import toRadians as toRadians
|
|
|
231
264
|
from sqlframe.base.functions import translate as translate
|
|
232
265
|
from sqlframe.base.functions import trim as trim
|
|
233
266
|
from sqlframe.base.functions import trunc as trunc
|
|
267
|
+
from sqlframe.base.functions import ucase as ucase
|
|
234
268
|
from sqlframe.base.functions import unbase64 as unbase64
|
|
235
269
|
from sqlframe.base.functions import unhex as unhex
|
|
270
|
+
from sqlframe.base.functions import unix_date as unix_date
|
|
236
271
|
from sqlframe.base.functions import upper as upper
|
|
272
|
+
from sqlframe.base.functions import user as user
|
|
237
273
|
from sqlframe.base.functions import var_pop as var_pop
|
|
238
274
|
from sqlframe.base.functions import var_samp as var_samp
|
|
239
275
|
from sqlframe.base.functions import variance as variance
|
sqlframe/duckdb/functions.py
CHANGED
|
@@ -18,6 +18,7 @@ globals().update(
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
21
|
+
any_value_always_ignore_nulls as any_value,
|
|
21
22
|
e_literal as e,
|
|
22
23
|
expm1_from_exp as expm1,
|
|
23
24
|
log1p_from_log as log1p,
|
|
@@ -44,4 +45,6 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
44
45
|
array_min_from_sort as array_min,
|
|
45
46
|
array_max_from_sort as array_max,
|
|
46
47
|
sequence_from_generate_series as sequence,
|
|
48
|
+
try_element_at_zero_based as try_element_at,
|
|
49
|
+
to_unix_timestamp_include_default_format as to_unix_timestamp,
|
|
47
50
|
)
|
sqlframe/duckdb/functions.pyi
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
2
|
+
any_value_always_ignore_nulls as any_value,
|
|
2
3
|
e_literal as e,
|
|
3
4
|
expm1_from_exp as expm1,
|
|
4
5
|
log1p_from_log as log1p,
|
|
@@ -25,6 +26,8 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
25
26
|
array_min_from_sort as array_min,
|
|
26
27
|
array_max_from_sort as array_max,
|
|
27
28
|
sequence_from_generate_series as sequence,
|
|
29
|
+
try_element_at_zero_based as try_element_at,
|
|
30
|
+
to_unix_timestamp_include_default_format as to_unix_timestamp,
|
|
28
31
|
)
|
|
29
32
|
from sqlframe.base.functions import (
|
|
30
33
|
abs as abs,
|
|
@@ -50,9 +53,13 @@ from sqlframe.base.functions import (
|
|
|
50
53
|
bit_length as bit_length,
|
|
51
54
|
bitwiseNOT as bitwiseNOT,
|
|
52
55
|
bitwise_not as bitwise_not,
|
|
56
|
+
bool_and as bool_and,
|
|
57
|
+
bool_or as bool_or,
|
|
58
|
+
call_function as call_function,
|
|
53
59
|
cbrt as cbrt,
|
|
54
60
|
ceil as ceil,
|
|
55
61
|
ceiling as ceiling,
|
|
62
|
+
char as char,
|
|
56
63
|
coalesce as coalesce,
|
|
57
64
|
col as col,
|
|
58
65
|
collect_list as collect_list,
|
|
@@ -64,17 +71,21 @@ from sqlframe.base.functions import (
|
|
|
64
71
|
count as count,
|
|
65
72
|
countDistinct as countDistinct,
|
|
66
73
|
count_distinct as count_distinct,
|
|
74
|
+
count_if as count_if,
|
|
67
75
|
covar_pop as covar_pop,
|
|
68
76
|
covar_samp as covar_samp,
|
|
69
77
|
create_map as create_map,
|
|
70
78
|
cume_dist as cume_dist,
|
|
71
79
|
current_date as current_date,
|
|
72
80
|
current_timestamp as current_timestamp,
|
|
81
|
+
current_user as current_user,
|
|
73
82
|
date_add as date_add,
|
|
74
83
|
date_diff as date_diff,
|
|
75
84
|
date_format as date_format,
|
|
76
85
|
date_sub as date_sub,
|
|
77
86
|
date_trunc as date_trunc,
|
|
87
|
+
dateadd as dateadd,
|
|
88
|
+
datediff as datediff,
|
|
78
89
|
dayofmonth as dayofmonth,
|
|
79
90
|
dayofweek as dayofweek,
|
|
80
91
|
dayofyear as dayofyear,
|
|
@@ -87,6 +98,7 @@ from sqlframe.base.functions import (
|
|
|
87
98
|
exp as exp,
|
|
88
99
|
explode as explode,
|
|
89
100
|
expr as expr,
|
|
101
|
+
extract as extract,
|
|
90
102
|
flatten as flatten,
|
|
91
103
|
floor as floor,
|
|
92
104
|
from_unixtime as from_unixtime,
|
|
@@ -96,16 +108,20 @@ from sqlframe.base.functions import (
|
|
|
96
108
|
hash as hash,
|
|
97
109
|
hex as hex,
|
|
98
110
|
hour as hour,
|
|
111
|
+
ifnull as ifnull,
|
|
99
112
|
input_file_name as input_file_name,
|
|
100
113
|
instr as instr,
|
|
101
114
|
isnan as isnan,
|
|
102
115
|
lag as lag,
|
|
103
116
|
last as last,
|
|
117
|
+
lcase as lcase,
|
|
104
118
|
lead as lead,
|
|
105
119
|
least as least,
|
|
120
|
+
left as left,
|
|
106
121
|
length as length,
|
|
107
122
|
levenshtein as levenshtein,
|
|
108
123
|
lit as lit,
|
|
124
|
+
ln as ln,
|
|
109
125
|
locate as locate,
|
|
110
126
|
log as log,
|
|
111
127
|
log10 as log10,
|
|
@@ -124,19 +140,27 @@ from sqlframe.base.functions import (
|
|
|
124
140
|
minute as minute,
|
|
125
141
|
month as month,
|
|
126
142
|
months_between as months_between,
|
|
143
|
+
now as now,
|
|
127
144
|
nth_value as nth_value,
|
|
128
145
|
ntile as ntile,
|
|
129
146
|
nullif as nullif,
|
|
147
|
+
nvl as nvl,
|
|
148
|
+
nvl2 as nvl2,
|
|
130
149
|
percent_rank as percent_rank,
|
|
131
150
|
percentile as percentile,
|
|
151
|
+
position as position,
|
|
132
152
|
pow as pow,
|
|
153
|
+
power as power,
|
|
133
154
|
quarter as quarter,
|
|
134
155
|
radians as radians,
|
|
135
156
|
rank as rank,
|
|
136
157
|
regexp_extract as regexp_extract,
|
|
158
|
+
regexp_like as regexp_like,
|
|
137
159
|
regexp_replace as regexp_replace,
|
|
138
160
|
repeat as repeat,
|
|
139
161
|
reverse as reverse,
|
|
162
|
+
right as right,
|
|
163
|
+
rlike as rlike,
|
|
140
164
|
round as round,
|
|
141
165
|
row_number as row_number,
|
|
142
166
|
rpad as rpad,
|
|
@@ -146,6 +170,7 @@ from sqlframe.base.functions import (
|
|
|
146
170
|
shiftRight as shiftRight,
|
|
147
171
|
shiftleft as shiftleft,
|
|
148
172
|
shiftright as shiftright,
|
|
173
|
+
sign as sign,
|
|
149
174
|
signum as signum,
|
|
150
175
|
sin as sin,
|
|
151
176
|
size as size,
|
|
@@ -153,6 +178,7 @@ from sqlframe.base.functions import (
|
|
|
153
178
|
sort_array as sort_array,
|
|
154
179
|
soundex as soundex,
|
|
155
180
|
sqrt as sqrt,
|
|
181
|
+
startswith as startswith,
|
|
156
182
|
stddev as stddev,
|
|
157
183
|
stddev_pop as stddev_pop,
|
|
158
184
|
stddev_samp as stddev_samp,
|
|
@@ -171,10 +197,13 @@ from sqlframe.base.functions import (
|
|
|
171
197
|
trim as trim,
|
|
172
198
|
trunc as trunc,
|
|
173
199
|
typeof as typeof,
|
|
200
|
+
ucase as ucase,
|
|
174
201
|
unbase64 as unbase64,
|
|
175
202
|
unhex as unhex,
|
|
203
|
+
unix_date as unix_date,
|
|
176
204
|
unix_timestamp as unix_timestamp,
|
|
177
205
|
upper as upper,
|
|
206
|
+
user as user,
|
|
178
207
|
var_pop as var_pop,
|
|
179
208
|
var_samp as var_samp,
|
|
180
209
|
variance as variance,
|
sqlframe/postgres/functions.py
CHANGED
|
@@ -16,6 +16,7 @@ globals().update(
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
19
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
19
20
|
e_literal as e,
|
|
20
21
|
expm1_from_exp as expm1,
|
|
21
22
|
log1p_from_log as log1p,
|
|
@@ -40,6 +41,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
40
41
|
date_add_by_multiplication as date_add,
|
|
41
42
|
date_sub_by_multiplication as date_sub,
|
|
42
43
|
date_diff_with_subtraction as date_diff,
|
|
44
|
+
date_diff_with_subtraction as datediff,
|
|
43
45
|
add_months_by_multiplication as add_months,
|
|
44
46
|
months_between_from_age_and_extract as months_between,
|
|
45
47
|
from_unixtime_from_timestamp as from_unixtime,
|
|
@@ -58,4 +60,8 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
58
60
|
get_json_object_using_arrow_op as get_json_object,
|
|
59
61
|
array_min_from_subquery as array_min,
|
|
60
62
|
array_max_from_subquery as array_max,
|
|
63
|
+
left_cast_len as left,
|
|
64
|
+
right_cast_len as right,
|
|
65
|
+
position_cast_start as position,
|
|
66
|
+
try_element_at_zero_based as try_element_at,
|
|
61
67
|
)
|
sqlframe/postgres/functions.pyi
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
2
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
2
3
|
e_literal as e,
|
|
3
4
|
expm1_from_exp as expm1,
|
|
4
5
|
log1p_from_log as log1p,
|
|
@@ -23,6 +24,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
23
24
|
date_add_by_multiplication as date_add,
|
|
24
25
|
date_sub_by_multiplication as date_sub,
|
|
25
26
|
date_diff_with_subtraction as date_diff,
|
|
27
|
+
date_diff_with_subtraction as datediff,
|
|
26
28
|
add_months_by_multiplication as add_months,
|
|
27
29
|
months_between_from_age_and_extract as months_between,
|
|
28
30
|
from_unixtime_from_timestamp as from_unixtime,
|
|
@@ -41,6 +43,10 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
41
43
|
get_json_object_using_arrow_op as get_json_object,
|
|
42
44
|
array_min_from_subquery as array_min,
|
|
43
45
|
array_max_from_subquery as array_max,
|
|
46
|
+
left_cast_len as left,
|
|
47
|
+
right_cast_len as right,
|
|
48
|
+
position_cast_start as position,
|
|
49
|
+
try_element_at_zero_based as try_element_at,
|
|
44
50
|
)
|
|
45
51
|
from sqlframe.base.functions import (
|
|
46
52
|
abs as abs,
|
|
@@ -64,9 +70,13 @@ from sqlframe.base.functions import (
|
|
|
64
70
|
bit_length as bit_length,
|
|
65
71
|
bitwiseNOT as bitwiseNOT,
|
|
66
72
|
bitwise_not as bitwise_not,
|
|
73
|
+
bool_and as bool_and,
|
|
74
|
+
bool_or as bool_or,
|
|
75
|
+
call_function as call_function,
|
|
67
76
|
cbrt as cbrt,
|
|
68
77
|
ceil as ceil,
|
|
69
78
|
ceiling as ceiling,
|
|
79
|
+
char as char,
|
|
70
80
|
coalesce as coalesce,
|
|
71
81
|
col as col,
|
|
72
82
|
collect_list as collect_list,
|
|
@@ -84,8 +94,10 @@ from sqlframe.base.functions import (
|
|
|
84
94
|
cume_dist as cume_dist,
|
|
85
95
|
current_date as current_date,
|
|
86
96
|
current_timestamp as current_timestamp,
|
|
97
|
+
current_user as current_user,
|
|
87
98
|
date_format as date_format,
|
|
88
99
|
date_trunc as date_trunc,
|
|
100
|
+
dateadd as dateadd,
|
|
89
101
|
degrees as degrees,
|
|
90
102
|
dense_rank as dense_rank,
|
|
91
103
|
desc as desc,
|
|
@@ -94,18 +106,22 @@ from sqlframe.base.functions import (
|
|
|
94
106
|
exp as exp,
|
|
95
107
|
explode as explode,
|
|
96
108
|
expr as expr,
|
|
109
|
+
extract as extract,
|
|
97
110
|
factorial as factorial,
|
|
98
111
|
floor as floor,
|
|
99
112
|
greatest as greatest,
|
|
113
|
+
ifnull as ifnull,
|
|
100
114
|
initcap as initcap,
|
|
101
115
|
input_file_name as input_file_name,
|
|
102
116
|
instr as instr,
|
|
103
117
|
lag as lag,
|
|
118
|
+
lcase as lcase,
|
|
104
119
|
lead as lead,
|
|
105
120
|
least as least,
|
|
106
121
|
length as length,
|
|
107
122
|
levenshtein as levenshtein,
|
|
108
123
|
lit as lit,
|
|
124
|
+
ln as ln,
|
|
109
125
|
locate as locate,
|
|
110
126
|
log as log,
|
|
111
127
|
log10 as log10,
|
|
@@ -117,19 +133,25 @@ from sqlframe.base.functions import (
|
|
|
117
133
|
md5 as md5,
|
|
118
134
|
mean as mean,
|
|
119
135
|
min as min,
|
|
136
|
+
now as now,
|
|
120
137
|
nth_value as nth_value,
|
|
121
138
|
ntile as ntile,
|
|
122
139
|
nullif as nullif,
|
|
140
|
+
nvl as nvl,
|
|
141
|
+
nvl2 as nvl2,
|
|
123
142
|
octet_length as octet_length,
|
|
124
143
|
overlay as overlay,
|
|
125
144
|
percent_rank as percent_rank,
|
|
126
145
|
percentile as percentile,
|
|
127
146
|
pow as pow,
|
|
147
|
+
power as power,
|
|
128
148
|
radians as radians,
|
|
129
149
|
rank as rank,
|
|
150
|
+
regexp_like as regexp_like,
|
|
130
151
|
regexp_replace as regexp_replace,
|
|
131
152
|
repeat as repeat,
|
|
132
153
|
reverse as reverse,
|
|
154
|
+
rlike as rlike,
|
|
133
155
|
row_number as row_number,
|
|
134
156
|
rpad as rpad,
|
|
135
157
|
rtrim as rtrim,
|
|
@@ -137,12 +159,14 @@ from sqlframe.base.functions import (
|
|
|
137
159
|
shiftRight as shiftRight,
|
|
138
160
|
shiftleft as shiftleft,
|
|
139
161
|
shiftright as shiftright,
|
|
162
|
+
sign as sign,
|
|
140
163
|
signum as signum,
|
|
141
164
|
sin as sin,
|
|
142
165
|
sinh as sinh,
|
|
143
166
|
size as size,
|
|
144
167
|
soundex as soundex,
|
|
145
168
|
sqrt as sqrt,
|
|
169
|
+
startswith as startswith,
|
|
146
170
|
stddev as stddev,
|
|
147
171
|
stddev_pop as stddev_pop,
|
|
148
172
|
stddev_samp as stddev_samp,
|
|
@@ -156,11 +180,15 @@ from sqlframe.base.functions import (
|
|
|
156
180
|
toDegrees as toDegrees,
|
|
157
181
|
toRadians as toRadians,
|
|
158
182
|
to_date as to_date,
|
|
183
|
+
to_number as to_number,
|
|
159
184
|
to_timestamp as to_timestamp,
|
|
160
185
|
translate as translate,
|
|
161
186
|
trim as trim,
|
|
162
187
|
trunc as trunc,
|
|
188
|
+
ucase as ucase,
|
|
189
|
+
unix_date as unix_date,
|
|
163
190
|
upper as upper,
|
|
191
|
+
user as user,
|
|
164
192
|
var_pop as var_pop,
|
|
165
193
|
var_samp as var_samp,
|
|
166
194
|
variance as variance,
|
sqlframe/snowflake/functions.py
CHANGED
|
@@ -16,6 +16,7 @@ globals().update(
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
19
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
19
20
|
e_literal as e,
|
|
20
21
|
expm1_from_exp as expm1,
|
|
21
22
|
log1p_from_log as log1p,
|
|
@@ -32,6 +33,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
32
33
|
struct_with_eq as struct,
|
|
33
34
|
make_date_date_from_parts as make_date,
|
|
34
35
|
date_add_no_date_sub as date_add,
|
|
36
|
+
date_add_no_date_sub as dateadd,
|
|
35
37
|
date_sub_by_date_add as date_sub,
|
|
36
38
|
add_months_using_func as add_months,
|
|
37
39
|
months_between_cast_as_date_cast_roundoff as months_between,
|
|
@@ -60,4 +62,5 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
60
62
|
flatten_using_array_flatten as flatten,
|
|
61
63
|
map_concat_using_map_cat as map_concat,
|
|
62
64
|
sequence_from_array_generate_range as sequence,
|
|
65
|
+
to_number_using_to_double as to_number,
|
|
63
66
|
)
|
sqlframe/snowflake/functions.pyi
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from sqlframe.base.function_alternatives import ( # noqa
|
|
2
|
+
any_value_ignore_nulls_not_supported as any_value,
|
|
2
3
|
e_literal as e,
|
|
3
4
|
expm1_from_exp as expm1,
|
|
4
5
|
log1p_from_log as log1p,
|
|
@@ -15,6 +16,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
15
16
|
struct_with_eq as struct,
|
|
16
17
|
make_date_date_from_parts as make_date,
|
|
17
18
|
date_add_no_date_sub as date_add,
|
|
19
|
+
date_add_no_date_sub as dateadd,
|
|
18
20
|
date_sub_by_date_add as date_sub,
|
|
19
21
|
add_months_using_func as add_months,
|
|
20
22
|
months_between_cast_as_date_cast_roundoff as months_between,
|
|
@@ -43,6 +45,7 @@ from sqlframe.base.function_alternatives import ( # noqa
|
|
|
43
45
|
flatten_using_array_flatten as flatten,
|
|
44
46
|
map_concat_using_map_cat as map_concat,
|
|
45
47
|
sequence_from_array_generate_range as sequence,
|
|
48
|
+
to_number_using_to_double as to_number,
|
|
46
49
|
)
|
|
47
50
|
from sqlframe.base.functions import (
|
|
48
51
|
abs as abs,
|
|
@@ -69,9 +72,13 @@ from sqlframe.base.functions import (
|
|
|
69
72
|
avg as avg,
|
|
70
73
|
bit_length as bit_length,
|
|
71
74
|
bitwiseNOT as bitwiseNOT,
|
|
75
|
+
bool_and as bool_and,
|
|
76
|
+
bool_or as bool_or,
|
|
77
|
+
call_function as call_function,
|
|
72
78
|
cbrt as cbrt,
|
|
73
79
|
ceil as ceil,
|
|
74
80
|
ceiling as ceiling,
|
|
81
|
+
char as char,
|
|
75
82
|
coalesce as coalesce,
|
|
76
83
|
col as col,
|
|
77
84
|
collect_list as collect_list,
|
|
@@ -85,14 +92,17 @@ from sqlframe.base.functions import (
|
|
|
85
92
|
count as count,
|
|
86
93
|
countDistinct as countDistinct,
|
|
87
94
|
count_distinct as count_distinct,
|
|
95
|
+
count_if as count_if,
|
|
88
96
|
covar_pop as covar_pop,
|
|
89
97
|
covar_samp as covar_samp,
|
|
90
98
|
cume_dist as cume_dist,
|
|
91
99
|
current_date as current_date,
|
|
92
100
|
current_timestamp as current_timestamp,
|
|
101
|
+
current_user as current_user,
|
|
93
102
|
date_diff as date_diff,
|
|
94
103
|
date_format as date_format,
|
|
95
104
|
date_trunc as date_trunc,
|
|
105
|
+
datediff as datediff,
|
|
96
106
|
dayofmonth as dayofmonth,
|
|
97
107
|
dayofweek as dayofweek,
|
|
98
108
|
dayofyear as dayofyear,
|
|
@@ -104,21 +114,26 @@ from sqlframe.base.functions import (
|
|
|
104
114
|
exp as exp,
|
|
105
115
|
explode as explode,
|
|
106
116
|
expr as expr,
|
|
117
|
+
extract as extract,
|
|
107
118
|
factorial as factorial,
|
|
108
119
|
floor as floor,
|
|
109
120
|
greatest as greatest,
|
|
110
121
|
grouping_id as grouping_id,
|
|
111
122
|
hash as hash,
|
|
112
123
|
hour as hour,
|
|
124
|
+
ifnull as ifnull,
|
|
113
125
|
initcap as initcap,
|
|
114
126
|
input_file_name as input_file_name,
|
|
115
127
|
instr as instr,
|
|
116
128
|
kurtosis as kurtosis,
|
|
117
129
|
lag as lag,
|
|
130
|
+
lcase as lcase,
|
|
118
131
|
lead as lead,
|
|
119
132
|
least as least,
|
|
133
|
+
left as left,
|
|
120
134
|
length as length,
|
|
121
135
|
lit as lit,
|
|
136
|
+
ln as ln,
|
|
122
137
|
locate as locate,
|
|
123
138
|
log as log,
|
|
124
139
|
log10 as log10,
|
|
@@ -136,35 +151,44 @@ from sqlframe.base.functions import (
|
|
|
136
151
|
minute as minute,
|
|
137
152
|
month as month,
|
|
138
153
|
next_day as next_day,
|
|
154
|
+
now as now,
|
|
139
155
|
nth_value as nth_value,
|
|
140
156
|
ntile as ntile,
|
|
141
157
|
nullif as nullif,
|
|
158
|
+
nvl as nvl,
|
|
159
|
+
nvl2 as nvl2,
|
|
142
160
|
octet_length as octet_length,
|
|
143
161
|
percent_rank as percent_rank,
|
|
144
162
|
percentile as percentile,
|
|
145
163
|
posexplode as posexplode,
|
|
164
|
+
position as position,
|
|
146
165
|
pow as pow,
|
|
166
|
+
power as power,
|
|
147
167
|
quarter as quarter,
|
|
148
168
|
radians as radians,
|
|
149
169
|
rand as rand,
|
|
150
170
|
rank as rank,
|
|
151
171
|
regexp_replace as regexp_replace,
|
|
152
172
|
repeat as repeat,
|
|
173
|
+
right as right,
|
|
153
174
|
round as round,
|
|
154
175
|
row_number as row_number,
|
|
155
176
|
rpad as rpad,
|
|
156
177
|
rtrim as rtrim,
|
|
157
178
|
second as second,
|
|
179
|
+
sha as sha,
|
|
158
180
|
sha1 as sha1,
|
|
159
181
|
sha2 as sha2,
|
|
160
182
|
shiftLeft as shiftLeft,
|
|
161
183
|
shiftRight as shiftRight,
|
|
184
|
+
sign as sign,
|
|
162
185
|
signum as signum,
|
|
163
186
|
sin as sin,
|
|
164
187
|
sinh as sinh,
|
|
165
188
|
size as size,
|
|
166
189
|
soundex as soundex,
|
|
167
190
|
sqrt as sqrt,
|
|
191
|
+
startswith as startswith,
|
|
168
192
|
stddev as stddev,
|
|
169
193
|
stddev_pop as stddev_pop,
|
|
170
194
|
stddev_samp as stddev_samp,
|
|
@@ -182,7 +206,10 @@ from sqlframe.base.functions import (
|
|
|
182
206
|
translate as translate,
|
|
183
207
|
trim as trim,
|
|
184
208
|
trunc as trunc,
|
|
209
|
+
ucase as ucase,
|
|
210
|
+
unix_date as unix_date,
|
|
185
211
|
upper as upper,
|
|
212
|
+
user as user,
|
|
186
213
|
var_pop as var_pop,
|
|
187
214
|
var_samp as var_samp,
|
|
188
215
|
variance as variance,
|