@malloydata/malloy 0.0.138-dev240404233606 → 0.0.138-dev240405133532
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.
|
@@ -248,17 +248,17 @@ class TrinoDialect extends dialect_1.Dialect {
|
|
|
248
248
|
const fieldsNames = fieldList.map(f => this.sqlMaybeQuoteIdentifier(f.sqlOutputName));
|
|
249
249
|
if (isArray) {
|
|
250
250
|
if (needDistinctKey) {
|
|
251
|
-
return
|
|
251
|
+
return `LEFT JOIN UNNEST(zip(${source}, SEQUENCE(1,cardinality(${source})))) as words_0(value,__row_id_from_${alias}) ON TRUE`;
|
|
252
252
|
}
|
|
253
253
|
else {
|
|
254
|
-
return
|
|
254
|
+
return `LEFT JOIN UNNEST(transform(${source}, x -> ROW(x) )) as ${alias}(value) ON TRUE`;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
else if (needDistinctKey) {
|
|
258
|
-
return
|
|
258
|
+
return `LEFT JOIN UNNEST(zip_with(${source}, SEQUENCE(1,cardinality(${source})), (r,__row_id) -> (r, __row_id))) as ${alias}_outer(${alias},__row_id_from_${alias}) ON TRUE`;
|
|
259
259
|
}
|
|
260
260
|
else {
|
|
261
|
-
return
|
|
261
|
+
return `LEFT JOIN UNNEST(${source}) as ${alias}(${fieldsNames.join(', ')}) ON TRUE`;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
sqlSumDistinctHashedKey(sqlDistinctKey) {
|