@hdnax/sqlingo.js 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.repo.md +1 -2
- package/dist/chunk-2YNOERAO.cjs +2 -0
- package/dist/chunk-2YNOERAO.cjs.map +1 -0
- package/dist/chunk-2Z3O2CFM.cjs +19 -0
- package/dist/chunk-2Z3O2CFM.cjs.map +1 -0
- package/dist/chunk-4ZMKB6PV.cjs +2 -0
- package/dist/chunk-4ZMKB6PV.cjs.map +1 -0
- package/dist/chunk-53OWF4GG.js +2 -0
- package/dist/chunk-53OWF4GG.js.map +1 -0
- package/dist/chunk-C4CLTVOW.cjs +2 -0
- package/dist/chunk-C4CLTVOW.cjs.map +1 -0
- package/dist/chunk-DOKMTZYO.cjs +4 -0
- package/dist/chunk-DOKMTZYO.cjs.map +1 -0
- package/dist/chunk-FCGUTI7Y.js +2 -0
- package/dist/chunk-FCGUTI7Y.js.map +1 -0
- package/dist/chunk-IPCIXWCY.js +2 -0
- package/dist/chunk-IPCIXWCY.js.map +1 -0
- package/dist/chunk-KCNOE4DZ.js +19 -0
- package/dist/chunk-KCNOE4DZ.js.map +1 -0
- package/dist/chunk-NRJHX2GZ.js +2 -0
- package/dist/chunk-NRJHX2GZ.js.map +1 -0
- package/dist/chunk-O2J5RKBN.js +2 -0
- package/dist/chunk-O2J5RKBN.js.map +1 -0
- package/dist/chunk-PXUASP5I.js +2 -0
- package/dist/chunk-PXUASP5I.js.map +1 -0
- package/dist/chunk-R7C3ZHVK.cjs +2 -0
- package/dist/chunk-R7C3ZHVK.cjs.map +1 -0
- package/dist/chunk-UHWHUDLE.cjs +2 -0
- package/dist/chunk-UHWHUDLE.cjs.map +1 -0
- package/dist/chunk-WRNYJ54A.cjs +2 -0
- package/dist/chunk-WRNYJ54A.cjs.map +1 -0
- package/dist/chunk-XZQFOICX.cjs +3 -0
- package/dist/chunk-XZQFOICX.cjs.map +1 -0
- package/dist/chunk-YLOQRUXC.js +2 -0
- package/dist/chunk-YLOQRUXC.js.map +1 -0
- package/dist/chunk-YSS2WVCM.cjs +2 -0
- package/dist/chunk-YSS2WVCM.cjs.map +1 -0
- package/dist/chunk-Z5V6VOIN.js +3 -0
- package/dist/chunk-Z5V6VOIN.js.map +1 -0
- package/dist/chunk-ZBFGQPJR.js +4 -0
- package/dist/chunk-ZBFGQPJR.js.map +1 -0
- package/dist/dialects/athena.cjs +2 -0
- package/dist/dialects/athena.cjs.map +1 -0
- package/dist/dialects/athena.d.cts +66 -0
- package/dist/dialects/athena.d.ts +66 -0
- package/dist/dialects/athena.js +2 -0
- package/dist/dialects/athena.js.map +1 -0
- package/dist/dialects/bigquery.cjs +3 -0
- package/dist/dialects/bigquery.cjs.map +1 -0
- package/dist/dialects/bigquery.d.cts +651 -0
- package/dist/dialects/bigquery.d.ts +651 -0
- package/dist/dialects/bigquery.js +3 -0
- package/dist/dialects/bigquery.js.map +1 -0
- package/dist/dialects/clickhouse.cjs +2 -0
- package/dist/dialects/clickhouse.cjs.map +1 -0
- package/dist/dialects/clickhouse.d.cts +634 -0
- package/dist/dialects/clickhouse.d.ts +634 -0
- package/dist/dialects/clickhouse.js +2 -0
- package/dist/dialects/clickhouse.js.map +1 -0
- package/dist/dialects/databricks.cjs +2 -0
- package/dist/dialects/databricks.cjs.map +1 -0
- package/dist/dialects/databricks.d.cts +484 -0
- package/dist/dialects/databricks.d.ts +484 -0
- package/dist/dialects/databricks.js +2 -0
- package/dist/dialects/databricks.js.map +1 -0
- package/dist/dialects/doris.cjs +2 -0
- package/dist/dialects/doris.cjs.map +1 -0
- package/dist/dialects/doris.d.cts +484 -0
- package/dist/dialects/doris.d.ts +484 -0
- package/dist/dialects/doris.js +2 -0
- package/dist/dialects/doris.js.map +1 -0
- package/dist/dialects/dremio.cjs +2 -0
- package/dist/dialects/dremio.cjs.map +1 -0
- package/dist/dialects/dremio.d.cts +522 -0
- package/dist/dialects/dremio.d.ts +522 -0
- package/dist/dialects/dremio.js +2 -0
- package/dist/dialects/dremio.js.map +1 -0
- package/dist/dialects/drill.cjs +2 -0
- package/dist/dialects/drill.cjs.map +1 -0
- package/dist/dialects/drill.d.cts +512 -0
- package/dist/dialects/drill.d.ts +512 -0
- package/dist/dialects/drill.js +2 -0
- package/dist/dialects/drill.js.map +1 -0
- package/dist/dialects/druid.cjs +2 -0
- package/dist/dialects/druid.cjs.map +1 -0
- package/dist/dialects/druid.d.cts +17 -0
- package/dist/dialects/druid.d.ts +17 -0
- package/dist/dialects/druid.js +2 -0
- package/dist/dialects/druid.js.map +1 -0
- package/dist/dialects/duckdb.cjs +86 -0
- package/dist/dialects/duckdb.cjs.map +1 -0
- package/dist/dialects/duckdb.d.cts +756 -0
- package/dist/dialects/duckdb.d.ts +756 -0
- package/dist/dialects/duckdb.js +86 -0
- package/dist/dialects/duckdb.js.map +1 -0
- package/dist/dialects/dune.cjs +2 -0
- package/dist/dialects/dune.cjs.map +1 -0
- package/dist/dialects/dune.d.cts +21 -0
- package/dist/dialects/dune.d.ts +21 -0
- package/dist/dialects/dune.js +2 -0
- package/dist/dialects/dune.js.map +1 -0
- package/dist/dialects/exasol.cjs +2 -0
- package/dist/dialects/exasol.cjs.map +1 -0
- package/dist/dialects/exasol.d.cts +507 -0
- package/dist/dialects/exasol.d.ts +507 -0
- package/dist/dialects/exasol.js +2 -0
- package/dist/dialects/exasol.js.map +1 -0
- package/dist/dialects/fabric.cjs +2 -0
- package/dist/dialects/fabric.cjs.map +1 -0
- package/dist/dialects/fabric.d.cts +463 -0
- package/dist/dialects/fabric.d.ts +463 -0
- package/dist/dialects/fabric.js +2 -0
- package/dist/dialects/fabric.js.map +1 -0
- package/dist/dialects/hive.cjs +2 -0
- package/dist/dialects/hive.cjs.map +1 -0
- package/dist/dialects/hive.d.cts +585 -0
- package/dist/dialects/hive.d.ts +585 -0
- package/dist/dialects/hive.js +2 -0
- package/dist/dialects/hive.js.map +1 -0
- package/dist/dialects/materialize.cjs +2 -0
- package/dist/dialects/materialize.cjs.map +1 -0
- package/dist/dialects/materialize.d.cts +890 -0
- package/dist/dialects/materialize.d.ts +890 -0
- package/dist/dialects/materialize.js +2 -0
- package/dist/dialects/materialize.js.map +1 -0
- package/dist/dialects/mysql.cjs +2 -0
- package/dist/dialects/mysql.cjs.map +1 -0
- package/dist/dialects/mysql.d.cts +292 -0
- package/dist/dialects/mysql.d.ts +292 -0
- package/dist/dialects/mysql.js +2 -0
- package/dist/dialects/mysql.js.map +1 -0
- package/dist/dialects/oracle.cjs +2 -0
- package/dist/dialects/oracle.cjs.map +1 -0
- package/dist/dialects/oracle.d.cts +539 -0
- package/dist/dialects/oracle.d.ts +539 -0
- package/dist/dialects/oracle.js +2 -0
- package/dist/dialects/oracle.js.map +1 -0
- package/dist/dialects/postgres.cjs +2 -0
- package/dist/dialects/postgres.cjs.map +1 -0
- package/dist/dialects/postgres.d.cts +587 -0
- package/dist/dialects/postgres.d.ts +587 -0
- package/dist/dialects/postgres.js +2 -0
- package/dist/dialects/postgres.js.map +1 -0
- package/dist/dialects/presto.cjs +2 -0
- package/dist/dialects/presto.cjs.map +1 -0
- package/dist/dialects/presto.d.cts +173 -0
- package/dist/dialects/presto.d.ts +173 -0
- package/dist/dialects/presto.js +2 -0
- package/dist/dialects/presto.js.map +1 -0
- package/dist/dialects/prql.cjs +2 -0
- package/dist/dialects/prql.cjs.map +1 -0
- package/dist/dialects/prql.d.cts +496 -0
- package/dist/dialects/prql.d.ts +496 -0
- package/dist/dialects/prql.js +2 -0
- package/dist/dialects/prql.js.map +1 -0
- package/dist/dialects/redshift.cjs +2 -0
- package/dist/dialects/redshift.cjs.map +1 -0
- package/dist/dialects/redshift.d.cts +132 -0
- package/dist/dialects/redshift.d.ts +132 -0
- package/dist/dialects/redshift.js +2 -0
- package/dist/dialects/redshift.js.map +1 -0
- package/dist/dialects/risingwave.cjs +2 -0
- package/dist/dialects/risingwave.cjs.map +1 -0
- package/dist/dialects/risingwave.d.cts +478 -0
- package/dist/dialects/risingwave.d.ts +478 -0
- package/dist/dialects/risingwave.js +2 -0
- package/dist/dialects/risingwave.js.map +1 -0
- package/dist/dialects/singlestore.cjs +2 -0
- package/dist/dialects/singlestore.cjs.map +1 -0
- package/dist/dialects/singlestore.d.cts +73 -0
- package/dist/dialects/singlestore.d.ts +73 -0
- package/dist/dialects/singlestore.js +2 -0
- package/dist/dialects/singlestore.js.map +1 -0
- package/dist/dialects/snowflake.cjs +3 -0
- package/dist/dialects/snowflake.cjs.map +1 -0
- package/dist/dialects/snowflake.d.cts +320 -0
- package/dist/dialects/snowflake.d.ts +320 -0
- package/dist/dialects/snowflake.js +3 -0
- package/dist/dialects/snowflake.js.map +1 -0
- package/dist/dialects/solr.cjs +2 -0
- package/dist/dialects/solr.cjs.map +1 -0
- package/dist/dialects/solr.d.cts +458 -0
- package/dist/dialects/solr.d.ts +458 -0
- package/dist/dialects/solr.js +2 -0
- package/dist/dialects/solr.js.map +1 -0
- package/dist/dialects/spark.cjs +2 -0
- package/dist/dialects/spark.cjs.map +1 -0
- package/dist/dialects/spark.d.cts +484 -0
- package/dist/dialects/spark.d.ts +484 -0
- package/dist/dialects/spark.js +2 -0
- package/dist/dialects/spark.js.map +1 -0
- package/dist/dialects/spark2.cjs +2 -0
- package/dist/dialects/spark2.cjs.map +1 -0
- package/dist/dialects/spark2.d.cts +486 -0
- package/dist/dialects/spark2.d.ts +486 -0
- package/dist/dialects/spark2.js +2 -0
- package/dist/dialects/spark2.js.map +1 -0
- package/dist/dialects/sqlite.cjs +2 -0
- package/dist/dialects/sqlite.cjs.map +1 -0
- package/dist/dialects/sqlite.d.cts +510 -0
- package/dist/dialects/sqlite.d.ts +510 -0
- package/dist/dialects/sqlite.js +2 -0
- package/dist/dialects/sqlite.js.map +1 -0
- package/dist/dialects/starrocks.cjs +2 -0
- package/dist/dialects/starrocks.cjs.map +1 -0
- package/dist/dialects/starrocks.d.cts +518 -0
- package/dist/dialects/starrocks.d.ts +518 -0
- package/dist/dialects/starrocks.js +2 -0
- package/dist/dialects/starrocks.js.map +1 -0
- package/dist/dialects/tableau.cjs +2 -0
- package/dist/dialects/tableau.cjs.map +1 -0
- package/dist/dialects/tableau.d.cts +466 -0
- package/dist/dialects/tableau.d.ts +466 -0
- package/dist/dialects/tableau.js +2 -0
- package/dist/dialects/tableau.js.map +1 -0
- package/dist/dialects/teradata.cjs +2 -0
- package/dist/dialects/teradata.cjs.map +1 -0
- package/dist/dialects/teradata.d.cts +539 -0
- package/dist/dialects/teradata.d.ts +539 -0
- package/dist/dialects/teradata.js +2 -0
- package/dist/dialects/teradata.js.map +1 -0
- package/dist/dialects/trino.cjs +2 -0
- package/dist/dialects/trino.cjs.map +1 -0
- package/dist/dialects/trino.d.cts +465 -0
- package/dist/dialects/trino.d.ts +465 -0
- package/dist/dialects/trino.js +2 -0
- package/dist/dialects/trino.js.map +1 -0
- package/dist/dialects/tsql.cjs +2 -0
- package/dist/dialects/tsql.cjs.map +1 -0
- package/dist/dialects/tsql.d.cts +703 -0
- package/dist/dialects/tsql.d.ts +703 -0
- package/dist/dialects/tsql.js +2 -0
- package/dist/dialects/tsql.js.map +1 -0
- package/dist/index.cjs +5 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -14178
- package/dist/index.d.ts +3 -14178
- package/dist/index.js +5 -25
- package/dist/index.js.map +1 -1
- package/dist/tokens-VcMD09XM.d.cts +15805 -0
- package/dist/tokens-VcMD09XM.d.ts +15805 -0
- package/package.json +171 -5
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import { c as Dialect, d as Dialects, aH as NullOrdering, m as Tokenizer, _ as TokenPair, i as Parser, l as TokenType, E as Expression, at as CastExpr, G as Generator, b5 as DataTypeExpr } from '../tokens-VcMD09XM.js';
|
|
2
|
+
|
|
3
|
+
declare class DremioTokenizer extends Tokenizer {
|
|
4
|
+
static get COMMENTS(): TokenPair[];
|
|
5
|
+
}
|
|
6
|
+
declare class DremioParser extends Parser {
|
|
7
|
+
static get ID_VAR_TOKENS(): Set<TokenType>;
|
|
8
|
+
static get NO_PAREN_FUNCTIONS(): {
|
|
9
|
+
lParen?: typeof Expression | undefined;
|
|
10
|
+
rParen?: typeof Expression | undefined;
|
|
11
|
+
lBracket?: typeof Expression | undefined;
|
|
12
|
+
rBracket?: typeof Expression | undefined;
|
|
13
|
+
lBrace?: typeof Expression | undefined;
|
|
14
|
+
rBrace?: typeof Expression | undefined;
|
|
15
|
+
comma?: typeof Expression | undefined;
|
|
16
|
+
dot?: typeof Expression | undefined;
|
|
17
|
+
dash?: typeof Expression | undefined;
|
|
18
|
+
plus?: typeof Expression | undefined;
|
|
19
|
+
colon?: typeof Expression | undefined;
|
|
20
|
+
dotcolon?: typeof Expression | undefined;
|
|
21
|
+
dcolon?: typeof Expression | undefined;
|
|
22
|
+
dcolondollar?: typeof Expression | undefined;
|
|
23
|
+
dcolonpercent?: typeof Expression | undefined;
|
|
24
|
+
dcolonqmark?: typeof Expression | undefined;
|
|
25
|
+
dqmark?: typeof Expression | undefined;
|
|
26
|
+
semicolon?: typeof Expression | undefined;
|
|
27
|
+
star?: typeof Expression | undefined;
|
|
28
|
+
backslash?: typeof Expression | undefined;
|
|
29
|
+
slash?: typeof Expression | undefined;
|
|
30
|
+
lt?: typeof Expression | undefined;
|
|
31
|
+
lte?: typeof Expression | undefined;
|
|
32
|
+
gt?: typeof Expression | undefined;
|
|
33
|
+
gte?: typeof Expression | undefined;
|
|
34
|
+
not?: typeof Expression | undefined;
|
|
35
|
+
eq?: typeof Expression | undefined;
|
|
36
|
+
neq?: typeof Expression | undefined;
|
|
37
|
+
nullsafeEq?: typeof Expression | undefined;
|
|
38
|
+
colonEq?: typeof Expression | undefined;
|
|
39
|
+
colonGt?: typeof Expression | undefined;
|
|
40
|
+
ncolonGt?: typeof Expression | undefined;
|
|
41
|
+
and?: typeof Expression | undefined;
|
|
42
|
+
or?: typeof Expression | undefined;
|
|
43
|
+
amp?: typeof Expression | undefined;
|
|
44
|
+
dpipe?: typeof Expression | undefined;
|
|
45
|
+
pipeGt?: typeof Expression | undefined;
|
|
46
|
+
pipe?: typeof Expression | undefined;
|
|
47
|
+
pipeSlash?: typeof Expression | undefined;
|
|
48
|
+
dpipeSlash?: typeof Expression | undefined;
|
|
49
|
+
caret?: typeof Expression | undefined;
|
|
50
|
+
caretAt?: typeof Expression | undefined;
|
|
51
|
+
tilde?: typeof Expression | undefined;
|
|
52
|
+
arrow?: typeof Expression | undefined;
|
|
53
|
+
darrow?: typeof Expression | undefined;
|
|
54
|
+
farrow?: typeof Expression | undefined;
|
|
55
|
+
hash?: typeof Expression | undefined;
|
|
56
|
+
hashArrow?: typeof Expression | undefined;
|
|
57
|
+
dhashArrow?: typeof Expression | undefined;
|
|
58
|
+
lrArrow?: typeof Expression | undefined;
|
|
59
|
+
dat?: typeof Expression | undefined;
|
|
60
|
+
ltAt?: typeof Expression | undefined;
|
|
61
|
+
atGt?: typeof Expression | undefined;
|
|
62
|
+
dollar?: typeof Expression | undefined;
|
|
63
|
+
parameter?: typeof Expression | undefined;
|
|
64
|
+
session?: typeof Expression | undefined;
|
|
65
|
+
sessionParameter?: typeof Expression | undefined;
|
|
66
|
+
sessionUser?: typeof Expression | undefined;
|
|
67
|
+
damp?: typeof Expression | undefined;
|
|
68
|
+
ampLt?: typeof Expression | undefined;
|
|
69
|
+
ampGt?: typeof Expression | undefined;
|
|
70
|
+
adjacent?: typeof Expression | undefined;
|
|
71
|
+
xor?: typeof Expression | undefined;
|
|
72
|
+
dstar?: typeof Expression | undefined;
|
|
73
|
+
qmarkAmp?: typeof Expression | undefined;
|
|
74
|
+
qmarkPipe?: typeof Expression | undefined;
|
|
75
|
+
hashDash?: typeof Expression | undefined;
|
|
76
|
+
exclamation?: typeof Expression | undefined;
|
|
77
|
+
uriStart?: typeof Expression | undefined;
|
|
78
|
+
blockStart?: typeof Expression | undefined;
|
|
79
|
+
blockEnd?: typeof Expression | undefined;
|
|
80
|
+
space?: typeof Expression | undefined;
|
|
81
|
+
break?: typeof Expression | undefined;
|
|
82
|
+
string?: typeof Expression | undefined;
|
|
83
|
+
number?: typeof Expression | undefined;
|
|
84
|
+
identifier?: typeof Expression | undefined;
|
|
85
|
+
database?: typeof Expression | undefined;
|
|
86
|
+
column?: typeof Expression | undefined;
|
|
87
|
+
columnDef?: typeof Expression | undefined;
|
|
88
|
+
schema?: typeof Expression | undefined;
|
|
89
|
+
table?: typeof Expression | undefined;
|
|
90
|
+
warehouse?: typeof Expression | undefined;
|
|
91
|
+
stage?: typeof Expression | undefined;
|
|
92
|
+
streamlit?: typeof Expression | undefined;
|
|
93
|
+
var?: typeof Expression | undefined;
|
|
94
|
+
bitString?: typeof Expression | undefined;
|
|
95
|
+
hexString?: typeof Expression | undefined;
|
|
96
|
+
byteString?: typeof Expression | undefined;
|
|
97
|
+
nationalString?: typeof Expression | undefined;
|
|
98
|
+
rawString?: typeof Expression | undefined;
|
|
99
|
+
heredocString?: typeof Expression | undefined;
|
|
100
|
+
unicodeString?: typeof Expression | undefined;
|
|
101
|
+
bit?: typeof Expression | undefined;
|
|
102
|
+
boolean?: typeof Expression | undefined;
|
|
103
|
+
tinyint?: typeof Expression | undefined;
|
|
104
|
+
utinyint?: typeof Expression | undefined;
|
|
105
|
+
smallint?: typeof Expression | undefined;
|
|
106
|
+
usmallint?: typeof Expression | undefined;
|
|
107
|
+
mediumint?: typeof Expression | undefined;
|
|
108
|
+
umediumint?: typeof Expression | undefined;
|
|
109
|
+
int?: typeof Expression | undefined;
|
|
110
|
+
uint?: typeof Expression | undefined;
|
|
111
|
+
bigint?: typeof Expression | undefined;
|
|
112
|
+
ubigint?: typeof Expression | undefined;
|
|
113
|
+
bignum?: typeof Expression | undefined;
|
|
114
|
+
int128?: typeof Expression | undefined;
|
|
115
|
+
uint128?: typeof Expression | undefined;
|
|
116
|
+
int256?: typeof Expression | undefined;
|
|
117
|
+
uint256?: typeof Expression | undefined;
|
|
118
|
+
float?: typeof Expression | undefined;
|
|
119
|
+
double?: typeof Expression | undefined;
|
|
120
|
+
udouble?: typeof Expression | undefined;
|
|
121
|
+
decimal?: typeof Expression | undefined;
|
|
122
|
+
decimal32?: typeof Expression | undefined;
|
|
123
|
+
decimal64?: typeof Expression | undefined;
|
|
124
|
+
decimal128?: typeof Expression | undefined;
|
|
125
|
+
decimal256?: typeof Expression | undefined;
|
|
126
|
+
decfloat?: typeof Expression | undefined;
|
|
127
|
+
udecimal?: typeof Expression | undefined;
|
|
128
|
+
bigdecimal?: typeof Expression | undefined;
|
|
129
|
+
char?: typeof Expression | undefined;
|
|
130
|
+
nchar?: typeof Expression | undefined;
|
|
131
|
+
varchar?: typeof Expression | undefined;
|
|
132
|
+
nvarchar?: typeof Expression | undefined;
|
|
133
|
+
bpchar?: typeof Expression | undefined;
|
|
134
|
+
text?: typeof Expression | undefined;
|
|
135
|
+
mediumtext?: typeof Expression | undefined;
|
|
136
|
+
longtext?: typeof Expression | undefined;
|
|
137
|
+
blob?: typeof Expression | undefined;
|
|
138
|
+
mediumblob?: typeof Expression | undefined;
|
|
139
|
+
longblob?: typeof Expression | undefined;
|
|
140
|
+
tinyblob?: typeof Expression | undefined;
|
|
141
|
+
tinytext?: typeof Expression | undefined;
|
|
142
|
+
name?: typeof Expression | undefined;
|
|
143
|
+
binary?: typeof Expression | undefined;
|
|
144
|
+
varbinary?: typeof Expression | undefined;
|
|
145
|
+
json?: typeof Expression | undefined;
|
|
146
|
+
jsonb?: typeof Expression | undefined;
|
|
147
|
+
time?: typeof Expression | undefined;
|
|
148
|
+
timetz?: typeof Expression | undefined;
|
|
149
|
+
timeNs?: typeof Expression | undefined;
|
|
150
|
+
timestamp?: typeof Expression | undefined;
|
|
151
|
+
timestamptz?: typeof Expression | undefined;
|
|
152
|
+
timestampltz?: typeof Expression | undefined;
|
|
153
|
+
timestampntz?: typeof Expression | undefined;
|
|
154
|
+
timestampS?: typeof Expression | undefined;
|
|
155
|
+
timestampMs?: typeof Expression | undefined;
|
|
156
|
+
timestampNs?: typeof Expression | undefined;
|
|
157
|
+
datetime?: typeof Expression | undefined;
|
|
158
|
+
datetime2?: typeof Expression | undefined;
|
|
159
|
+
datetime64?: typeof Expression | undefined;
|
|
160
|
+
smalldatetime?: typeof Expression | undefined;
|
|
161
|
+
date?: typeof Expression | undefined;
|
|
162
|
+
date32?: typeof Expression | undefined;
|
|
163
|
+
int4range?: typeof Expression | undefined;
|
|
164
|
+
int4multirange?: typeof Expression | undefined;
|
|
165
|
+
int8range?: typeof Expression | undefined;
|
|
166
|
+
int8multirange?: typeof Expression | undefined;
|
|
167
|
+
numrange?: typeof Expression | undefined;
|
|
168
|
+
nummultirange?: typeof Expression | undefined;
|
|
169
|
+
tsrange?: typeof Expression | undefined;
|
|
170
|
+
tsmultirange?: typeof Expression | undefined;
|
|
171
|
+
tstzrange?: typeof Expression | undefined;
|
|
172
|
+
tstzmultirange?: typeof Expression | undefined;
|
|
173
|
+
daterange?: typeof Expression | undefined;
|
|
174
|
+
datemultirange?: typeof Expression | undefined;
|
|
175
|
+
uuid?: typeof Expression | undefined;
|
|
176
|
+
geography?: typeof Expression | undefined;
|
|
177
|
+
geographypoint?: typeof Expression | undefined;
|
|
178
|
+
nullable?: typeof Expression | undefined;
|
|
179
|
+
geometry?: typeof Expression | undefined;
|
|
180
|
+
point?: typeof Expression | undefined;
|
|
181
|
+
ring?: typeof Expression | undefined;
|
|
182
|
+
linestring?: typeof Expression | undefined;
|
|
183
|
+
localtime?: typeof Expression | undefined;
|
|
184
|
+
localtimestamp?: typeof Expression | undefined;
|
|
185
|
+
systimestamp?: typeof Expression | undefined;
|
|
186
|
+
multilinestring?: typeof Expression | undefined;
|
|
187
|
+
polygon?: typeof Expression | undefined;
|
|
188
|
+
multipolygon?: typeof Expression | undefined;
|
|
189
|
+
hllsketch?: typeof Expression | undefined;
|
|
190
|
+
hstore?: typeof Expression | undefined;
|
|
191
|
+
super?: typeof Expression | undefined;
|
|
192
|
+
serial?: typeof Expression | undefined;
|
|
193
|
+
smallserial?: typeof Expression | undefined;
|
|
194
|
+
bigserial?: typeof Expression | undefined;
|
|
195
|
+
xml?: typeof Expression | undefined;
|
|
196
|
+
year?: typeof Expression | undefined;
|
|
197
|
+
userdefined?: typeof Expression | undefined;
|
|
198
|
+
money?: typeof Expression | undefined;
|
|
199
|
+
smallmoney?: typeof Expression | undefined;
|
|
200
|
+
rowversion?: typeof Expression | undefined;
|
|
201
|
+
image?: typeof Expression | undefined;
|
|
202
|
+
variant?: typeof Expression | undefined;
|
|
203
|
+
object?: typeof Expression | undefined;
|
|
204
|
+
inet?: typeof Expression | undefined;
|
|
205
|
+
ipaddress?: typeof Expression | undefined;
|
|
206
|
+
ipprefix?: typeof Expression | undefined;
|
|
207
|
+
ipv4?: typeof Expression | undefined;
|
|
208
|
+
ipv6?: typeof Expression | undefined;
|
|
209
|
+
enum?: typeof Expression | undefined;
|
|
210
|
+
enum8?: typeof Expression | undefined;
|
|
211
|
+
enum16?: typeof Expression | undefined;
|
|
212
|
+
fixedstring?: typeof Expression | undefined;
|
|
213
|
+
lowcardinality?: typeof Expression | undefined;
|
|
214
|
+
nested?: typeof Expression | undefined;
|
|
215
|
+
aggregatefunction?: typeof Expression | undefined;
|
|
216
|
+
simpleaggregatefunction?: typeof Expression | undefined;
|
|
217
|
+
tdigest?: typeof Expression | undefined;
|
|
218
|
+
unknown?: typeof Expression | undefined;
|
|
219
|
+
vector?: typeof Expression | undefined;
|
|
220
|
+
dynamic?: typeof Expression | undefined;
|
|
221
|
+
void?: typeof Expression | undefined;
|
|
222
|
+
alias?: typeof Expression | undefined;
|
|
223
|
+
alter?: typeof Expression | undefined;
|
|
224
|
+
all?: typeof Expression | undefined;
|
|
225
|
+
anti?: typeof Expression | undefined;
|
|
226
|
+
any?: typeof Expression | undefined;
|
|
227
|
+
apply?: typeof Expression | undefined;
|
|
228
|
+
array?: typeof Expression | undefined;
|
|
229
|
+
asc?: typeof Expression | undefined;
|
|
230
|
+
asof?: typeof Expression | undefined;
|
|
231
|
+
attach?: typeof Expression | undefined;
|
|
232
|
+
autoIncrement?: typeof Expression | undefined;
|
|
233
|
+
begin?: typeof Expression | undefined;
|
|
234
|
+
between?: typeof Expression | undefined;
|
|
235
|
+
bulkCollectInto?: typeof Expression | undefined;
|
|
236
|
+
cache?: typeof Expression | undefined;
|
|
237
|
+
case?: typeof Expression | undefined;
|
|
238
|
+
characterSet?: typeof Expression | undefined;
|
|
239
|
+
clusterBy?: typeof Expression | undefined;
|
|
240
|
+
collate?: typeof Expression | undefined;
|
|
241
|
+
command?: typeof Expression | undefined;
|
|
242
|
+
comment?: typeof Expression | undefined;
|
|
243
|
+
commit?: typeof Expression | undefined;
|
|
244
|
+
connectBy?: typeof Expression | undefined;
|
|
245
|
+
constraint?: typeof Expression | undefined;
|
|
246
|
+
copy?: typeof Expression | undefined;
|
|
247
|
+
create?: typeof Expression | undefined;
|
|
248
|
+
cross?: typeof Expression | undefined;
|
|
249
|
+
cube?: typeof Expression | undefined;
|
|
250
|
+
currentDate?: typeof Expression | undefined;
|
|
251
|
+
currentDatetime?: typeof Expression | undefined;
|
|
252
|
+
currentSchema?: typeof Expression | undefined;
|
|
253
|
+
currentTime?: typeof Expression | undefined;
|
|
254
|
+
currentTimestamp?: typeof Expression | undefined;
|
|
255
|
+
currentUser?: typeof Expression | undefined;
|
|
256
|
+
currentRole?: typeof Expression | undefined;
|
|
257
|
+
currentCatalog?: typeof Expression | undefined;
|
|
258
|
+
declare?: typeof Expression | undefined;
|
|
259
|
+
default?: typeof Expression | undefined;
|
|
260
|
+
delete?: typeof Expression | undefined;
|
|
261
|
+
desc?: typeof Expression | undefined;
|
|
262
|
+
describe?: typeof Expression | undefined;
|
|
263
|
+
detach?: typeof Expression | undefined;
|
|
264
|
+
dictionary?: typeof Expression | undefined;
|
|
265
|
+
distinct?: typeof Expression | undefined;
|
|
266
|
+
distributeBy?: typeof Expression | undefined;
|
|
267
|
+
div?: typeof Expression | undefined;
|
|
268
|
+
drop?: typeof Expression | undefined;
|
|
269
|
+
else?: typeof Expression | undefined;
|
|
270
|
+
end?: typeof Expression | undefined;
|
|
271
|
+
escape?: typeof Expression | undefined;
|
|
272
|
+
except?: typeof Expression | undefined;
|
|
273
|
+
execute?: typeof Expression | undefined;
|
|
274
|
+
exists?: typeof Expression | undefined;
|
|
275
|
+
false?: typeof Expression | undefined;
|
|
276
|
+
fetch?: typeof Expression | undefined;
|
|
277
|
+
file?: typeof Expression | undefined;
|
|
278
|
+
fileFormat?: typeof Expression | undefined;
|
|
279
|
+
filter?: typeof Expression | undefined;
|
|
280
|
+
final?: typeof Expression | undefined;
|
|
281
|
+
first?: typeof Expression | undefined;
|
|
282
|
+
for?: typeof Expression | undefined;
|
|
283
|
+
force?: typeof Expression | undefined;
|
|
284
|
+
foreignKey?: typeof Expression | undefined;
|
|
285
|
+
format?: typeof Expression | undefined;
|
|
286
|
+
from?: typeof Expression | undefined;
|
|
287
|
+
full?: typeof Expression | undefined;
|
|
288
|
+
function?: typeof Expression | undefined;
|
|
289
|
+
get?: typeof Expression | undefined;
|
|
290
|
+
glob?: typeof Expression | undefined;
|
|
291
|
+
global?: typeof Expression | undefined;
|
|
292
|
+
grant?: typeof Expression | undefined;
|
|
293
|
+
groupBy?: typeof Expression | undefined;
|
|
294
|
+
groupingSets?: typeof Expression | undefined;
|
|
295
|
+
having?: typeof Expression | undefined;
|
|
296
|
+
hint?: typeof Expression | undefined;
|
|
297
|
+
ignore?: typeof Expression | undefined;
|
|
298
|
+
ilike?: typeof Expression | undefined;
|
|
299
|
+
in?: typeof Expression | undefined;
|
|
300
|
+
index?: typeof Expression | undefined;
|
|
301
|
+
indexedBy?: typeof Expression | undefined;
|
|
302
|
+
inner?: typeof Expression | undefined;
|
|
303
|
+
insert?: typeof Expression | undefined;
|
|
304
|
+
install?: typeof Expression | undefined;
|
|
305
|
+
intersect?: typeof Expression | undefined;
|
|
306
|
+
interval?: typeof Expression | undefined;
|
|
307
|
+
into?: typeof Expression | undefined;
|
|
308
|
+
introducer?: typeof Expression | undefined;
|
|
309
|
+
irlike?: typeof Expression | undefined;
|
|
310
|
+
is?: typeof Expression | undefined;
|
|
311
|
+
isnull?: typeof Expression | undefined;
|
|
312
|
+
join?: typeof Expression | undefined;
|
|
313
|
+
joinMarker?: typeof Expression | undefined;
|
|
314
|
+
keep?: typeof Expression | undefined;
|
|
315
|
+
key?: typeof Expression | undefined;
|
|
316
|
+
kill?: typeof Expression | undefined;
|
|
317
|
+
language?: typeof Expression | undefined;
|
|
318
|
+
lateral?: typeof Expression | undefined;
|
|
319
|
+
left?: typeof Expression | undefined;
|
|
320
|
+
like?: typeof Expression | undefined;
|
|
321
|
+
limit?: typeof Expression | undefined;
|
|
322
|
+
list?: typeof Expression | undefined;
|
|
323
|
+
load?: typeof Expression | undefined;
|
|
324
|
+
lock?: typeof Expression | undefined;
|
|
325
|
+
map?: typeof Expression | undefined;
|
|
326
|
+
match?: typeof Expression | undefined;
|
|
327
|
+
matchCondition?: typeof Expression | undefined;
|
|
328
|
+
matchRecognize?: typeof Expression | undefined;
|
|
329
|
+
memberOf?: typeof Expression | undefined;
|
|
330
|
+
merge?: typeof Expression | undefined;
|
|
331
|
+
mod?: typeof Expression | undefined;
|
|
332
|
+
model?: typeof Expression | undefined;
|
|
333
|
+
natural?: typeof Expression | undefined;
|
|
334
|
+
next?: typeof Expression | undefined;
|
|
335
|
+
nothing?: typeof Expression | undefined;
|
|
336
|
+
notnull?: typeof Expression | undefined;
|
|
337
|
+
null?: typeof Expression | undefined;
|
|
338
|
+
objectIdentifier?: typeof Expression | undefined;
|
|
339
|
+
offset?: typeof Expression | undefined;
|
|
340
|
+
on?: typeof Expression | undefined;
|
|
341
|
+
only?: typeof Expression | undefined;
|
|
342
|
+
operator?: typeof Expression | undefined;
|
|
343
|
+
orderBy?: typeof Expression | undefined;
|
|
344
|
+
orderSiblingsBy?: typeof Expression | undefined;
|
|
345
|
+
ordered?: typeof Expression | undefined;
|
|
346
|
+
ordinality?: typeof Expression | undefined;
|
|
347
|
+
out?: typeof Expression | undefined;
|
|
348
|
+
inout?: typeof Expression | undefined;
|
|
349
|
+
outer?: typeof Expression | undefined;
|
|
350
|
+
over?: typeof Expression | undefined;
|
|
351
|
+
overlaps?: typeof Expression | undefined;
|
|
352
|
+
overwrite?: typeof Expression | undefined;
|
|
353
|
+
partition?: typeof Expression | undefined;
|
|
354
|
+
partitionBy?: typeof Expression | undefined;
|
|
355
|
+
percent?: typeof Expression | undefined;
|
|
356
|
+
pivot?: typeof Expression | undefined;
|
|
357
|
+
placeholder?: typeof Expression | undefined;
|
|
358
|
+
positional?: typeof Expression | undefined;
|
|
359
|
+
pragma?: typeof Expression | undefined;
|
|
360
|
+
prewhere?: typeof Expression | undefined;
|
|
361
|
+
primaryKey?: typeof Expression | undefined;
|
|
362
|
+
procedure?: typeof Expression | undefined;
|
|
363
|
+
properties?: typeof Expression | undefined;
|
|
364
|
+
pseudoType?: typeof Expression | undefined;
|
|
365
|
+
put?: typeof Expression | undefined;
|
|
366
|
+
qualify?: typeof Expression | undefined;
|
|
367
|
+
quote?: typeof Expression | undefined;
|
|
368
|
+
qdcolon?: typeof Expression | undefined;
|
|
369
|
+
range?: typeof Expression | undefined;
|
|
370
|
+
recursive?: typeof Expression | undefined;
|
|
371
|
+
refresh?: typeof Expression | undefined;
|
|
372
|
+
rename?: typeof Expression | undefined;
|
|
373
|
+
replace?: typeof Expression | undefined;
|
|
374
|
+
returning?: typeof Expression | undefined;
|
|
375
|
+
revoke?: typeof Expression | undefined;
|
|
376
|
+
references?: typeof Expression | undefined;
|
|
377
|
+
right?: typeof Expression | undefined;
|
|
378
|
+
rlike?: typeof Expression | undefined;
|
|
379
|
+
rollback?: typeof Expression | undefined;
|
|
380
|
+
rollup?: typeof Expression | undefined;
|
|
381
|
+
row?: typeof Expression | undefined;
|
|
382
|
+
rows?: typeof Expression | undefined;
|
|
383
|
+
select?: typeof Expression | undefined;
|
|
384
|
+
semi?: typeof Expression | undefined;
|
|
385
|
+
separator?: typeof Expression | undefined;
|
|
386
|
+
sequence?: typeof Expression | undefined;
|
|
387
|
+
serdeProperties?: typeof Expression | undefined;
|
|
388
|
+
set?: typeof Expression | undefined;
|
|
389
|
+
settings?: typeof Expression | undefined;
|
|
390
|
+
show?: typeof Expression | undefined;
|
|
391
|
+
similarTo?: typeof Expression | undefined;
|
|
392
|
+
some?: typeof Expression | undefined;
|
|
393
|
+
sortBy?: typeof Expression | undefined;
|
|
394
|
+
soundsLike?: typeof Expression | undefined;
|
|
395
|
+
startWith?: typeof Expression | undefined;
|
|
396
|
+
storageIntegration?: typeof Expression | undefined;
|
|
397
|
+
straightJoin?: typeof Expression | undefined;
|
|
398
|
+
struct?: typeof Expression | undefined;
|
|
399
|
+
summarize?: typeof Expression | undefined;
|
|
400
|
+
tableSample?: typeof Expression | undefined;
|
|
401
|
+
tag?: typeof Expression | undefined;
|
|
402
|
+
temporary?: typeof Expression | undefined;
|
|
403
|
+
top?: typeof Expression | undefined;
|
|
404
|
+
then?: typeof Expression | undefined;
|
|
405
|
+
true?: typeof Expression | undefined;
|
|
406
|
+
truncate?: typeof Expression | undefined;
|
|
407
|
+
uncache?: typeof Expression | undefined;
|
|
408
|
+
union?: typeof Expression | undefined;
|
|
409
|
+
unnest?: typeof Expression | undefined;
|
|
410
|
+
unpivot?: typeof Expression | undefined;
|
|
411
|
+
update?: typeof Expression | undefined;
|
|
412
|
+
use?: typeof Expression | undefined;
|
|
413
|
+
using?: typeof Expression | undefined;
|
|
414
|
+
values?: typeof Expression | undefined;
|
|
415
|
+
variadic?: typeof Expression | undefined;
|
|
416
|
+
view?: typeof Expression | undefined;
|
|
417
|
+
semanticView?: typeof Expression | undefined;
|
|
418
|
+
volatile?: typeof Expression | undefined;
|
|
419
|
+
when?: typeof Expression | undefined;
|
|
420
|
+
where?: typeof Expression | undefined;
|
|
421
|
+
window?: typeof Expression | undefined;
|
|
422
|
+
with?: typeof Expression | undefined;
|
|
423
|
+
unique?: typeof Expression | undefined;
|
|
424
|
+
utcDate?: typeof Expression | undefined;
|
|
425
|
+
utcTime?: typeof Expression | undefined;
|
|
426
|
+
utcTimestamp?: typeof Expression | undefined;
|
|
427
|
+
versionSnapshot?: typeof Expression | undefined;
|
|
428
|
+
timestampSnapshot?: typeof Expression | undefined;
|
|
429
|
+
option?: typeof Expression | undefined;
|
|
430
|
+
sink?: typeof Expression | undefined;
|
|
431
|
+
source?: typeof Expression | undefined;
|
|
432
|
+
analyze?: typeof Expression | undefined;
|
|
433
|
+
namespace?: typeof Expression | undefined;
|
|
434
|
+
export?: typeof Expression | undefined;
|
|
435
|
+
hiveTokenStream?: typeof Expression | undefined;
|
|
436
|
+
};
|
|
437
|
+
static LOG_DEFAULTS_TO_LN: boolean;
|
|
438
|
+
static get NO_PAREN_FUNCTION_PARSERS(): Partial<Record<string, (this: Parser) => Expression | undefined>>;
|
|
439
|
+
static get FUNCTIONS(): Record<string, (args: Expression[], options: {
|
|
440
|
+
dialect: Dialect;
|
|
441
|
+
}) => Expression>;
|
|
442
|
+
parseCurrentDateUtc(): CastExpr;
|
|
443
|
+
static get TABLE_ALIAS_TOKENS(): Set<TokenType>;
|
|
444
|
+
}
|
|
445
|
+
declare class DremioGenerator extends Generator {
|
|
446
|
+
static get AFTER_HAVING_MODIFIER_TRANSFORMS(): Map<string, (this: Generator, e: Expression) => string>;
|
|
447
|
+
static SUPPORTS_DECODE_CASE: boolean;
|
|
448
|
+
static readonly SELECT_KINDS: string[];
|
|
449
|
+
static TRY_SUPPORTED: boolean;
|
|
450
|
+
static SUPPORTS_UESCAPE: boolean;
|
|
451
|
+
static NVL2_SUPPORTED: boolean;
|
|
452
|
+
static SUPPORTS_CONVERT_TIMEZONE: boolean;
|
|
453
|
+
static INTERVAL_ALLOWS_PLURAL_FORM: boolean;
|
|
454
|
+
static JOIN_HINTS: boolean;
|
|
455
|
+
static LIMIT_ONLY_LITERALS: boolean;
|
|
456
|
+
static MULTI_ARG_DISTINCT: boolean;
|
|
457
|
+
static SUPPORTS_BETWEEN_FLAGS: boolean;
|
|
458
|
+
static get TYPE_MAPPING(): Map<string, string>;
|
|
459
|
+
static get ORIGINAL_TRANSFORMS(): Map<typeof Expression, (this: Generator, e: any) => string>;
|
|
460
|
+
dataTypeSql(expression: DataTypeExpr): string;
|
|
461
|
+
castSql(expression: CastExpr, options?: {
|
|
462
|
+
safePrefix?: string;
|
|
463
|
+
}): string;
|
|
464
|
+
}
|
|
465
|
+
declare class Dremio extends Dialect {
|
|
466
|
+
static DIALECT_NAME: Dialects;
|
|
467
|
+
static SUPPORTS_USER_DEFINED_TYPES: boolean;
|
|
468
|
+
static CONCAT_COALESCE: boolean;
|
|
469
|
+
static TYPED_DIVISION: boolean;
|
|
470
|
+
static SUPPORTS_SEMI_ANTI_JOIN: boolean;
|
|
471
|
+
static get NULL_ORDERING(): NullOrdering;
|
|
472
|
+
static SUPPORTS_VALUES_DEFAULT: boolean;
|
|
473
|
+
static get TIME_MAPPING(): {
|
|
474
|
+
YYYY: string;
|
|
475
|
+
yyyy: string;
|
|
476
|
+
YY: string;
|
|
477
|
+
yy: string;
|
|
478
|
+
MM: string;
|
|
479
|
+
mm: string;
|
|
480
|
+
MON: string;
|
|
481
|
+
mon: string;
|
|
482
|
+
MONTH: string;
|
|
483
|
+
month: string;
|
|
484
|
+
DDD: string;
|
|
485
|
+
ddd: string;
|
|
486
|
+
DD: string;
|
|
487
|
+
dd: string;
|
|
488
|
+
DY: string;
|
|
489
|
+
dy: string;
|
|
490
|
+
DAY: string;
|
|
491
|
+
day: string;
|
|
492
|
+
HH24: string;
|
|
493
|
+
hh24: string;
|
|
494
|
+
HH12: string;
|
|
495
|
+
hh12: string;
|
|
496
|
+
HH: string;
|
|
497
|
+
hh: string;
|
|
498
|
+
MI: string;
|
|
499
|
+
mi: string;
|
|
500
|
+
SS: string;
|
|
501
|
+
ss: string;
|
|
502
|
+
FFF: string;
|
|
503
|
+
fff: string;
|
|
504
|
+
AMPM: string;
|
|
505
|
+
ampm: string;
|
|
506
|
+
WW: string;
|
|
507
|
+
ww: string;
|
|
508
|
+
D: string;
|
|
509
|
+
d: string;
|
|
510
|
+
CC: string;
|
|
511
|
+
cc: string;
|
|
512
|
+
TZD: string;
|
|
513
|
+
tzd: string;
|
|
514
|
+
TZO: string;
|
|
515
|
+
tzo: string;
|
|
516
|
+
};
|
|
517
|
+
static Tokenizer: typeof DremioTokenizer;
|
|
518
|
+
static Parser: typeof DremioParser;
|
|
519
|
+
static Generator: typeof DremioGenerator;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export { Dremio };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$c as S,Ap as K,Cg as O,Hl as D,Kp as F,Lg as B,Lk as q,Lo as $,Mp as W,Pl as G,Qf as h,Rk as k,Rq as v,Wh as b,Xq as z,a as o,ac as l,b as N,bg as M,bn as Z,c as u,ca as Y,d as T,fe as m,fh as P,kc as x,li as V,lp as d,om as U,op as g,pm as w,pp as I,r as E,uh as L,wh as y,za as p}from"../chunk-KCNOE4DZ.js";function J(r){return function(a){let t=a.text("unit").toUpperCase();if(!t||t==="DAY")return this.func(r,[a.args.this,a.args.expression]);let s=this.sql(a,"this"),c=`CAST(${this.sql(a,"expression")} AS INTERVAL ${t})`;return`${r}(${s}, ${c})`}}function ut(r,{dialect:a}){let t=v(r,{dialect:a}),s=Y(r,1);return s&&t instanceof h&&s instanceof S&&s.isString&&s.name.includes("#")&&t.setArgKey("isNumeric",!0),t}function j(r){let a=W(r);return t=>{if(t.length===2){let[s,i]=t;if(i instanceof O&&i.args.to instanceof l&&i.args.to.args.this instanceof m){let c=i.args.to.args.this;return new r({this:s,expression:i.args.this,unit:c.args.unit})}return new r({this:s,expression:i})}return a(t)}}function It(r,{dialect:a}){let[t,s,i]=r;if(t instanceof S&&t.isNumber&&s instanceof S&&s.isNumber&&i instanceof S&&i.isNumber){let Rt=parseInt(t.args.this??"0").toString().padStart(4,"0"),_t=parseInt(s.args.this??"0").toString().padStart(2,"0"),ot=parseInt(i.args.this??"0").toString().padStart(2,"0"),Nt=`${Rt}-${_t}-${ot}`;return new V({this:S.string(Nt)})}let c=g.getOrRaise(a);return new O({this:new B({expressions:[t,S.string("-"),s,S.string("-"),i],coalesce:c._constructor.CONCAT_COALESCE}),to:l.build("DATE")})}var X,Q,H,_=class extends(Q=z,X=[E],Q){static get COMMENTS(){return["--","//",["/*","*/"]]}};H=o(Q),T(H,10,"COMMENTS",X,_),N(H,_),u(H,3,_);var tt,st,et,nt,rt,at,R,A=class extends(at=p,rt=[E],nt=[E],et=[E],st=[E],tt=[E],at){static get ID_VAR_TOKENS(){return new Set([...p.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let t={...p.NO_PAREN_FUNCTIONS};return delete t.localtime,delete t.localtimestamp,t}static get NO_PAREN_FUNCTION_PARSERS(){return{...p.NO_PAREN_FUNCTION_PARSERS,CURRENT_DATE_UTC:function(){return this.parseCurrentDateUtc()}}}static get FUNCTIONS(){return{...p.FUNCTIONS,ARRAY_GENERATE_RANGE:t=>M.fromArgList(t),BIT_AND:t=>U.fromArgList(t),BIT_OR:t=>w.fromArgList(t),DATE_ADD:j(L),DATE_FORMAT:F(D,{dialect:"dremio"}),DATE_SUB:j(y),REGEXP_MATCHES:t=>q.fromArgList(t),REPEATSTR:t=>k.fromArgList(t),TO_CHAR:ut,TO_DATE:F(G,{dialect:"dremio"}),DATE_PART:t=>b.fromArgList(t),DATETYPE:It}}parseCurrentDateUtc(){return this.match("lParen")&&this.matchRParen(),new O({this:new x({this:new P({}),zone:S.string("UTC")}),to:l.build("DATE")})}static get TABLE_ALIAS_TOKENS(){return new Set([...p.TABLE_ALIAS_TOKENS,"straightJoin"])}};R=o(at),T(R,10,"ID_VAR_TOKENS",rt,A),T(R,10,"NO_PAREN_FUNCTIONS",nt,A),T(R,10,"NO_PAREN_FUNCTION_PARSERS",et,A),T(R,10,"FUNCTIONS",st,A),T(R,10,"TABLE_ALIAS_TOKENS",tt,A),N(R,A),u(R,3,A),A.LOG_DEFAULTS_TO_LN=!0;var it,Tt,Et,At,f,e=class extends(At=d,Et=[E],Tt=[E],it=[E],At){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let t=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(s=>t.delete(s)),t}static get TYPE_MAPPING(){return new Map([...d.TYPE_MAPPING,["smallint","INT"],["tinyint","INT"],["binary","VARBINARY"],["text","VARCHAR"],["nchar","VARCHAR"],["char","VARCHAR"],["timestampntz","TIMESTAMP"],["datetime","TIMESTAMP"],["array","LIST"],["bit","BOOLEAN"]])}static get ORIGINAL_TRANSFORMS(){return new Map([...d.TRANSFORMS,[U,I("BIT_AND")],[w,I("BIT_OR")],[h,I("TO_CHAR")],[D,function(s){return this.func("TO_CHAR",[s.args.this,this.formatTime(s)])}],[Z,K],[L,J("DATE_ADD")],[y,J("DATE_SUB")],[M,I("ARRAY_GENERATE_RANGE")]])}dataTypeSql(t){return t.isType(["timestamptz","timestampltz"])&&this.unsupported("Dremio does not support time-zone-aware TIMESTAMP"),super.dataTypeSql(t)}castSql(t,s={}){let{safePrefix:i}=s;if($(t.args.to,"date")){let c=t.args.this;if(c instanceof x&&c.args.this instanceof P&&c.args.zone instanceof S&&c.text("zone").toUpperCase()==="UTC")return"CURRENT_DATE_UTC"}return super.castSql(t,{safePrefix:i})}};f=o(At),T(f,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Et,e),T(f,10,"TYPE_MAPPING",Tt,e),T(f,10,"ORIGINAL_TRANSFORMS",it,e),N(f,e),u(f,3,e),e.SUPPORTS_DECODE_CASE=!1,e.SELECT_KINDS=[],e.TRY_SUPPORTED=!1,e.SUPPORTS_UESCAPE=!1,e.NVL2_SUPPORTED=!1,e.SUPPORTS_CONVERT_TIMEZONE=!0,e.INTERVAL_ALLOWS_PLURAL_FORM=!1,e.JOIN_HINTS=!1,e.LIMIT_ONLY_LITERALS=!0,e.MULTI_ARG_DISTINCT=!1,e.SUPPORTS_BETWEEN_FLAGS=!0;var ct,St,pt,C,n=class extends(pt=g,St=[E],ct=[E],pt){static get NULL_ORDERING(){return"nulls_are_last"}static get TIME_MAPPING(){return{YYYY:"%Y",yyyy:"%Y",YY:"%y",yy:"%y",MM:"%m",mm:"%m",MON:"%b",mon:"%b",MONTH:"%B",month:"%B",DDD:"%j",ddd:"%j",DD:"%d",dd:"%d",DY:"%a",dy:"%a",DAY:"%A",day:"%A",HH24:"%H",hh24:"%H",HH12:"%I",hh12:"%I",HH:"%I",hh:"%I",MI:"%M",mi:"%M",SS:"%S",ss:"%S",FFF:"%f",fff:"%f",AMPM:"%p",ampm:"%p",WW:"%W",ww:"%W",D:"%w",d:"%w",CC:"%C",cc:"%C",TZD:"%Z",tzd:"%Z",TZO:"%z",tzo:"%z"}}};C=o(pt),T(C,10,"NULL_ORDERING",St,n),T(C,10,"TIME_MAPPING",ct,n),N(C,n),u(C,3,n),n.DIALECT_NAME="dremio",n.SUPPORTS_USER_DEFINED_TYPES=!1,n.CONCAT_COALESCE=!0,n.TYPED_DIVISION=!0,n.SUPPORTS_SEMI_ANTI_JOIN=!1,n.SUPPORTS_VALUES_DEFAULT=!1,n.Tokenizer=_,n.Parser=A,n.Generator=e;g.register("dremio",n);export{n as Dremio};
|
|
2
|
+
//# sourceMappingURL=dremio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/dialects/dremio.ts"],"sourcesContent":["import {\n cache,\n} from '../port_internals';\nimport {\n Generator,\n} from '../generator';\nimport {\n Parser,\n} from '../parser';\nimport type {\n TokenPair,\n} from '../tokens';\nimport {\n Tokenizer, TokenType,\n} from '../tokens';\nimport type {\n Expression,\n} from '../expressions';\nimport {\n DateAddExpr,\n DateSubExpr,\n isType,\n TimeToStrExpr,\n DateExpr,\n GenerateSeriesExpr,\n BitwiseAndAggExpr,\n BitwiseOrAggExpr,\n RegexpLikeExpr,\n RepeatExpr,\n ExtractExpr,\n ToCharExpr,\n TryCastExpr,\n TsOrDsToDateExpr,\n CastExpr,\n AtTimeZoneExpr,\n CurrentTimestampExpr,\n DataTypeExpr,\n DataTypeExprKind,\n LiteralExpr,\n IntervalExpr,\n ConcatExpr,\n} from '../expressions';\nimport {\n seqGet,\n} from '../helper';\nimport type {\n DialectType,\n} from './dialect';\nimport {\n buildFormattedTime,\n buildDateDelta,\n noTrycastSql,\n Dialect, Dialects,\n buildTimeToStrOrToChar,\n renameFunc,\n NullOrdering,\n} from './dialect';\n\ntype DateDeltaType = DateAddExpr | DateSubExpr;\n\nfunction dateDeltaSql (name: string): (this: Generator, expression: DateDeltaType) => string {\n return function (this: Generator, expression: DateDeltaType): string {\n const unit = expression.text('unit').toUpperCase();\n\n // Fallback to default behavior if unit is missing or 'DAY'\n if (!unit || unit === 'DAY') {\n return this.func(name, [\n expression.args.this,\n expression.args.expression,\n ]);\n }\n\n const thisSql = this.sql(expression, 'this');\n const exprSql = this.sql(expression, 'expression');\n\n const intervalSql = `CAST(${exprSql} AS INTERVAL ${unit})`;\n return `${name}(${thisSql}, ${intervalSql})`;\n };\n}\n\nfunction toCharIsNumericHandler (args: Expression[], {\n dialect,\n}: {dialect: DialectType}): TimeToStrExpr | ToCharExpr {\n const expression = buildTimeToStrOrToChar(args, {\n dialect,\n });\n const fmt = seqGet(args, 1);\n\n if (\n fmt\n && expression instanceof ToCharExpr\n && fmt instanceof LiteralExpr\n && fmt.isString\n && fmt.name.includes('#')\n ) {\n // Only mark as numeric if format is a literal containing #\n expression.setArgKey('isNumeric', true);\n }\n\n return expression;\n}\n\nfunction buildDateDeltaWithCastInterval (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n expressionClass: new (args: any) => DateDeltaType,\n): (args: Expression[]) => Expression {\n const fallbackBuilder = buildDateDelta(expressionClass);\n\n return (args: Expression[]): Expression => {\n if (args.length === 2) {\n const [\n dateArg,\n intervalArg,\n ] = args;\n\n if (\n intervalArg instanceof CastExpr\n && intervalArg.args.to instanceof DataTypeExpr\n && intervalArg.args.to.args.this instanceof IntervalExpr\n ) {\n const interval = intervalArg.args.to.args.this;\n return new expressionClass({\n this: dateArg,\n expression: intervalArg.args.this,\n unit: interval.args.unit,\n });\n }\n\n return new expressionClass({\n this: dateArg,\n expression: intervalArg,\n });\n }\n\n return fallbackBuilder(args);\n };\n}\n\nfunction dateTypeHandler (args: Expression[], {\n dialect,\n}: {dialect: DialectType}): Expression {\n const [\n year,\n month,\n day,\n ] = args;\n\n if (\n year instanceof LiteralExpr && year.isNumber\n && month instanceof LiteralExpr && month.isNumber\n && day instanceof LiteralExpr && day.isNumber\n ) {\n const y = parseInt(year.args.this ?? '0').toString()\n .padStart(4, '0');\n const m = parseInt(month.args.this ?? '0').toString()\n .padStart(2, '0');\n const d = parseInt(day.args.this ?? '0').toString()\n .padStart(2, '0');\n\n const dateStr = `${y}-${m}-${d}`;\n return new DateExpr({\n this: LiteralExpr.string(dateStr),\n });\n }\n\n const resolvedDialect = Dialect.getOrRaise(dialect);\n\n return new CastExpr({\n this: new ConcatExpr({\n expressions: [\n year,\n LiteralExpr.string('-'),\n month,\n LiteralExpr.string('-'),\n day,\n ],\n coalesce: resolvedDialect._constructor.CONCAT_COALESCE,\n }),\n to: DataTypeExpr.build('DATE'),\n });\n}\n\nclass DremioTokenizer extends Tokenizer {\n @cache\n static get COMMENTS () {\n return [\n '--',\n '//',\n [\n '/*',\n '*/',\n ] as TokenPair,\n ];\n }\n};\n\nclass DremioParser extends Parser {\n @cache\n static get ID_VAR_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.ID_VAR_TOKENS,\n TokenType.SESSION_USER,\n TokenType.CURRENT_CATALOG,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get NO_PAREN_FUNCTIONS () {\n const noParenFunctions = {\n ...Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n static LOG_DEFAULTS_TO_LN = true;\n\n @cache\n static get NO_PAREN_FUNCTION_PARSERS (): Partial<Record<string, (this: Parser) => Expression | undefined>> {\n return {\n ...Parser.NO_PAREN_FUNCTION_PARSERS,\n CURRENT_DATE_UTC: function (this: Parser) {\n return (this as DremioParser).parseCurrentDateUtc();\n },\n };\n }\n\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...Parser.FUNCTIONS,\n ARRAY_GENERATE_RANGE: (args: unknown[]) => GenerateSeriesExpr.fromArgList(args),\n BIT_AND: (args: unknown[]) => BitwiseAndAggExpr.fromArgList(args),\n BIT_OR: (args: unknown[]) => BitwiseOrAggExpr.fromArgList(args),\n DATE_ADD: buildDateDeltaWithCastInterval(DateAddExpr),\n DATE_FORMAT: buildFormattedTime(TimeToStrExpr, {\n dialect: 'dremio',\n }),\n DATE_SUB: buildDateDeltaWithCastInterval(DateSubExpr),\n REGEXP_MATCHES: (args: unknown[]) => RegexpLikeExpr.fromArgList(args),\n REPEATSTR: (args: unknown[]) => RepeatExpr.fromArgList(args),\n TO_CHAR: toCharIsNumericHandler,\n TO_DATE: buildFormattedTime(TsOrDsToDateExpr, {\n dialect: 'dremio',\n }),\n DATE_PART: (args: unknown[]) => ExtractExpr.fromArgList(args),\n DATETYPE: dateTypeHandler,\n };\n }\n\n parseCurrentDateUtc (): CastExpr {\n if (this.match(TokenType.L_PAREN)) {\n this.matchRParen();\n }\n\n return new CastExpr({\n this: new AtTimeZoneExpr({\n this: new CurrentTimestampExpr({}),\n zone: LiteralExpr.string('UTC'),\n }),\n to: DataTypeExpr.build('DATE'),\n });\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n}\nclass DremioGenerator extends Generator {\n // port from _Dialect metaclass logic\n @cache\n static get AFTER_HAVING_MODIFIER_TRANSFORMS () {\n const modifiers = new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);\n [\n 'cluster',\n 'distribute',\n 'sort',\n ].forEach((m) => modifiers.delete(m));\n return modifiers;\n }\n\n // port from _Dialect metaclass logic\n static SUPPORTS_DECODE_CASE = false;\n // port from _Dialect metaclass logic\n static readonly SELECT_KINDS: string[] = [\n ];\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static NVL2_SUPPORTED = false;\n static SUPPORTS_CONVERT_TIMEZONE = true;\n static INTERVAL_ALLOWS_PLURAL_FORM = false;\n static JOIN_HINTS = false;\n static LIMIT_ONLY_LITERALS = true;\n static MULTI_ARG_DISTINCT = false;\n static SUPPORTS_BETWEEN_FLAGS = true;\n\n @cache\n static get TYPE_MAPPING () {\n return new Map([\n ...Generator.TYPE_MAPPING,\n [\n DataTypeExprKind.SMALLINT,\n 'INT',\n ],\n [\n DataTypeExprKind.TINYINT,\n 'INT',\n ],\n [\n DataTypeExprKind.BINARY,\n 'VARBINARY',\n ],\n [\n DataTypeExprKind.TEXT,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.NCHAR,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.CHAR,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.TIMESTAMPNTZ,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.DATETIME,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.ARRAY,\n 'LIST',\n ],\n [\n DataTypeExprKind.BIT,\n 'BOOLEAN',\n ],\n ]);\n }\n\n @cache\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: any) => string> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transforms = new Map<typeof Expression, (this: Generator, e: any) => string>([\n ...Generator.TRANSFORMS,\n [\n BitwiseAndAggExpr,\n renameFunc('BIT_AND'),\n ],\n [\n BitwiseOrAggExpr,\n renameFunc('BIT_OR'),\n ],\n [\n ToCharExpr,\n renameFunc('TO_CHAR'),\n ],\n [\n TimeToStrExpr,\n function (this: Generator, e) {\n return this.func('TO_CHAR', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n ],\n [\n TryCastExpr,\n noTrycastSql,\n ],\n [\n DateAddExpr,\n dateDeltaSql('DATE_ADD'),\n ],\n [\n DateSubExpr,\n dateDeltaSql('DATE_SUB'),\n ],\n [\n GenerateSeriesExpr,\n renameFunc('ARRAY_GENERATE_RANGE'),\n ],\n ]);\n return transforms;\n }\n\n dataTypeSql (expression: DataTypeExpr): string {\n if (expression.isType([\n DataTypeExprKind.TIMESTAMPTZ,\n DataTypeExprKind.TIMESTAMPLTZ,\n ])) {\n this.unsupported('Dremio does not support time-zone-aware TIMESTAMP');\n }\n return super.dataTypeSql(expression);\n }\n\n castSql (expression: CastExpr, options: {safePrefix?: string} = {}): string {\n const {\n safePrefix,\n } = options;\n\n // Match: CAST(CURRENT_TIMESTAMP AT TIME ZONE 'UTC' AS DATE)\n if (isType(expression.args.to, DataTypeExprKind.DATE)) {\n const atTimeZone = expression.args.this;\n\n if (\n atTimeZone instanceof AtTimeZoneExpr\n && atTimeZone.args.this instanceof CurrentTimestampExpr\n && atTimeZone.args.zone instanceof LiteralExpr\n && atTimeZone.text('zone').toUpperCase() === 'UTC'\n ) {\n return 'CURRENT_DATE_UTC';\n }\n }\n\n return super.castSql(expression, {\n safePrefix,\n });\n }\n}\n\nexport class Dremio extends Dialect {\n static DIALECT_NAME = Dialects.DREMIO;\n static SUPPORTS_USER_DEFINED_TYPES = false;\n static CONCAT_COALESCE = true;\n static TYPED_DIVISION = true;\n static SUPPORTS_SEMI_ANTI_JOIN = false;\n\n @cache\n static get NULL_ORDERING () {\n return NullOrdering.NULLS_ARE_LAST;\n }\n\n static SUPPORTS_VALUES_DEFAULT = false;\n\n @cache\n static get TIME_MAPPING () {\n return {\n YYYY: '%Y',\n yyyy: '%Y',\n YY: '%y',\n yy: '%y',\n MM: '%m',\n mm: '%m',\n MON: '%b',\n mon: '%b',\n MONTH: '%B',\n month: '%B',\n DDD: '%j',\n ddd: '%j',\n DD: '%d',\n dd: '%d',\n DY: '%a',\n dy: '%a',\n DAY: '%A',\n day: '%A',\n HH24: '%H',\n hh24: '%H',\n HH12: '%I',\n hh12: '%I',\n HH: '%I',\n hh: '%I',\n MI: '%M',\n mi: '%M',\n SS: '%S',\n ss: '%S',\n FFF: '%f',\n fff: '%f',\n AMPM: '%p',\n ampm: '%p',\n WW: '%W',\n ww: '%W',\n D: '%w',\n d: '%w',\n CC: '%C',\n cc: '%C',\n TZD: '%Z',\n tzd: '%Z',\n TZO: '%z',\n tzo: '%z',\n };\n }\n\n static Tokenizer = DremioTokenizer;\n static Parser = DremioParser;\n static Generator = DremioGenerator;\n}\n\nDialect.register(Dialects.DREMIO, Dremio);\n"],"mappings":"6TA4DA,SAASA,EAAcC,EAAsE,CAC3F,OAAO,SAA2BC,EAAmC,CACnE,IAAMC,EAAOD,EAAW,KAAK,MAAM,EAAE,YAAY,EAGjD,GAAI,CAACC,GAAQA,IAAS,MACpB,OAAO,KAAK,KAAKF,EAAM,CACrBC,EAAW,KAAK,KAChBA,EAAW,KAAK,UAClB,CAAC,EAGH,IAAME,EAAU,KAAK,IAAIF,EAAY,MAAM,EAGrCG,EAAc,QAFJ,KAAK,IAAIH,EAAY,YAAY,CAEd,gBAAgBC,CAAI,IACvD,MAAO,GAAGF,CAAI,IAAIG,CAAO,KAAKC,CAAW,GAC3C,CACF,CAEA,SAASC,GAAwBC,EAAoB,CACnD,QAAAC,CACF,EAAuD,CACrD,IAAMN,EAAaO,EAAuBF,EAAM,CAC9C,QAAAC,CACF,CAAC,EACKE,EAAMC,EAAOJ,EAAM,CAAC,EAE1B,OACEG,GACGR,aAAsBU,GACtBF,aAAeG,GACfH,EAAI,UACJA,E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C,EAAAN,EAAM6C,GAANtC,EAAAP,EAAA,EAAM6C,KACJ,aAAe,SADXA,EAEJ,4BAA8B,GAF1BA,EAGJ,gBAAkB,GAHdA,EAIJ,eAAiB,GAJbA,EAKJ,wBAA0B,GALtBA,EAYJ,wBAA0B,GAZtBA,EA8DJ,UAAY5C,EA9DR4C,EA+DJ,OAAShC,EA/DLgC,EAgEJ,UAAYb,EAGrBpC,EAAQ,kBAA0BiD,CAAM","names":["dateDeltaSql","name","expression","unit","thisSql","intervalSql","toCharIsNumericHandler","args","dialect","buildTimeToStrOrToChar","fmt","seqGet","ToCharExpr","LiteralExpr","buildDateDeltaWithCastInterval","expressionClass","fallbackBuilder","buildDateDelta","dateArg","intervalArg","CastExpr","DataTypeExpr","IntervalExpr","interval","dateTypeHandler","year","month","day","y","m","d","dateStr","DateExpr","resolvedDialect","Dialect","ConcatExpr","_COMMENTS_dec","_a","_init","DremioTokenizer","Tokenizer","cache","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_FUNCTIONS_dec","_NO_PAREN_FUNCTION_PARSERS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","DremioParser","Parser","noParenFunctions","GenerateSeriesExpr","BitwiseAndAggExpr","BitwiseOrAggExpr","DateAddExpr","buildFormattedTime","TimeToStrExpr","DateSubExpr","RegexpLikeExpr","RepeatExpr","TsOrDsToDateExpr","ExtractExpr","AtTimeZoneExpr","CurrentTimestampExpr","_ORIGINAL_TRANSFORMS_dec","_TYPE_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","DremioGenerator","Generator","modifiers","renameFunc","e","TryCastExpr","noTrycastSql","options","safePrefix","isType","atTimeZone","_TIME_MAPPING_dec","_NULL_ORDERING_dec","Dremio"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkR7C3ZHVKcjs = require('../chunk-R7C3ZHVK.cjs');var _chunk2Z3O2CFMcjs = require('../chunk-2Z3O2CFM.cjs');var Rt,ct,Nt,_t,_,n=class extends(_t=_chunk2Z3O2CFMcjs.Xq,Nt=[_chunk2Z3O2CFMcjs.r],ct=[_chunk2Z3O2CFMcjs.r],Rt=[_chunk2Z3O2CFMcjs.r],_t){static get IDENTIFIERS(){return["`"]}static get STRING_ESCAPES(){return["\\"]}static get KEYWORDS(){let T={..._chunk2Z3O2CFMcjs.Xq.KEYWORDS};return delete T["/*+"],T}};_=_chunk2Z3O2CFMcjs.a.call(void 0, _t),_chunk2Z3O2CFMcjs.d.call(void 0, _,10,"IDENTIFIERS",Nt,n),_chunk2Z3O2CFMcjs.d.call(void 0, _,10,"STRING_ESCAPES",ct,n),_chunk2Z3O2CFMcjs.d.call(void 0, _,10,"KEYWORDS",Rt,n),_chunk2Z3O2CFMcjs.b.call(void 0, _,n),_chunk2Z3O2CFMcjs.c.call(void 0, _,3,n);var pt,Ot,Mt,ut,ht,a,r=class extends(ht=_chunk2Z3O2CFMcjs.za,ut=[_chunk2Z3O2CFMcjs.r],Mt=[_chunk2Z3O2CFMcjs.r],Ot=[_chunk2Z3O2CFMcjs.r],pt=[_chunk2Z3O2CFMcjs.r],ht){static get ID_VAR_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get NO_PAREN_FUNCTIONS(){let T={..._chunk2Z3O2CFMcjs.za.NO_PAREN_FUNCTIONS};return delete T.localtime,delete T.localtimestamp,T}static get FUNCTIONS(){return{..._chunk2Z3O2CFMcjs.za.FUNCTIONS,REPEATED_COUNT:T=>_chunk2Z3O2CFMcjs.xg.fromArgList(T),TO_TIMESTAMP:T=>_chunk2Z3O2CFMcjs.Kl.fromArgList(T),TO_CHAR:_chunk2Z3O2CFMcjs.Kp.call(void 0, _chunk2Z3O2CFMcjs.Hl,{dialect:"drill"}),LEVENSHTEIN_DISTANCE:T=>_chunk2Z3O2CFMcjs.Rj.fromArgList(T)}}static get TABLE_ALIAS_TOKENS(){return new Set([..._chunk2Z3O2CFMcjs.za.TABLE_ALIAS_TOKENS,"straightJoin"])}};a=_chunk2Z3O2CFMcjs.a.call(void 0, ht),_chunk2Z3O2CFMcjs.d.call(void 0, a,10,"ID_VAR_TOKENS",ut,r),_chunk2Z3O2CFMcjs.d.call(void 0, a,10,"NO_PAREN_FUNCTIONS",Mt,r),_chunk2Z3O2CFMcjs.d.call(void 0, a,10,"FUNCTIONS",Ot,r),_chunk2Z3O2CFMcjs.d.call(void 0, a,10,"TABLE_ALIAS_TOKENS",pt,r),_chunk2Z3O2CFMcjs.b.call(void 0, a,r),_chunk2Z3O2CFMcjs.c.call(void 0, a,3,r),r.STRICT_CAST=!1,r.LOG_DEFAULTS_TO_LN=!0;var mt,Pt,ft,Ct,xt,o,e=class extends(xt=_chunk2Z3O2CFMcjs.lp,Ct=[_chunk2Z3O2CFMcjs.r],ft=[_chunk2Z3O2CFMcjs.r],Pt=[_chunk2Z3O2CFMcjs.r],mt=[_chunk2Z3O2CFMcjs.r],xt){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let T=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(t=>T.delete(t)),T}static get TYPE_MAPPING(){return new Map([..._chunk2Z3O2CFMcjs.lp.TYPE_MAPPING,["int","INTEGER"],["smallint","INTEGER"],["tinyint","INTEGER"],["binary","VARBINARY"],["text","VARCHAR"],["nchar","VARCHAR"],["timestampltz","TIMESTAMP"],["timestamptz","TIMESTAMP"],["datetime","TIMESTAMP"]])}static get PROPERTIES_LOCATION(){return new Map([..._chunk2Z3O2CFMcjs.lp.PROPERTIES_LOCATION,[_chunk2Z3O2CFMcjs.ud,"postSchema"],[_chunk2Z3O2CFMcjs.Od,"unsupported"]])}static get ORIGINAL_TRANSFORMS(){return new Map([..._chunk2Z3O2CFMcjs.lp.TRANSFORMS,[_chunk2Z3O2CFMcjs.fh,()=>"CURRENT_TIMESTAMP"],[_chunk2Z3O2CFMcjs.mg,_chunk2Z3O2CFMcjs.pp.call(void 0, "REPEATED_CONTAINS")],[_chunk2Z3O2CFMcjs.Ja,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.gp])],[_chunk2Z3O2CFMcjs.uh,_chunkR7C3ZHVKcjs.g.call(void 0, "ADD")],[_chunk2Z3O2CFMcjs.ji,_chunk2Z3O2CFMcjs.Xp],[_chunk2Z3O2CFMcjs.wh,_chunkR7C3ZHVKcjs.g.call(void 0, "SUB")],[_chunk2Z3O2CFMcjs.ki,function(t){return`CAST(TO_DATE(${this.sql(t,"this")}, ${s.DATEINT_FORMAT}) AS INT)`}],[_chunk2Z3O2CFMcjs.ri,function(t){return`TO_DATE(CAST(${this.sql(t,"this")} AS VARCHAR), ${s.DATEINT_FORMAT})`}],[_chunk2Z3O2CFMcjs._i,function(t){return`\`IF\`(${this.formatArgs([t.args.this,t.args.true,t.args.false])})`}],[_chunk2Z3O2CFMcjs.Ie,function(t){return this.binary(t,"`ILIKE`")}],[_chunk2Z3O2CFMcjs.Rj,function(t){return _chunk2Z3O2CFMcjs.kp.call(this,t,"insCost","delCost","subCost","maxDist"),_chunk2Z3O2CFMcjs.pp.call(void 0, "LEVENSHTEIN_DISTANCE").call(this,t)}],[_chunk2Z3O2CFMcjs.ud,function(t){return`PARTITION BY ${this.sql(t,"this")}`}],[_chunk2Z3O2CFMcjs.Lk,_chunk2Z3O2CFMcjs.pp.call(void 0, "REGEXP_MATCHES")],[_chunk2Z3O2CFMcjs.wl,function(t){return this.strToDate(t)}],[_chunk2Z3O2CFMcjs.zk,_chunk2Z3O2CFMcjs.pp.call(void 0, "POW")],[_chunk2Z3O2CFMcjs.Wd,_chunk2Z3O2CFMcjs.Po.call(void 0, [_chunk2Z3O2CFMcjs.So,_chunk2Z3O2CFMcjs.bp])],[_chunk2Z3O2CFMcjs.tl,_chunk2Z3O2CFMcjs.Ep],[_chunk2Z3O2CFMcjs.xl,function(t){return this.func("TO_TIMESTAMP",[t.args.this,this.formatTime(t)])}],[_chunk2Z3O2CFMcjs.Jl,function(t){return this.sql(new (0, _chunk2Z3O2CFMcjs.Cg)({this:t.args.this,to:new (0, _chunk2Z3O2CFMcjs.ac)({this:"date"})}))}],[_chunk2Z3O2CFMcjs.Kl,_chunk2Z3O2CFMcjs.Wp],[_chunk2Z3O2CFMcjs.Ll,_chunk2Z3O2CFMcjs.pp.call(void 0, "UNIX_TIMESTAMP")],[_chunk2Z3O2CFMcjs.Hl,function(t){return this.func("TO_CHAR",[t.args.this,this.formatTime(t)])}],[_chunk2Z3O2CFMcjs.Il,_chunk2Z3O2CFMcjs.pp.call(void 0, "UNIX_TIMESTAMP")],[_chunk2Z3O2CFMcjs.Qf,function(t){return this.functionFallbackSql(t)}],[_chunk2Z3O2CFMcjs.bn,_chunk2Z3O2CFMcjs.Ap],[_chunk2Z3O2CFMcjs.Nl,function(t){return`DATE_ADD(CAST(${this.sql(t,"this")} AS DATE), ${this.sql(new (0, _chunk2Z3O2CFMcjs.fe)({this:t.args.expression,unit:new (0, _chunk2Z3O2CFMcjs.Ub)({this:"DAY"})}))})`}],[_chunk2Z3O2CFMcjs.Tl,function(t){return`CAST(SUBSTR(REPLACE(CAST(${this.sql(t,"this")} AS VARCHAR), '-', ''), 1, 8) AS INT)`}]])}strToDate(T){let t=this.sql(T,"this"),g=this.formatTime(T);return g===s.DATE_FORMAT?this.sql(new (0, _chunk2Z3O2CFMcjs.Cg)({this:T.args.this,to:new (0, _chunk2Z3O2CFMcjs.ac)({this:"date"})})):this.func("TO_DATE",[t,g])}};o=_chunk2Z3O2CFMcjs.a.call(void 0, xt),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Ct,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"TYPE_MAPPING",ft,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"PROPERTIES_LOCATION",Pt,e),_chunk2Z3O2CFMcjs.d.call(void 0, o,10,"ORIGINAL_TRANSFORMS",mt,e),_chunk2Z3O2CFMcjs.b.call(void 0, o,e),_chunk2Z3O2CFMcjs.c.call(void 0, o,3,e),e.SUPPORTS_DECODE_CASE=!1,e.SELECT_KINDS=[],e.TRY_SUPPORTED=!1,e.SUPPORTS_UESCAPE=!1,e.JOIN_HINTS=!1,e.TABLE_HINTS=!1,e.QUERY_HINTS=!1,e.NVL2_SUPPORTED=!1,e.LAST_DAY_SUPPORTS_DATE_PART=!1,e.SUPPORTS_CREATE_TABLE_LIKE=!1,e.ARRAY_SIZE_NAME="REPEATED_COUNT";var Lt,dt,yt,gt,p,s= exports.Drill =class extends(gt=_chunk2Z3O2CFMcjs.op,yt=[_chunk2Z3O2CFMcjs.r],dt=[_chunk2Z3O2CFMcjs.r],Lt=[_chunk2Z3O2CFMcjs.r],gt){static get NORMALIZE_FUNCTIONS(){return""}static get NULL_ORDERING(){return"nulls_are_last"}static get TIME_MAPPING(){return{y:"%Y",Y:"%Y",YYYY:"%Y",yyyy:"%Y",YY:"%y",yy:"%y",MMMM:"%B",MMM:"%b",MM:"%m",M:"%-m",dd:"%d",d:"%-d",HH:"%H",H:"%-H",hh:"%I",h:"%-I",mm:"%M",m:"%-M",ss:"%S",s:"%-S",SSSSSS:"%f",a:"%p",DD:"%j",D:"%-j",E:"%a",EE:"%a",EEE:"%a",EEEE:"%A","''T''":"T"}}};p=_chunk2Z3O2CFMcjs.a.call(void 0, gt),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"NORMALIZE_FUNCTIONS",yt,s),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"NULL_ORDERING",dt,s),_chunk2Z3O2CFMcjs.d.call(void 0, p,10,"TIME_MAPPING",Lt,s),_chunk2Z3O2CFMcjs.b.call(void 0, p,s),_chunk2Z3O2CFMcjs.c.call(void 0, p,3,s),s.DIALECT_NAME="drill",s.PRESERVE_ORIGINAL_NAMES=!0,s.DATE_FORMAT="'yyyy-MM-dd'",s.DATEINT_FORMAT="'yyyyMMdd'",s.TIME_FORMAT="'yyyy-MM-dd HH:mm:ss'",s.SUPPORTS_USER_DEFINED_TYPES=!1,s.SUPPORTS_SEMI_ANTI_JOIN=!1,s.TYPED_DIVISION=!0,s.CONCAT_COALESCE=!0,s.Tokenizer=n,s.Parser=r,s.Generator=e;_chunk2Z3O2CFMcjs.op.register("drill",s);exports.Drill = s;
|
|
2
|
+
//# sourceMappingURL=drill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/huydna/projects/sqlingo.js/dist/dialects/drill.cjs","../../src/dialects/drill.ts"],"names":["_KEYWORDS_dec","_STRING_ESCAPES_dec","_IDENTIFIERS_dec","_a","_init","DrillTokenizer","Tokenizer","cache","keywords","__decoratorStart","__decorateElement","__decoratorMetadata","__runInitializers","_TABLE_ALIAS_TOKENS_dec","_FUNCTIONS_dec","_NO_PAREN_FUNCTIONS_dec","_ID_VAR_TOKENS_dec","DrillParser","Parser","noParenFunctions","args","ArraySizeExpr","TimeStrToTimeExpr","buildFormattedTime","TimeToStrExpr","LevenshteinExpr","_ORIGINAL_TRANSFORMS_dec","_PROPERTIES_LOCATION_dec","_TYPE_MAPPING_dec","_AFTER_HAVING_MODIFIER_TRANSFORMS_dec","DrillGenerator","Generator","modifiers","m","PartitionedByPropertyExpr","VolatilePropertyExpr","CurrentTimestampExpr","ArrayContainsExpr","renameFunc","CreateExpr","preprocess","moveSchemaColumnsToPartitionedBy","DateAddExpr","dateAddSql","DateStrToDateExpr","dateStrToDateSql","DateSubExpr","DateToDiExpr","e","Drill","DiToDateExpr","IfExpr","ILikeExpr","unsupportedArgs"],"mappings":"AAAA,kIAAyC,yDAA8c,ICAvfA,EAAAA,CAAAC,EAAAA,CAAAC,EAAAA,CAAAC,EAAAA,CAAAC,CAAAA,CAsEMC,CAAAA,CAAN,MAAA,OAAA,CAA6BF,EAAAA,CAAAG,oBAAAA,CAC3BJ,EAA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,CACF,CAAA,CACA,CACEI,oBAAAA,CACA,QAAA,CAA2BJ,CAAAA,CAAG,CAC5B,OAAO,IAAA,CAAK,MAAA,CAAOA,CAAAA,CAAG,SAAS,CACjC,CACF,CAAA,CACA,CACEvB,oBAAAA,CACA,QAAA,CAA2BuB,CAAAA,CAAG,CAC5B,OAAAK,oBAAAA,CAAgB,IAAA,CAAK,IAAA,CAAML,CAAAA,CAAG,SAAA,CAAW,SAAA,CAAW,SAAA,CAAW,SAAS,CAAA,CACjEV,kCAAAA,sBAAiC,CAAA,CAAE,IAAA,CAAK,IAAA,CAAMU,CAAC,CACxD,CACF,CAAA,CACA,CACEd,oBAAAA,CACA,QAAA,CAA2Bc,CAAAA,CAAG,CAC5B,MAAO,CAAA,aAAA,EAAgB,IAAA,CAAK,GAAA,CAAIA,CAAAA,CAAG,MAAM,CAAC,CAAA,CAAA","file":"/home/huydna/projects/sqlingo.js/dist/dialects/drill.cjs","sourcesContent":[null,"import {\n cache,\n} from '../port_internals';\nimport type {\n Expression,\n} from '../expressions';\nimport {\n ArrayContainsExpr,\n ArraySizeExpr,\n CastExpr,\n CreateExpr,\n CurrentTimestampExpr,\n DataTypeExpr,\n DataTypeExprKind,\n DateAddExpr,\n DateStrToDateExpr,\n DateSubExpr,\n DateToDiExpr,\n DiToDateExpr,\n IfExpr,\n ILikeExpr,\n IntervalExpr,\n LevenshteinExpr,\n PartitionedByPropertyExpr,\n PowExpr,\n PropertiesLocation,\n RegexpLikeExpr,\n SelectExpr,\n StrPositionExpr,\n StrToDateExpr,\n StrToTimeExpr,\n TimeStrToDateExpr,\n TimeStrToTimeExpr,\n TimeStrToUnixExpr,\n TimeToStrExpr,\n TimeToUnixExpr,\n ToCharExpr,\n TryCastExpr,\n TsOrDiToDiExpr,\n TsOrDsAddExpr,\n VarExpr,\n VolatilePropertyExpr,\n} from '../expressions';\nimport {\n Generator, unsupportedArgs,\n} from '../generator';\nimport {\n Parser,\n} from '../parser';\nimport {\n TokenType, Tokenizer,\n} from '../tokens';\nimport {\n eliminateDistinctOn, eliminateSemiAndAntiJoins, moveSchemaColumnsToPartitionedBy, preprocess,\n} from '../transforms';\nimport {\n buildFormattedTime,\n dateStrToDateSql,\n Dialect, Dialects,\n noTrycastSql,\n renameFunc,\n strPositionSql,\n timeStrToTimeSql,\n NullOrdering,\n NormalizeFunctions,\n} from './dialect';\nimport {\n dateAddSql,\n} from './mysql';\n\nclass DrillTokenizer extends Tokenizer {\n @cache\n static get IDENTIFIERS () {\n return [\n '`',\n ];\n }\n\n @cache\n static get STRING_ESCAPES () {\n return [\n '\\\\',\n ];\n }\n\n @cache\n static get KEYWORDS (): Record<string, TokenType> {\n const keywords = {\n ...Tokenizer.KEYWORDS,\n };\n delete keywords['/*+'];\n return keywords;\n }\n}\n\nclass DrillParser extends Parser {\n @cache\n static get ID_VAR_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.ID_VAR_TOKENS,\n TokenType.SESSION_USER,\n TokenType.CURRENT_CATALOG,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get NO_PAREN_FUNCTIONS () {\n const noParenFunctions = {\n ...Parser.NO_PAREN_FUNCTIONS,\n };\n delete noParenFunctions[TokenType.LOCALTIME];\n delete noParenFunctions[TokenType.LOCALTIMESTAMP];\n return noParenFunctions;\n }\n\n static STRICT_CAST = false;\n static LOG_DEFAULTS_TO_LN = true;\n @cache\n static get FUNCTIONS (): Record<string, (args: Expression[], options: {dialect: Dialect}) => Expression> {\n return {\n ...Parser.FUNCTIONS,\n REPEATED_COUNT: (args: unknown[]) => ArraySizeExpr.fromArgList(args),\n TO_TIMESTAMP: (args: unknown[]) => TimeStrToTimeExpr.fromArgList(args),\n TO_CHAR: buildFormattedTime(TimeToStrExpr, {\n dialect: 'drill',\n }),\n LEVENSHTEIN_DISTANCE: (args: unknown[]) => LevenshteinExpr.fromArgList(args),\n };\n }\n\n // port from _Dialect metaclass logic\n @cache\n static get TABLE_ALIAS_TOKENS (): Set<TokenType> {\n return new Set([\n ...Parser.TABLE_ALIAS_TOKENS,\n TokenType.STRAIGHT_JOIN,\n ]);\n }\n}\nclass DrillGenerator extends Generator {\n // port from _Dialect metaclass logic\n @cache\n static get AFTER_HAVING_MODIFIER_TRANSFORMS () {\n const modifiers = new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);\n [\n 'cluster',\n 'distribute',\n 'sort',\n ].forEach((m) => modifiers.delete(m));\n return modifiers;\n }\n\n // port from _Dialect metaclass logic\n static SUPPORTS_DECODE_CASE = false;\n // port from _Dialect metaclass logic\n static readonly SELECT_KINDS: string[] = [\n ];\n // port from _Dialect metaclass logic\n static TRY_SUPPORTED = false;\n // port from _Dialect metaclass logic\n static SUPPORTS_UESCAPE = false;\n static JOIN_HINTS = false;\n static TABLE_HINTS = false;\n static QUERY_HINTS = false;\n static NVL2_SUPPORTED = false;\n static LAST_DAY_SUPPORTS_DATE_PART = false;\n static SUPPORTS_CREATE_TABLE_LIKE = false;\n static ARRAY_SIZE_NAME = 'REPEATED_COUNT';\n\n @cache\n static get TYPE_MAPPING () {\n return new Map([\n ...Generator.TYPE_MAPPING,\n [\n DataTypeExprKind.INT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.SMALLINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.TINYINT,\n 'INTEGER',\n ],\n [\n DataTypeExprKind.BINARY,\n 'VARBINARY',\n ],\n [\n DataTypeExprKind.TEXT,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.NCHAR,\n 'VARCHAR',\n ],\n [\n DataTypeExprKind.TIMESTAMPLTZ,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.TIMESTAMPTZ,\n 'TIMESTAMP',\n ],\n [\n DataTypeExprKind.DATETIME,\n 'TIMESTAMP',\n ],\n ]);\n }\n\n @cache\n static get PROPERTIES_LOCATION () {\n return new Map<typeof Expression, PropertiesLocation>([\n ...Generator.PROPERTIES_LOCATION,\n [\n PartitionedByPropertyExpr,\n PropertiesLocation.POST_SCHEMA,\n ],\n [\n VolatilePropertyExpr,\n PropertiesLocation.UNSUPPORTED,\n ],\n ]);\n }\n\n @cache\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n static get ORIGINAL_TRANSFORMS (): Map<typeof Expression, (this: Generator, e: any) => string> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transforms = new Map<typeof Expression, (this: Generator, e: any) => string>([\n ...Generator.TRANSFORMS,\n [\n CurrentTimestampExpr,\n () => 'CURRENT_TIMESTAMP',\n ],\n [\n ArrayContainsExpr,\n renameFunc('REPEATED_CONTAINS'),\n ],\n [\n CreateExpr,\n preprocess([\n moveSchemaColumnsToPartitionedBy,\n ]),\n ],\n [\n DateAddExpr,\n dateAddSql('ADD'),\n ],\n [\n DateStrToDateExpr,\n dateStrToDateSql,\n ],\n [\n DateSubExpr,\n dateAddSql('SUB'),\n ],\n [\n DateToDiExpr,\n function (this: Generator, e) {\n return `CAST(TO_DATE(${this.sql(e, 'this')}, ${Drill.DATEINT_FORMAT}) AS INT)`;\n },\n ],\n [\n DiToDateExpr,\n function (this: Generator, e) {\n return `TO_DATE(CAST(${this.sql(e, 'this')} AS VARCHAR), ${Drill.DATEINT_FORMAT})`;\n },\n ],\n [\n IfExpr,\n function (this: Generator, e) {\n return `\\`IF\\`(${this.formatArgs([\n e.args.this,\n e.args.true,\n e.args.false,\n ])})`;\n },\n ],\n [\n ILikeExpr,\n function (this: Generator, e) {\n return this.binary(e, '`ILIKE`');\n },\n ],\n [\n LevenshteinExpr,\n function (this: Generator, e) {\n unsupportedArgs.call(this, e, 'insCost', 'delCost', 'subCost', 'maxDist');\n return renameFunc('LEVENSHTEIN_DISTANCE').call(this, e);\n },\n ],\n [\n PartitionedByPropertyExpr,\n function (this: Generator, e) {\n return `PARTITION BY ${this.sql(e, 'this')}`;\n },\n ],\n [\n RegexpLikeExpr,\n renameFunc('REGEXP_MATCHES'),\n ],\n [\n StrToDateExpr,\n function (this: Generator, e) {\n return (this as DrillGenerator).strToDate(e);\n },\n ],\n [\n PowExpr,\n renameFunc('POW'),\n ],\n [\n SelectExpr,\n preprocess([\n eliminateDistinctOn,\n eliminateSemiAndAntiJoins,\n ]),\n ],\n [\n StrPositionExpr,\n strPositionSql,\n ],\n [\n StrToTimeExpr,\n function (this: Generator, e) {\n return this.func('TO_TIMESTAMP', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n ],\n [\n TimeStrToDateExpr,\n function (this: Generator, e) {\n return this.sql(new CastExpr({\n this: e.args.this,\n to: new DataTypeExpr({\n this: DataTypeExprKind.DATE,\n }),\n }));\n },\n ],\n [\n TimeStrToTimeExpr,\n timeStrToTimeSql,\n ],\n [\n TimeStrToUnixExpr,\n renameFunc('UNIX_TIMESTAMP'),\n ],\n [\n TimeToStrExpr,\n function (this: Generator, e) {\n return this.func('TO_CHAR', [\n e.args.this,\n this.formatTime(e),\n ]);\n },\n ],\n [\n TimeToUnixExpr,\n renameFunc('UNIX_TIMESTAMP'),\n ],\n [\n ToCharExpr,\n function (this: Generator, e) {\n return this.functionFallbackSql(e);\n },\n ],\n [\n TryCastExpr,\n noTrycastSql,\n ],\n [\n TsOrDsAddExpr,\n function (this: Generator, e) {\n return `DATE_ADD(CAST(${this.sql(e, 'this')} AS DATE), ${this.sql(new IntervalExpr({\n this: e.args.expression,\n unit: new VarExpr({\n this: 'DAY',\n }),\n }))})`;\n },\n ],\n [\n TsOrDiToDiExpr,\n function (this: Generator, e) {\n return `CAST(SUBSTR(REPLACE(CAST(${this.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)`;\n },\n ],\n ]);\n return transforms;\n }\n\n strToDate (expression: StrToDateExpr): string {\n const thisSql = this.sql(expression, 'this');\n const timeFormat = this.formatTime(expression);\n if (timeFormat === Drill.DATE_FORMAT) {\n return this.sql(new CastExpr({\n this: expression.args.this,\n to: new DataTypeExpr({\n this: DataTypeExprKind.DATE,\n }),\n }));\n }\n return this.func('TO_DATE', [\n thisSql,\n timeFormat,\n ]);\n }\n}\n\nexport class Drill extends Dialect {\n static DIALECT_NAME = Dialects.DRILL;\n\n @cache\n static get NORMALIZE_FUNCTIONS () {\n return NormalizeFunctions.NONE;\n }\n\n static PRESERVE_ORIGINAL_NAMES = true;\n\n @cache\n static get NULL_ORDERING () {\n return NullOrdering.NULLS_ARE_LAST;\n }\n\n static DATE_FORMAT = '\\'yyyy-MM-dd\\'';\n static DATEINT_FORMAT = '\\'yyyyMMdd\\'';\n static TIME_FORMAT = '\\'yyyy-MM-dd HH:mm:ss\\'';\n static SUPPORTS_USER_DEFINED_TYPES = false;\n static SUPPORTS_SEMI_ANTI_JOIN = false;\n static TYPED_DIVISION = true;\n static CONCAT_COALESCE = true;\n\n @cache\n static get TIME_MAPPING () {\n return {\n 'y': '%Y',\n 'Y': '%Y',\n 'YYYY': '%Y',\n 'yyyy': '%Y',\n 'YY': '%y',\n 'yy': '%y',\n 'MMMM': '%B',\n 'MMM': '%b',\n 'MM': '%m',\n 'M': '%-m',\n 'dd': '%d',\n 'd': '%-d',\n 'HH': '%H',\n 'H': '%-H',\n 'hh': '%I',\n 'h': '%-I',\n 'mm': '%M',\n 'm': '%-M',\n 'ss': '%S',\n 's': '%-S',\n 'SSSSSS': '%f',\n 'a': '%p',\n 'DD': '%j',\n 'D': '%-j',\n 'E': '%a',\n 'EE': '%a',\n 'EEE': '%a',\n 'EEEE': '%A',\n '\\'\\'T\\'\\'': 'T',\n };\n }\n\n static Tokenizer = DrillTokenizer;\n static Parser = DrillParser;\n static Generator = DrillGenerator;\n}\n\nDialect.register(Dialects.DRILL, Drill);\n"]}
|