@@ -50,10 +50,6 @@ describe('ClickHouse JoinGraph', () => {
5050 }]
5151 },
5252 per_visitor_revenue: perVisitorRevenueMeasure,
53- revenueRunning: {
54- type: 'runningTotal',
55- sql: 'amount'
56- },
5753 revenueRolling: {
5854 type: 'sum',
5955 sql: 'amount',
@@ -85,14 +81,6 @@ describe('ClickHouse JoinGraph', () => {
8581 offset: 'start'
8682 }
8783 },
88- runningCount: {
89- type: 'runningTotal',
90- sql: '1'
91- },
92- runningRevenuePerCount: {
93- type: 'number',
94- sql: \`round(\${revenueRunning} / \${runningCount})\`
95- },
9684 averageCheckins: {
9785 type: 'avg',
9886 sql: \`\${doubledCheckings}\`
@@ -385,68 +373,6 @@ describe('ClickHouse JoinGraph', () => {
385373 visitors__per_visitor_revenue : '60'
386374 } ] ) ) ;
387375
388- // FAILS - need to finish query to override ::timestamptz
389- it . skip ( 'running total' , ( ) => {
390- const result = compiler . compile ( ) . then ( ( ) => {
391- const query = new ClickHouseQuery ( { joinGraph, cubeEvaluator, compiler } , {
392- measures : [
393- 'visitors.revenueRunning'
394- ] ,
395- timeDimensions : [ {
396- dimension : 'visitors.created_at' ,
397- granularity : 'day' ,
398- dateRange : [ '2017-01-01' , '2017-01-10' ]
399- } ] ,
400- order : [ {
401- id : 'visitors.created_at'
402- } ] ,
403- timezone : 'America/Los_Angeles'
404- } ) ;
405-
406- logSqlAndParams ( query ) ;
407-
408- // TODO ordering doesn't work for running total
409- return dbRunner . testQuery ( query . buildSqlAndParams ( ) ) . then ( res => {
410- debugLog ( JSON . stringify ( res ) ) ;
411- expect ( res ) . toEqual (
412- [ {
413- visitors__created_at_day : '2017-01-01T00:00:00.000Z' ,
414- visitors__revenue_running : null
415- } , {
416- visitors__created_at_day : '2017-01-02T00:00:00.000Z' ,
417- visitors__revenue_running : '100'
418- } , {
419- visitors__created_at_day : '2017-01-03T00:00:00.000Z' ,
420- visitors__revenue_running : '100'
421- } , {
422- visitors__created_at_day : '2017-01-04T00:00:00.000Z' ,
423- visitors__revenue_running : '300'
424- } , {
425- visitors__created_at_day : '2017-01-05T00:00:00.000Z' ,
426- visitors__revenue_running : '600'
427- } , {
428- visitors__created_at_day : '2017-01-06T00:00:00.000Z' ,
429- visitors__revenue_running : '1500'
430- } , {
431- visitors__created_at_day : '2017-01-07T00:00:00.000Z' ,
432- visitors__revenue_running : '1500'
433- } , {
434- visitors__created_at_day : '2017-01-08T00:00:00.000Z' ,
435- visitors__revenue_running : '1500'
436- } , {
437- visitors__created_at_day : '2017-01-09T00:00:00.000Z' ,
438- visitors__revenue_running : '1500'
439- } , {
440- visitors__created_at_day : '2017-01-10T00:00:00.000Z' ,
441- visitors__revenue_running : '1500'
442- } ]
443- ) ;
444- } ) ;
445- } ) ;
446-
447- return result ;
448- } ) ;
449-
450376 // FAILS - need to finish query to override ::timestamptz
451377 it . skip ( 'rolling' , ( ) => runQueryTest ( {
452378 measures : [
@@ -577,51 +503,6 @@ describe('ClickHouse JoinGraph', () => {
577503 { visitors__created_at_sql_utils_day : '2017-01-06T00:00:00.000' , visitors__visitor_count : '2' }
578504 ] ) ) ;
579505
580- it ( 'running total total' , ( ) => runQueryTest ( {
581- measures : [
582- 'visitors.revenueRunning'
583- ] ,
584- timeDimensions : [ {
585- dimension : 'visitors.created_at' ,
586- dateRange : [ '2017-01-01' , '2017-01-10' ]
587- } ] ,
588- order : [ {
589- id : 'visitors.created_at'
590- } ] ,
591- timezone : 'America/Los_Angeles'
592- } , [
593- {
594- visitors__revenue_running : '1500'
595- }
596- ] ) ) ;
597-
598- // FAILS Unmatched parentheses
599- it . skip ( 'running total ratio' , ( ) => runQueryTest ( {
600- measures : [
601- 'visitors.runningRevenuePerCount'
602- ] ,
603- timeDimensions : [ {
604- dimension : 'visitors.created_at' ,
605- granularity : 'day' ,
606- dateRange : [ '2017-01-01' , '2017-01-10' ]
607- } ] ,
608- order : [ {
609- id : 'visitors.created_at'
610- } ] ,
611- timezone : 'America/Los_Angeles'
612- } , [
613- { visitors__created_at_day : '2017-01-01T00:00:00.000Z' , visitors__running_revenue_per_count : null } ,
614- { visitors__created_at_day : '2017-01-02T00:00:00.000Z' , visitors__running_revenue_per_count : '100' } ,
615- { visitors__created_at_day : '2017-01-03T00:00:00.000Z' , visitors__running_revenue_per_count : '100' } ,
616- { visitors__created_at_day : '2017-01-04T00:00:00.000Z' , visitors__running_revenue_per_count : '150' } ,
617- { visitors__created_at_day : '2017-01-05T00:00:00.000Z' , visitors__running_revenue_per_count : '200' } ,
618- { visitors__created_at_day : '2017-01-06T00:00:00.000Z' , visitors__running_revenue_per_count : '300' } ,
619- { visitors__created_at_day : '2017-01-07T00:00:00.000Z' , visitors__running_revenue_per_count : '300' } ,
620- { visitors__created_at_day : '2017-01-08T00:00:00.000Z' , visitors__running_revenue_per_count : '300' } ,
621- { visitors__created_at_day : '2017-01-09T00:00:00.000Z' , visitors__running_revenue_per_count : '300' } ,
622- { visitors__created_at_day : '2017-01-10T00:00:00.000Z' , visitors__running_revenue_per_count : '300' }
623- ] ) ) ;
624-
625506 // FAILS ClickHouse supports multiple approximate aggregators:
626507 // uniq, uniqCombined, uniqHLL12, need to pick one to use and implement it in query
627508 it . skip ( 'hll rolling' , ( ) => {
0 commit comments