@malloydata/db-trino 0.0.233-dev250201002938 → 0.0.233-dev250201013608
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.
|
@@ -41,7 +41,7 @@ export declare abstract class TrinoPrestoConnection extends BaseConnection imple
|
|
|
41
41
|
canPersist(): this is PersistSQLResults;
|
|
42
42
|
get supportsNesting(): boolean;
|
|
43
43
|
manifestTemporaryTable(_sqlCommand: string): Promise<string>;
|
|
44
|
-
unpackArray(data: unknown): unknown[];
|
|
44
|
+
unpackArray(_fields: FieldDef[], data: unknown): unknown[];
|
|
45
45
|
convertRow(fields: FieldDef[], rawRow: unknown): {};
|
|
46
46
|
convertNest(fields: FieldDef[], _data: unknown): unknown[];
|
|
47
47
|
runSQL(sqlCommand: string, options?: RunSQLOptions, _rowIndex?: number): Promise<MalloyQueryData>;
|
|
@@ -67,7 +67,7 @@ export declare class PrestoConnection extends TrinoPrestoConnection {
|
|
|
67
67
|
constructor(option: TrinoConnectionOptions, queryOptions?: QueryOptionsReader);
|
|
68
68
|
static schemaFromExplain(explainResult: MalloyQueryData, structDef: StructDef, dialect: Dialect): void;
|
|
69
69
|
protected fillStructDefForSqlBlockSchema(sql: string, structDef: StructDef): Promise<void>;
|
|
70
|
-
unpackArray(data: unknown): unknown[];
|
|
70
|
+
unpackArray(_fields: FieldDef[], data: unknown): unknown[];
|
|
71
71
|
}
|
|
72
72
|
export declare class TrinoConnection extends TrinoPrestoConnection {
|
|
73
73
|
constructor(name: string, queryOptions?: QueryOptionsReader, config?: TrinoConnectionConfiguration);
|
package/dist/trino_connection.js
CHANGED
|
@@ -138,13 +138,13 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
|
|
|
138
138
|
async manifestTemporaryTable(_sqlCommand) {
|
|
139
139
|
throw new Error('not implemented 1');
|
|
140
140
|
}
|
|
141
|
-
unpackArray(data) {
|
|
141
|
+
unpackArray(_fields, data) {
|
|
142
142
|
return data;
|
|
143
143
|
}
|
|
144
144
|
convertRow(fields, rawRow) {
|
|
145
145
|
var _a;
|
|
146
146
|
const retRow = {};
|
|
147
|
-
const row = this.unpackArray(rawRow);
|
|
147
|
+
const row = this.unpackArray(fields, rawRow);
|
|
148
148
|
for (let i = 0; i < fields.length; i++) {
|
|
149
149
|
const field = fields[i];
|
|
150
150
|
if (field.type === 'record') {
|
|
@@ -165,7 +165,7 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
|
|
|
165
165
|
return retRow;
|
|
166
166
|
}
|
|
167
167
|
convertNest(fields, _data) {
|
|
168
|
-
const data = this.unpackArray(_data);
|
|
168
|
+
const data = this.unpackArray(fields, _data);
|
|
169
169
|
const ret = [];
|
|
170
170
|
const rows = (data === null || data === undefined ? [] : data);
|
|
171
171
|
for (const row of rows) {
|
|
@@ -205,7 +205,7 @@ class TrinoPrestoConnection extends connection_1.BaseConnection {
|
|
|
205
205
|
}
|
|
206
206
|
else if ((0, malloy_1.isScalarArray)(colSchema)) {
|
|
207
207
|
const elType = colSchema.elementTypeDef;
|
|
208
|
-
let theArray = this.unpackArray(rawRow);
|
|
208
|
+
let theArray = this.unpackArray([], rawRow);
|
|
209
209
|
if (elType.type === 'array') {
|
|
210
210
|
theArray = theArray.map(el => this.resultRow(elType, el));
|
|
211
211
|
}
|
|
@@ -330,7 +330,7 @@ class PrestoConnection extends TrinoPrestoConnection {
|
|
|
330
330
|
const explainResult = await this.runSQL(`EXPLAIN ${sql}`, {});
|
|
331
331
|
PrestoConnection.schemaFromExplain(explainResult, structDef, this.dialect);
|
|
332
332
|
}
|
|
333
|
-
unpackArray(data) {
|
|
333
|
+
unpackArray(_fields, data) {
|
|
334
334
|
return JSON.parse(data);
|
|
335
335
|
}
|
|
336
336
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-trino",
|
|
3
|
-
"version": "0.0.233-
|
|
3
|
+
"version": "0.0.233-dev250201013608",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepublishOnly": "npm run build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@malloydata/malloy": "^0.0.233-
|
|
25
|
+
"@malloydata/malloy": "^0.0.233-dev250201013608",
|
|
26
26
|
"@prestodb/presto-js-client": "^1.0.0",
|
|
27
27
|
"gaxios": "^4.2.0",
|
|
28
28
|
"trino-client": "^0.2.2"
|