IMPALA-2897: Build rows that are equivalent (where nullptrs are counted as equivalent) should not occupy distinct buckets.
| 298 | // IMPALA-2897: Build rows that are equivalent (where nullptrs are counted as equivalent) |
| 299 | // should not occupy distinct buckets. |
| 300 | void NullBuildRowTest() { |
| 301 | TupleRow* build_rows[2]; |
| 302 | for (int i = 0; i < 2; ++i) build_rows[i] = CreateNullTupleRow(); |
| 303 | |
| 304 | // Create the hash table and insert the build rows |
| 305 | HashTable* hash_table; |
| 306 | ASSERT_TRUE(CreateHashTable(true, 1024, &hash_table)); |
| 307 | scoped_ptr<HashTableCtx> ht_ctx; |
| 308 | EXPECT_OK(HashTableCtx::Create(&pool_, runtime_state_, |
| 309 | build_exprs_, probe_exprs_, true /* stores_nulls_ */, |
| 310 | vector<bool>(build_exprs_.size(), false), 1, 0, 1, &mem_pool_, &mem_pool_, |
| 311 | &mem_pool_, &ht_ctx)); |
| 312 | EXPECT_OK(ht_ctx->Open(runtime_state_)); |
| 313 | |
| 314 | for (int i = 0; i < 2; ++i) { |
| 315 | if (!ht_ctx->EvalAndHashBuild(build_rows[i])) continue; |
| 316 | BufferedTupleStream::FlatRowPtr dummy_flat_row = nullptr; |
| 317 | EXPECT_TRUE(hash_table->stores_tuples_); |
| 318 | Status status; |
| 319 | bool inserted = |
| 320 | hash_table->Insert(ht_ctx.get(), dummy_flat_row, build_rows[i], &status); |
| 321 | EXPECT_TRUE(inserted); |
| 322 | ASSERT_OK(status); |
| 323 | } |
| 324 | EXPECT_EQ(hash_table->num_buckets() - hash_table->EmptyBuckets(), 1); |
| 325 | ht_ctx->Close(runtime_state_); |
| 326 | } |
| 327 | |
| 328 | // This test inserts the build rows [0->5) to hash table. It validates that they |
| 329 | // are all there using a full table scan. It also validates that Find() is correct |
nothing calls this directly
no test coverage detected