@malloydata/malloy 0.0.144-dev240426151705 → 0.0.144-dev240503150037
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.
|
@@ -696,7 +696,11 @@ class QueryField extends QueryNode {
|
|
|
696
696
|
between = `ROWS BETWEEN ${preceding} PRECEDING AND ${following} FOLLOWING`;
|
|
697
697
|
}
|
|
698
698
|
const funcSQL = this.generateExpressionFromExpr(resultStruct, context, expr, state);
|
|
699
|
-
|
|
699
|
+
let retExpr = `${funcSQL} OVER(${partitionBy} ${orderBy} ${between})`;
|
|
700
|
+
if (isComplex) {
|
|
701
|
+
retExpr = `CASE WHEN group_set=${resultStruct.groupSet} THEN ${retExpr} END`;
|
|
702
|
+
}
|
|
703
|
+
return retExpr;
|
|
700
704
|
}
|
|
701
705
|
generateExpressionFromExpr(resultSet, context, e, state = new GenerateState()) {
|
|
702
706
|
let s = '';
|
|
@@ -3016,12 +3020,7 @@ class QueryStruct extends QueryNode {
|
|
|
3016
3020
|
getIdentifier() {
|
|
3017
3021
|
// if it is the root table, use provided alias if we have one.
|
|
3018
3022
|
if (this.fieldDef.structRelationship.type === 'basetable') {
|
|
3019
|
-
|
|
3020
|
-
return 'base';
|
|
3021
|
-
}
|
|
3022
|
-
else {
|
|
3023
|
-
return identifierNormalize(super.getIdentifier());
|
|
3024
|
-
}
|
|
3023
|
+
return 'base';
|
|
3025
3024
|
}
|
|
3026
3025
|
// if this is an inline object, include the parents alias.
|
|
3027
3026
|
if (this.fieldDef.structRelationship.type === 'inline' && this.parent) {
|