@@ -417,7 +417,8 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter {
417417 min($" value" ).as(" min_val" ),
418418 max($" value" ).as(" max_val" ),
419419 sum($" value" ).as(" sum_val" ),
420- count(when($" value" % 2 === 0 , 1 )).as(" num_even" ))
420+ count(when($" value" % 2 === 0 , 1 )).as(" num_even" ),
421+ percentile_approx($" value" , lit(0.5 ), lit(100 )).as(" percentile_approx_val" ))
421422 .observe(
422423 name = " other_event" ,
423424 avg($" value" ).cast(" int" ).as(" avg_val" ))
@@ -444,15 +445,15 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter {
444445 AddData (inputData, 1 , 2 ),
445446 AdvanceManualClock (100 ),
446447 checkMetrics { metrics =>
447- assert(metrics.get(" my_event" ) === Row (1 , 2 , 3L , 1L ))
448+ assert(metrics.get(" my_event" ) === Row (1 , 2 , 3L , 1L , 1 ))
448449 assert(metrics.get(" other_event" ) === Row (1 ))
449450 },
450451
451452 // Batch 2
452453 AddData (inputData, 10 , 30 , - 10 , 5 ),
453454 AdvanceManualClock (100 ),
454455 checkMetrics { metrics =>
455- assert(metrics.get(" my_event" ) === Row (- 10 , 30 , 35L , 3L ))
456+ assert(metrics.get(" my_event" ) === Row (- 10 , 30 , 35L , 3L , 5 ))
456457 assert(metrics.get(" other_event" ) === Row (8 ))
457458 },
458459
0 commit comments