@@ -2974,6 +2974,61 @@ describe('SQL Generation', () => {
2974
2974
} ]
2975
2975
) ) ;
2976
2976
2977
+ // Subquery aggregation for multiplied measure (and any `keysSelect` for that matter)
2978
+ // should pick up all dimensions, even through member expressions
2979
+ it ( 'multiplied sum with dimension member expressions' , async ( ) => runQueryTest (
2980
+ {
2981
+ measures : [
2982
+ 'visitors_visitors_checkins_view.revenue' ,
2983
+ 'visitors_visitors_checkins_view.visitor_checkins_count' ,
2984
+ ] ,
2985
+ dimensions : [
2986
+ {
2987
+ expression : new Function (
2988
+ 'visitors_visitors_checkins_view' ,
2989
+ // eslint-disable-next-line no-new-func,no-template-curly-in-string
2990
+ 'return `LOWER(${visitors_visitors_checkins_view.source})`'
2991
+ ) ,
2992
+ expressionName : 'lower_source' ,
2993
+ // eslint-disable-next-line no-template-curly-in-string
2994
+ definition : 'LOWER(${visitors_visitors_checkins_view.source})' ,
2995
+ cubeName : 'visitors_visitors_checkins_view' ,
2996
+ } ,
2997
+ {
2998
+ expression : new Function (
2999
+ 'visitors_visitors_checkins_view' ,
3000
+ // eslint-disable-next-line no-new-func,no-template-curly-in-string
3001
+ 'return `UPPER(${visitors_visitors_checkins_view.source})`'
3002
+ ) ,
3003
+ expressionName : 'upper_source' ,
3004
+ // eslint-disable-next-line no-template-curly-in-string
3005
+ definition : 'UPPER(${visitors_visitors_checkins_view.source})' ,
3006
+ cubeName : 'visitors_visitors_checkins_view' ,
3007
+ } ,
3008
+ ] ,
3009
+ } ,
3010
+ [
3011
+ {
3012
+ lower_source : null ,
3013
+ upper_source : null ,
3014
+ visitors_visitors_checkins_view__revenue : '1400' ,
3015
+ visitors_visitors_checkins_view__visitor_checkins_count : '0' ,
3016
+ } ,
3017
+ {
3018
+ lower_source : 'google' ,
3019
+ upper_source : 'GOOGLE' ,
3020
+ visitors_visitors_checkins_view__revenue : '300' ,
3021
+ visitors_visitors_checkins_view__visitor_checkins_count : '1' ,
3022
+ } ,
3023
+ {
3024
+ lower_source : 'some' ,
3025
+ upper_source : 'SOME' ,
3026
+ visitors_visitors_checkins_view__revenue : '300' ,
3027
+ visitors_visitors_checkins_view__visitor_checkins_count : '5' ,
3028
+ } ,
3029
+ ]
3030
+ ) ) ;
3031
+
2977
3032
// TODO not implemented
2978
3033
// it('multi stage bucketing', async () => runQueryTest(
2979
3034
// {
0 commit comments