@malloydata/db-trino 0.0.138-dev240403142727 → 0.0.138-dev240403155507
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/trino_connection.js +5 -3
- package/package.json +1 -1
package/dist/trino_connection.js
CHANGED
|
@@ -169,17 +169,18 @@ class TrinoConnection {
|
|
|
169
169
|
convertRow(structDef, row) {
|
|
170
170
|
const col = {};
|
|
171
171
|
for (let i = 0; i < structDef.fields.length; i++) {
|
|
172
|
-
col[structDef.fields[i].name] = row[i];
|
|
172
|
+
col[structDef.fields[i].name] = row[i] === undefined ? null : row[i];
|
|
173
173
|
}
|
|
174
174
|
return col;
|
|
175
175
|
}
|
|
176
176
|
convertNest(structDef, dataRows) {
|
|
177
|
+
const rows = dataRows === null || dataRows === undefined ? [] : dataRows;
|
|
177
178
|
const ret = [];
|
|
178
179
|
if (structDef.structRelationship.type === 'nested' &&
|
|
179
180
|
!structDef.structRelationship.isArray) {
|
|
180
|
-
return this.convertRow(structDef,
|
|
181
|
+
return this.convertRow(structDef, rows);
|
|
181
182
|
}
|
|
182
|
-
for (const row of
|
|
183
|
+
for (const row of rows) {
|
|
183
184
|
ret.push(this.convertRow(structDef, row));
|
|
184
185
|
}
|
|
185
186
|
return ret;
|
|
@@ -199,6 +200,7 @@ class TrinoConnection {
|
|
|
199
200
|
// Debugging types
|
|
200
201
|
// const _x = queryResult.value.columns.map(c => console.log(c.type));
|
|
201
202
|
// console.log(JSON.stringify(malloyColumns, null, 2));
|
|
203
|
+
// console.log(JSON.stringify(queryResult.value.data, null, 2));
|
|
202
204
|
let maxRows = (_a = options.rowLimit) !== null && _a !== void 0 ? _a : 50;
|
|
203
205
|
const malloyRows = [];
|
|
204
206
|
while (queryResult !== null && maxRows--) {
|