@malloydata/malloy 0.0.138-dev240401131656 → 0.0.138-dev240401194552
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.
|
@@ -232,13 +232,10 @@ class TrinoDialect extends dialect_1.Dialect {
|
|
|
232
232
|
return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ${name} END) as ${sqlName}`;
|
|
233
233
|
}
|
|
234
234
|
sqlCoaleseMeasuresInline(groupSet, fieldList) {
|
|
235
|
-
const fields = fieldList
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
.map(f => `NULL as ${f.sqlOutputName}`)
|
|
240
|
-
.join(', ');
|
|
241
|
-
return `COALESCE(ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}) END), STRUCT(${nullValues}))`;
|
|
235
|
+
const fields = fieldList.map(f => f.sqlExpression).join(', ');
|
|
236
|
+
const nullValues = fieldList.map(_f => 'NULL').join(', ');
|
|
237
|
+
const definitions = this.buildTypeExpression(fieldList);
|
|
238
|
+
return `COALESCE(ANY_VALUE(CASE WHEN group_set=${groupSet} THEN CAST(ROW(${fields}) AS ROW(${definitions})) END), CAST(ROW(${nullValues}) AS ROW(${definitions})))`;
|
|
242
239
|
}
|
|
243
240
|
//
|
|
244
241
|
// this code used to be:
|