@Test public void testSpilling() throws Exception { HiveKVResultCache cache = new HiveKVResultCache(); final int recordCount = HiveKVResultCache.IN_MEMORY_NUM_ROWS * 3; // Test using the same cache where first n rows are inserted then cache is cleared. // Next reuse the same cache and insert another m rows and verify the cache stores correctly. // This simulates reusing the same cache over and over again. testSpillingHelper(cache, recordCount); testSpillingHelper(cache, 1); testSpillingHelper(cache, recordCount); }