@malloydata/malloy 0.0.152-dev240714165728 → 0.0.152-dev240716144637
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.
|
@@ -507,18 +507,21 @@ class PrestoDialect extends TrinoDialect {
|
|
|
507
507
|
sqlUnnestAlias(source, alias, _fieldList, needDistinctKey, isArray, _isInNestedPipeline) {
|
|
508
508
|
if (isArray) {
|
|
509
509
|
if (needDistinctKey) {
|
|
510
|
-
// return `LEFT JOIN UNNEST(transform(${source}, x -> ROW(x) )) WITH ORDINALIITY as words_0(value,__row_id_from_${alias}) ON TRUE`;
|
|
511
|
-
return `CROSS JOIN UNNEST(
|
|
510
|
+
// return `LEFT JOIN UNNEST(transform(${source}, x -> CAST(ROW(x) as ROW(value) )) WITH ORDINALIITY as words_0(value,__row_id_from_${alias}) ON TRUE`;
|
|
511
|
+
return `CROSS JOIN UNNEST(${source}) WITH ORDINALITY as ${alias}(value, __row_id_from_${alias}) `;
|
|
512
512
|
}
|
|
513
513
|
else {
|
|
514
|
-
return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore))) as ${alias}(value, ignore)`;
|
|
514
|
+
// return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore))) as ${alias}(value, ignore)`;
|
|
515
|
+
return `CROSS JOIN UNNEST(${source}) as ${alias}(value) `;
|
|
515
516
|
}
|
|
516
517
|
}
|
|
517
518
|
else if (needDistinctKey) {
|
|
518
|
-
return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore))) WITH ORDINALITY as ${alias}_outer(${alias}, ignore,__row_id_from_${alias})`;
|
|
519
|
+
// return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore))) WITH ORDINALITY as ${alias}_outer(${alias}, ignore,__row_id_from_${alias})`;
|
|
520
|
+
return `CROSS JOIN UNNEST(${source}) WITH ORDINALITY as ${alias}_outer(${alias}, __row_id_from_${alias})`;
|
|
519
521
|
}
|
|
520
522
|
else {
|
|
521
|
-
return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore)))as ${alias}_outer(${alias},ignore)`;
|
|
523
|
+
// return `CROSS JOIN UNNEST(zip_with(${source},array[],(r,ignore) -> (r, ignore)))as ${alias}_outer(${alias},ignore)`;
|
|
524
|
+
return `CROSS JOIN UNNEST(${source}) as ${alias}_outer(${alias})`;
|
|
522
525
|
}
|
|
523
526
|
}
|
|
524
527
|
}
|