Simple aggregation can be cached
(self, vector, unique_database)
| 359 | assertCounters(exempt3.runtime_profile, num_hits=1, num_halted=0, num_skipped=0) |
| 360 | |
| 361 | def test_aggregate(self, vector, unique_database): |
| 362 | """Simple aggregation can be cached""" |
| 363 | self.client.set_configuration(vector.get_value('exec_option')) |
| 364 | fq_table = "{0}.agg".format(unique_database) |
| 365 | self.create_table(fq_table) |
| 366 | |
| 367 | result1 = self.execute_query("SELECT sum(age) FROM {0}".format(fq_table)) |
| 368 | result2 = self.execute_query("SELECT sum(age) FROM {0}".format(fq_table)) |
| 369 | |
| 370 | assert result1.success |
| 371 | assert result2.success |
| 372 | assert result1.data == result2.data |
| 373 | assertCounters(result1.runtime_profile, 0, 0, 0, num_matches=2) |
| 374 | # Aggregate should hit, and scan node below it will miss. |
| 375 | assertCounterOrder(result2.runtime_profile, NUM_HITS, [1, 0]) |
| 376 | assertCounter(result2.runtime_profile, NUM_HALTED, 0, num_matches=2) |
| 377 | assertCounter(result2.runtime_profile, NUM_SKIPPED, 0, num_matches=2) |
| 378 | # Verify that the bytes written by the first profile are the same as the bytes |
| 379 | # read by the second profile. |
| 380 | bytes_written = getCounterValues(result1.runtime_profile, "TupleCacheBytesWritten") |
| 381 | bytes_read = getCounterValues(result2.runtime_profile, "TupleCacheBytesRead") |
| 382 | assert len(bytes_written) == 2 |
| 383 | assert len(bytes_read) == 1 |
| 384 | assert bytes_written[0] == bytes_read[0] |
| 385 | |
| 386 | def test_aggregate_reuse(self, vector): |
| 387 | """Cached aggregation can be re-used""" |
nothing calls this directly
no test coverage detected